Node

Lore. Node

A class representing a node. A node is the base-class for all 3D objects.

Constructor

new Node()

Source:
Properties:
Name Type Description
type String

The type name of this object (Lore.Node).

id String

A GUID uniquely identifying the node.

isVisible Boolean

A boolean indicating whether or not the node is visible (rendered).

position Lore.Vector3f

The position of this node.

rotation Lore.Quaternion

The rotation of this node.

scale Lore.Vector3f

The scale of this node.

up Lore.Vector3f

The up vector associated with this node.

normalMatrix Lore.Matrix3f

The normal matrix of this node.

modelMatrix Lore.Matrix4f

The model matrix associated with this node.

isStale Boolean

A boolean indicating whether or not the modelMatrix of this node is stale.

children Array.<Lore.Node>

An array containing child-nodes.

parent Lore.Node

The parent node.

Creates an instance of Node.

Methods

(static) createGUID() → {String}

Source:

Creates a GUID.

Returns:

A GUID.

Type
String

applyMatrix(matrix) → {Lore.Node}

Source:

Apply a matrix to the model matrix of this node.

Parameters:
Name Type Description
matrix Lore.Matrix4f

A matrix.

Returns:

Itself.

Type
Lore.Node

getForwardVector() → {Lore.Vector3f}

Source:

Returns the forward vector for this node.

Returns:

The forward vector for this node.

Type
Lore.Vector3f

getModelMatrix() → {Float32Array}

Source:

Returns the model matrix as an array.

Returns:

The model matrix.

Type
Float32Array

getRightVector() → {Lore.Vector3f}

Source:

Returns the right vector for this node.

Returns:

The right vector for this node.

Type
Lore.Vector3f

getRotationMatrix() → {Lore.Matrix4f}

Source:

Get the rotation matrix for this node.

Returns:

This nodes rotation matrix.

Type
Lore.Matrix4f

getUpVector() → {Lore.Vector3f}

Source:

Returns the up vector for this node.

Returns:

The up vector for this node.

Type
Lore.Vector3f

rotate(axis, angle) → {Lore.Node}

Source:

Rotate this node by an angle on an axis.

Parameters:
Name Type Description
axis Lore.Vector3f

A vector representing an angle

angle Number

An angle.

Returns:

Itself.

Type
Lore.Node

rotateX(angle) → {Lore.Node}

Source:

Rotate around the x-axis.

Parameters:
Name Type Description
angle Number

An angle.

Returns:

Itself.

Type
Lore.Node

rotateY(angle) → {Lore.Node}

Source:

Rotate around the y-axis.

Parameters:
Name Type Description
angle Number

An angle.

Returns:

Itself.

Type
Lore.Node

rotateZ(angle) → {Lore.Node}

Source:

Rotate around the z-axis.

Parameters:
Name Type Description
angle Number

An angle.

Returns:

Itself.

Type
Lore.Node

setRotation(axis, angle) → {Lore.Node}

Source:

Set the rotation from an axis and an angle.

Parameters:
Name Type Description
axis Lore.Vector3f

A vector representing an angle

angle Number

An angle.

Returns:

Itself.

Type
Lore.Node

setTranslation(v) → {Lore.Node}

Source:

Set the translation (position) of this node.

Parameters:
Name Type Description
v Lore.Vector3f

A vector.

Returns:

Itself.

Type
Lore.Node

translateOnAxis(axis, distance) → {Lore.Node}

Source:

Translates this node on an axis.

Parameters:
Name Type Description
axis Lore.Vector3f

A vector representing an axis.

distance Number

The distance for which to move the node along the axis.

Returns:

Itself.

Type
Lore.Node

translateX(distance) → {Lore.Node}

Source:

Translates the node along the x-axis.

Parameters:
Name Type Description
distance Number

The distance for which to move the node along the x-axis.

Returns:

Itself.

Type
Lore.Node

translateY(distance) → {Lore.Node}

Source:

Translates the node along the y-axis.

Parameters:
Name Type Description
distance Number

The distance for which to move the node along the y-axis.

Returns:

Itself.

Type
Lore.Node

translateZ(distance) → {Lore.Node}

Source:

Translates the node along the z-axis.

Parameters:
Name Type Description
distance Number

The distance for which to move the node along the z-axis.

Returns:

Itself.

Type
Lore.Node

update() → {Lore.Node}

Source:

Update the model matrix of this node. Has to be called in order to apply scaling, rotations or translations.

Returns:

Itself.

Type
Lore.Node