Vector4

clay. Vector4

# new Vector4(x, y, z, w)

Source:
Parameters:
Name Type Description
x number
y number
z number
w number

Members

# _dirty :boolean

Source:

Dirty flag is used by the Node to determine if the matrix is updated to latest

Type:
  • boolean

# array :Float32Array

Source:

Storage of Vector4, read and write of x, y, z, w will change the values in array All methods also operate on the array instead of x, y, z, w components

Type:
  • Float32Array

# w :number

Source:
Type:
  • number

# x :number

Source:
Type:
  • number

# y :number

Source:
Type:
  • number

# z :number

Source:
Type:
  • number

Methods

# add(b) → {clay.Vector4}

Source:

Add b to self

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# clone() → {clay.Vector4}

Source:

Clone a new Vector4

Returns:
Type
clay.Vector4

# copy(b) → {clay.Vector4}

Source:

Copy from b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# dist(b) → {number}

Source:

Alias for distance

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
number

# distance(b) → {number}

Source:

Distance between self and b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
number

# div(b) → {clay.Vector4}

Source:

Alias for divide

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# divide(b) → {clay.Vector4}

Source:

Divide self by b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# dot(b) → {number}

Source:

Dot product of self and b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
number

# len() → {number}

Source:

Alias of length

Returns:
Type
number

# length() → {number}

Source:

Calculate the length

Returns:
Type
number

# lerp(a, b, t) → {clay.Vector4}

Source:

Linear interpolation between a and b

Parameters:
Name Type Description
a clay.Vector4
b clay.Vector4
t number
Returns:
Type
clay.Vector4

# max(b) → {clay.Vector4}

Source:

Maximum of self and b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# min(b) → {clay.Vector4}

Source:

Minimum of self and b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# mul(b) → {clay.Vector4}

Source:

Alias for multiply

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# multiply(b) → {clay.Vector4}

Source:

Mutiply self and b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# negate() → {clay.Vector4}

Source:

Negate self

Returns:
Type
clay.Vector4

# normalize() → {clay.Vector4}

Source:

Normalize self

Returns:
Type
clay.Vector4

# random(scale) → {clay.Vector4}

Source:

Generate random x, y, z, w components with a given scale

Parameters:
Name Type Description
scale number
Returns:
Type
clay.Vector4

# scale(scale) → {clay.Vector4}

Source:

Scale self

Parameters:
Name Type Description
scale number
Returns:
Type
clay.Vector4

# scaleAndAdd(b, scale) → {clay.Vector4}

Source:

Scale b and add to self

Parameters:
Name Type Description
b clay.Vector4
scale number
Returns:
Type
clay.Vector4

# set(x, y, z, w) → {clay.Vector4}

Source:

Set x, y and z components

Parameters:
Name Type Description
x number
y number
z number
w number
Returns:
Type
clay.Vector4

# setArray(arr) → {clay.Vector4}

Source:

Set x, y, z and w components from array

Parameters:
Name Type Description
arr Float32Array | Array.<number>
Returns:
Type
clay.Vector4

# sqrDist(b) → {number}

Source:

Alias for squaredDistance

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
number

# sqrLen() → {number}

Source:

Alias for squaredLength

Returns:
Type
number

# squaredDistance(b) → {number}

Source:

Squared distance between self and b

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
number

# squaredLength() → {number}

Source:

Squared length of self

Returns:
Type
number

# sub(b) → {clay.Vector4}

Source:

Alias for subtract

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# subtract(b) → {clay.Vector4}

Source:

Subtract b from self

Parameters:
Name Type Description
b clay.Vector4
Returns:
Type
clay.Vector4

# transformMat4(m) → {clay.Vector4}

Source:

Transform self with a Matrix4 m

Parameters:
Name Type Description
m clay.Matrix4
Returns:
Type
clay.Vector4

# transformQuat(q) → {clay.Vector4}

Source:

Transform self with a Quaternion q

Parameters:
Name Type Description
q clay.Quaternion
Returns:
Type
clay.Vector4

# (static) add(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) copy(out, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) dist(a, b) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
b clay.Vector4
Returns:
Type
number

# (static) distance(a, b) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
b clay.Vector4
Returns:
Type
number

# (static) div(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) divide(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) dot(a, b) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
b clay.Vector4
Returns:
Type
number

# (static) len(a) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
Returns:
Type
number

# (static) lerp(out, a, b, t) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
t number
Returns:
Type
clay.Vector4

# (static) max(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) min(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) mul(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) multiply(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) negate(out, a) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
Returns:
Type
clay.Vector4

# (static) normalize(out, a) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
Returns:
Type
clay.Vector4

# (static) random(out, scale) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
scale number
Returns:
Type
clay.Vector4

# (static) scale(out, a, scale) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
scale number
Returns:
Type
clay.Vector4

# (static) scaleAndAdd(out, a, b, scale) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
scale number
Returns:
Type
clay.Vector4

# (static) set(out, x, y, z) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
x number
y number
z number
Returns:
Type
clay.Vector4

# (static) sqrDist(a, b) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
b clay.Vector4
Returns:
Type
number

# (static) sqrLen(a) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
Returns:
Type
number

# (static) squaredDistance(a, b) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
b clay.Vector4
Returns:
Type
number

# (static) squaredLength(a) → {number}

Source:
Parameters:
Name Type Description
a clay.Vector4
Returns:
Type
number

# (static) sub(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) subtract(out, a, b) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
b clay.Vector4
Returns:
Type
clay.Vector4

# (static) transformMat4(out, a, m) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
m clay.Matrix4
Returns:
Type
clay.Vector4

# (static) transformQuat(out, a, q) → {clay.Vector4}

Source:
Parameters:
Name Type Description
out clay.Vector4
a clay.Vector4
q clay.Quaternion
Returns:
Type
clay.Vector4