Class

Transformable

Transformable()

Transformable: Manage matrix's transformations

Constructor

new Transformable()

Constructor

View Source Transformable.js, line 12

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

View Source Transformable.js, line 267

True if the matrix have been updated, otherwise false
boolean

getNormalMatrix() → {Array.<number>|mat4}

Return computed normal matrix

View Source Transformable.js, line 307

A matrix
Array.<number> | mat4

getOrigin() → {Array.<number>|vec3}

Return the origin

View Source Transformable.js, line 316

A vector with the value for each axis
Array.<number> | vec3

getPosition() → {Array.<number>|vec3}

Return relative position

View Source Transformable.js, line 325

A vector with the value for each axis
Array.<number> | vec3

getRotation() → {Array.<number>}

Return the rotation in degrees
To Do:
  • Implement this function

View Source Transformable.js, line 335

A vector with the value for each axis in degrees
Array.<number>

getScale() → {Array.<number>|vec3}

Return the scale

View Source Transformable.js, line 344

A vector with the value for each axis
Array.<number> | vec3

getTransformationMatrix() → {Array.<number>|mat4}

Return computed matrix

View Source Transformable.js, line 298

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

View Source Transformable.js, line 89

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

View Source Transformable.js, line 146

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

View Source Transformable.js, line 166

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

View Source Transformable.js, line 186

A reference to the instance

setRotationFromMatrix(matrix) → {Transformable}

Set rotation from a rotation matrix
Parameters:
Name Type Description
matrix mat4 A Matrix

View Source Transformable.js, line 231

A reference to the instance

setRotationFromQuaternion(quaternion) → {Transformable}

Set rotation from a quaternion
Parameters:
Name Type Description
quaternion quat A quaternion

View Source Transformable.js, line 216

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

View Source Transformable.js, line 248

A reference to the instance