Vector3

clay. Vector3

# new Vector3(x, y, z)

Source:
Parameters:
Name Type Description
x number
y number
z 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 Vector3, read and write of x, y, z will change the values in array All methods also operate on the array instead of x, y, z components

Type:
  • Float32Array

# x :number

Source:
Type:
  • number

# y :number

Source:
Type:
  • number

# z :number

Source:
Type:
  • number

# (static, readonly) NEGATIVE_X :clay.Vector3

Source:
Type:

# (static, readonly) NEGATIVE_Y :clay.Vector3

Source:
Type:

# (static, readonly) POSITIVE_X :clay.Vector3

Source:
Type:

# (static, readonly) POSITIVE_Y :clay.Vector3

Source:
Type:

# (static, readonly) POSITIVE_Z :clay.Vector3

Source:
Type:

# (static, readonly) UP :clay.Vector3

Source:
Type:

# (static, readonly) ZERO :clay.Vector3

Source:
Type:

Methods

# add(b) → {clay.Vector3}

Source:

Add b to self

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

# applyProjection(m) → {clay.Vector3}

Source:

Trasnform self into projection space with m

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

# clone() → {clay.Vector3}

Source:

Clone a new Vector3

Returns:
Type
clay.Vector3

# copy(b) → {clay.Vector3}

Source:

Copy from b

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

# cross(a, b) → {clay.Vector3}

Source:

Cross product of self and b, written to a Vector3 out

Parameters:
Name Type Description
a clay.Vector3
b clay.Vector3
Returns:
Type
clay.Vector3

# dist(b) → {number}

Source:

Alias for distance

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

# distance(b) → {number}

Source:

Distance between self and b

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

# div(b) → {clay.Vector3}

Source:

Alias for divide

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

# divide(b) → {clay.Vector3}

Source:

Divide self by b

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

# dot(b) → {number}

Source:

Dot product of self and b

Parameters:
Name Type Description
b clay.Vector3
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.Vector3}

Source:

Linear interpolation between a and b

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

# max(b) → {clay.Vector3}

Source:

Maximum of self and b

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

# min(b) → {clay.Vector3}

Source:

Minimum of self and b

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

# mul(b) → {clay.Vector3}

Source:

Alias for multiply

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

# multiply(b) → {clay.Vector3}

Source:

Mutiply self and b

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

# negate() → {clay.Vector3}

Source:

Negate self

Returns:
Type
clay.Vector3

# normalize() → {clay.Vector3}

Source:

Normalize self

Returns:
Type
clay.Vector3

# random(scale) → {clay.Vector3}

Source:

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

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

# scale(scale) → {clay.Vector3}

Source:

Scale self

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

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

Source:

Scale b and add to self

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

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

Source:

Set x, y and z components

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

# setArray(arr) → {clay.Vector3}

Source:

Set x, y and z components from array

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

# sqrDist(b) → {number}

Source:

Alias for squaredDistance

Parameters:
Name Type Description
b clay.Vector3
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.Vector3
Returns:
Type
number

# squaredLength() → {number}

Source:

Squared length of self

Returns:
Type
number

# sub(b) → {clay.Vector3}

Source:

Alias for subtract

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

# subtract(b) → {clay.Vector3}

Source:

Subtract b from self

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

# transformMat3(m) → {clay.Vector3}

Source:

Transform self with a Matrix3 m

Parameters:
Name Type Description
m clay.Matrix3
Returns:
Type
clay.Vector3

# transformMat4(m) → {clay.Vector3}

Source:

Transform self with a Matrix4 m

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

# transformQuat(q) → {clay.Vector3}

Source:

Transform self with a Quaternion q

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

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

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

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

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

# (static) cross(out, a, b) → {clay.Vector3}

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

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

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

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

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

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

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

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

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

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

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

# (static) eulerFromMat3()

Source:

Convert rotation matrix to euler angle from three.js

# (static) eulerFromQuat()

Source:

Convert quaternion to euler angle Quaternion must be normalized From three.js

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# (static) transformMat3(out, a, m) → {clay.Vector3}

Source:
Parameters:
Name Type Description
out clay.Vector3
a clay.Vector3
m Matrix3
Returns:
Type
clay.Vector3

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

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

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

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