Constructor
Methods
computeTransformationMatrix(parentMatrix, forceUpdate) → {boolean}
Update matrix
Parameters:
Name | Type | Description |
---|---|---|
parentMatrix |
?Array.<number> | mat4 | Parent transformable's matrix |
forceUpdate |
boolean | True to force an update |
True if the matrix have been updated, otherwise false
boolean
getNormalMatrix() → {Array.<number>|mat4}
Return computed normal matrix
A matrix
Array.<number>
|
mat4
getOrigin() → {Array.<number>|vec3}
Return the origin
A vector with the value for each axis
Array.<number>
|
vec3
getPosition() → {Array.<number>|vec3}
Return relative position
A vector with the value for each axis
Array.<number>
|
vec3
getRotation() → {Array.<number>}
Return the rotation in degrees
- To Do:
-
- Implement this function
A vector with the value for each axis in degrees
Array.<number>
getScale() → {Array.<number>|vec3}
Return the scale
A vector with the value for each axis
Array.<number>
|
vec3
getTransformationMatrix() → {Array.<number>|mat4}
Return computed matrix
A reference to the object's matrix
Array.<number>
|
mat4
lookAt(position, up) → {Transformable}
Look at the given position
Parameters:
Name | Type | Description |
---|---|---|
position |
Array.<number> | Float32Array | Float64Array | An array with value for each axis |
up |
Array.<number> | Float32Array | Float64Array | An array with value for each axis |
A reference to the instance
setOrigin(x, ynullable, znullable) → {Transformable}
Set origin
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
x |
number | Array.<number> | Origin on X or an array with origin on each axis | |
y |
number |
<nullable> |
Origin on Y |
z |
number |
<nullable> |
Origin on Z |
A reference to the instance
setPosition(x, ynullable, znullable) → {Transformable}
Set position
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
x |
number | Array.<number> | Position on X or an array with position on each axis | |
y |
number |
<nullable> |
Position on Y |
z |
number |
<nullable> |
Position on Z |
A reference to the instance
setRotation(x, ynullable, znullable) → {Transformable}
Set rotation using values in degrees
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
x |
number | Array.<number> | Rotation on X in degrees or an array with rotation on each axis | ||
y |
number |
<nullable> |
0 | Rotation on Y in degrees |
z |
number |
<nullable> |
0 | Rotation on Z in degrees |
A reference to the instance
setRotationFromMatrix(matrix) → {Transformable}
Set rotation from a rotation matrix
Parameters:
Name | Type | Description |
---|---|---|
matrix |
mat4 | A Matrix |
A reference to the instance
setRotationFromQuaternion(quaternion) → {Transformable}
Set rotation from a quaternion
Parameters:
Name | Type | Description |
---|---|---|
quaternion |
quat | A quaternion |
A reference to the instance
setScale(x, ynullable, znullable) → {Transformable}
Set scale
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
x |
number | Array.<number> | Scale on X or an array with scale on each axis | |
y |
number |
<nullable> |
Scale on Y |
z |
number |
<nullable> |
Scale on Z |
A reference to the instance