Node

lumin. Node

Node - Fundamental Object that is used to represent a "Node" in a Prism

Constructor

new Node()

Methods

addChild(a_pChild) → {boolean}

Adds a child to the current Node, removing it from its current parent.

A child can only have a single Parent

Parameters:
Name Type Description
a_pChild lumin.Node

The Node to add as a child to this Node.

Returns:

true if successful, false if failed

Type
boolean

addToLayer(a_layer)

Adds this node to the specified node layer. Nodes can be members of multiple layers.

Parameters:
Name Type Description
a_layer BigInt

(static) Delete(node)

Client-side only: this static function is used to delete a
node with its Prism's deleteNode function.

Parameters:
Name Type Description
node lumin.Node

is the node to delete

findChild(name) → {lumin.Node}

Find the first named child in the node hierarchy, including this Node.

Does a breadth-first search of the child node hierarchy
for the specified named Node and will return the first encountered match,
or nullptr if no named Node found.

Parameters:
Name Type Description
name string

The name to search for.

Returns:
Type
lumin.Node

findChildren(a_type, a_bExactTypeopt, a_bIncludeSelfopt) → {Array.<lumin.Node>}

Does a breadth-first search of the child node hierarchy
for the specified Node type.

Parameters:
Name Type Attributes Default Description
a_type number

The type of Node to find in the child hierarchy.

a_bExactType boolean <optional>
false

Flag to indicate if the child node must be the exact type or can be derived from the type (default false).

a_bIncludeSelf boolean <optional>
false

Flag to indicate if the search should include this Node (default false).

Returns:

A vector of Node pointers containing the results.

Type
Array.<lumin.Node>

findParent(a_type, a_bExactTypeopt) → {lumin.Node}

Searches up the tree parentage for the specific Node type.

Parameters:
Name Type Attributes Default Description
a_type number

The type of Node to find in the parent hierarchy.

a_bExactType boolean <optional>
false

Flag to indicate if the parent node must be the exact type or can be derived from the type (default false).

Returns:

The parent node, if found, null if not found.

Type
lumin.Node

getAABB() → {lumin.math.AABB}

Get the AABB of this Node's full hierarchy, including all descendants,
with all Node transforms applied.

The returned AABB encompasses this Node and all descendant Nodes
and is aligned to the coordinate system the Node resides within,
i.e. the Node's parent coordinate system.
Note, the returned AABB is not guaranteed to be the minimal,
tightest fitting AABB to encompass the Node's descendant hierarchy,
but it will fully enlose the Node's hierarchy.

Returns:

The bounding box

Type
lumin.math.AABB

getAnchorPosition() → {vec3}

Returns the anchor position of the node.

Returns:

The anchor position.

Type
vec3

getChild(a_iIndex) → {lumin.Node}

Gets the n'th child from this Node's children

Parameters:
Name Type Description
a_iIndex number

The index of the child.

Returns:

Child Node

Type
lumin.Node

getChildCount() → {number}

Gets the number of immediate children this Node has

Returns:

Count of immediate child Nodes

Type
number

getCurrentPrismTransform() → {mat4}

Get the Cached Prism Transform of this Node

Returns:

Transform Matrix

Type
mat4

getCurrentWorldTransform() → {mat4}

Get the Cached World Transform of this Node

Returns:

Transform Matrix

Type
mat4

getCursorHoverState() → {lumin.CursorHoverState}

Get the cursor hover state for this Node.

Returns:

the cursor state.

Type
lumin.CursorHoverState

getLocalAABB() → {lumin.math.AABB}

Get the local AABB of this Node only, not including children,
aligned to this Node's local coordinate system.

A local AABB of math::AABB::EMPTY indicates the Node either
has no visual information or that local AABB is not supported
for the Node.

Note: The local AABB for ModelNodes is currently not supported
and will report math::AABB::EMPTY.

Returns:

The bounding box.

Type
lumin.math.AABB

getLocalTransform() → {mat4}

Get the Local Transform of this Node

Returns:

Transform Matrix

Type
mat4

getName() → {string}

Get the name of the Node.

This call returns EMPTY_STRING if the Node's
name has not been set.

Returns:

The name of the Node, if set.

Type
string

getNodeId() → {BigInt}

Gets the Node Id of this Node

Every Node is assigned a unique ID per Prism

Returns:

Node id of the current Node

Type
BigInt

getParent() → {lumin.Node}

Gets this Node's immediate parent

Returns:

Parent Node, nullptr = no parent

Type
lumin.Node

getParentedBoneName() → {string}

When parented to a parents bone with setParentedBoneName

Returns:

Parents bone name we are attached to

Type
string

getPrismId() → {BigInt}

Returns the id of the prism the node belongs to.

Returns:

the prism id (0 = invalid prism)

Type
BigInt

getRoot() → {lumin.RootNode}

Gets the root node of the node tree this node belongs to.

Returns:

The root node, or nullptr if none.

Type
lumin.RootNode

isInLayer(a_layer) → {boolean}

Checks to see if node subscribes to the specified node layer.

Parameters:
Name Type Description
a_layer BigInt

The layer to test if this node is a member of.

Returns:

True if this node subscribes to the specified layer.

Type
boolean

isInSubtree(pParent) → {boolean}

Determines if this Node is within the subtree.

Parameters:
Name Type Description
pParent lumin.Node
Returns:

true if this Node is within the subtree, false if not.

Type
boolean

isSkipRaycast() → {boolean}

Returns the skip raycast state of the node.

Returns:

True if the node is skipped during raycasting.

Type
boolean

isTriggerable() → {boolean}

Returns true if this node should handle trigger presses directly.

Returns:

true if this node will handle trigger presses directly when focused,
false if trigger press will instead enter prism placement mode.

Type
boolean

isVisibilityInherited() → {boolean}

Returns whether this Node's visibility is inherited by its children or not.

Returns:

True if the Node's visiblity is inherited.

Type
boolean

isVisible() → {boolean}

Returns the visibility state of the node. Note that only the local state is checked, the
effect of a parent's visibility is ignored.

Returns:

True if the Node is visible.

Type
boolean

isVisibleInPrism() → {boolean}

Returns the visibility of the Node in the hierarchy based on self visibility and any
potential inherited visibility.

Returns:

True if the Node is visible in the Prism.

Type
boolean

removeChild(a_pChild)

Remove a child from the current Node

Parameters:
Name Type Description
a_pChild lumin.Node

The child Node to remove.

removeFromLayer(a_layer)

Removes this node from the specified node layer.

Parameters:
Name Type Description
a_layer BigInt

The layer this node will be removed from.

setCursorHoverState(state)

Set the cursor hover state for this Node.

Setting this will set the cursor state when this Node
or any descendant Nodes, that are not explicitly set,
are hovered over.

Parameters:
Name Type Description
state lumin.CursorHoverState

The cursor state

setName(a_name) → {boolean}

Set the name of the Node

By default a Node has no name.

Parameters:
Name Type Description
a_name string

The new name of the Node.

Returns:

true if the name of the Node was successfully set, false otherwise.

Type
boolean

setParentedBoneName(a_boneName) → {boolean}

Set the bone in the parent by name that this child will attach to
This node must have a parent and the parent must be of type ModelNode.

Parameters:
Name Type Description
a_boneName string

bone name to attach to

Returns:

true if successful, false if failed

Type
boolean

setSkipRaycast(a_skipRaycast, a_propagateToChildrenopt)

Sets the skip raycast state of the node.

Parameters:
Name Type Attributes Default Description
a_skipRaycast boolean

Raycast skip flag.

a_propagateToChildren boolean <optional>
false

Flag to also set the raycast state of any children

setTriggerable(a_triggerable)

Sets whether this node should handle trigger presses directly.

Parameters:
Name Type Description
a_triggerable boolean

true if this node should handle trigger presses directly when focused,
false if trigger press should instead enter prism placement mode.

setVisibilityInherited(a_inherit)

Flags that the visibility state of this node should be inherited by its children. This does
not change a child's visibility set by setVisible. A visibility of false will take precedence
over a visibility of true. The tables below show the draw result for various combinations of
node visibility and inheritance.

         visible     inherit     drawn
node  :   false       true        no
child :   true          x         no

         visible     inherit     drawn
node  :   false       false       no
child :   true          x         yes

         visible     inherit     drawn
node  :   true        true        yes
child :   false         x         no

         visible     inherit     drawn
node  :   true        false       yes
child :   false         x         no
Parameters:
Name Type Description
a_inherit boolean

Flag that this node's children should inherit its visibility.

setVisible(a_visible, a_propagateToChildrenopt)

Sets the visibility state of the node.

Parameters:
Name Type Attributes Default Description
a_visible boolean

Visibility flag

a_propagateToChildren boolean <optional>
false

Flag to also set the visibility state of any children