Class

Drawable

Drawable()

A drawable element

Constructor

Extends

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
Inherited From:

View Source Transformable.js, line 267

True if the matrix have been updated, otherwise false
boolean

draw(renderTarget)

Draw the element
Parameters:
Name Type Description
renderTarget RenderTarget Renderer who called this method

View Source Objects/Drawable.js, line 15

enable(value) → {Node}

Set node's state
Parameters:
Name Type Description
value boolean True to enable, false to disable
Inherited From:

View Source Scene/Node.js, line 115

A reference to the instance
Node

findChild(name) → (nullable) {Node}

Find the child with the given name
Parameters:
Name Type Description
name string A string
Inherited From:

View Source Scene/Node.js, line 127

A Node instance of null
Node

getBoundingBox() → {Box}

Return Node's bounding Box
Inherited From:

View Source Scene/Node.js, line 202

A Box instance
Box

getChildren() → {Array.<Node>}

Return Node's children
Inherited From:

View Source Scene/Node.js, line 211

An array of Node
Array.<Node>

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

Return computed normal matrix
Inherited From:

View Source Transformable.js, line 307

A matrix
Array.<number> | mat4

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

Return the origin
Inherited From:

View Source Transformable.js, line 316

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

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

Return relative position
Inherited From:

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
Inherited From:
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
Inherited From:

View Source Transformable.js, line 344

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

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

Return computed matrix
Inherited From:

View Source Transformable.js, line 298

A reference to the object's matrix
Array.<number> | mat4

isEnabled() → {boolean}

Get state
Inherited From:

View Source Scene/Node.js, line 220

True if the node is enabled, otherwise false
boolean

isRoot() → {boolean}

Indicates if the current node is the scene's root
Inherited From:

View Source Scene/Node.js, line 229

True if it's the root node, otherwise false
boolean

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
Inherited From:

View Source Transformable.js, line 89

A reference to the instance

removeChild(node) → {boolean}

Remove a child from the node
Parameters:
Name Type Description
node Node A Node instance
Inherited From:

View Source Scene/Node.js, line 147

True if the operation is a success
boolean

setChildren(nodes)

Force add children without setting parent node, carefully use this one.
Parameters:
Name Type Description
nodes Array.<Node> An array of nodes
Inherited From:

View Source Scene/Node.js, line 105

setName(name) → {Node}

Set the name to easily retrieve it later
Parameters:
Name Type Description
name string A string
Inherited From:

View Source Scene/Node.js, line 165

A reference to the instance
Node

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
Inherited From:

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
Inherited From:

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
Inherited From:

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
Inherited From:

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
Inherited From:

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
Inherited From:

View Source Transformable.js, line 248

A reference to the instance

update(deltaTime, forceUpdatenullable) → {boolean}

Update the node and his children
Parameters:
Name Type Attributes Default Description
deltaTime number A floating value representing time elapsed between two frames
forceUpdate boolean <nullable>
false Set to true to force an update
Inherited From:

View Source Scene/Node.js, line 178

True if the node has been updated
boolean

visit(renderTarget) → {boolean}

Visit the node and his children
Parameters:
Name Type Description
renderTarget RenderTarget Renderer who called this method
Overrides:

View Source Objects/Drawable.js, line 23

True if visit was successful, otherwise false
boolean