Model. A Node encodes a transform relative to its parents. A Node can have
child nodes. Optionally a node can specify a MeshPart and a Material to be applied to the mesh part.
| Modifier and Type | Field and Description |
|---|---|
| private final Array | |
| public final Matrix4 | globalTransform
the global transform, product of local transform and transform of the parent node, calculated via
|
| public String | id
the id, may be null, FIXME is this unique? |
| public boolean | inheritTransform
Whether this node should inherit the transformation of its parent node, defaults to true. |
| public boolean | isAnimated
Whether this node is currently being animated, if so the translation, rotation and scale values are not used. |
| public final Matrix4 | localTransform
the local transform, based on translation/rotation/scale ( |
| protected Node | |
| public Array | |
| public final Quaternion | rotation
the rotation, relative to the parent, not modified by animations |
| public final Vector3 | scale
the scale, relative to the parent, not modified by animations |
| public final Vector3 | translation
the translation, relative to the parent, not modified by animations |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public <T extends Node> int | Returns: the zero-based index of the childThe Node to add as child of this Node child)Adds the specified node as the currently last child of this node. |
| public <T extends Node> int | Returns: the zero-based index of the first added childThe Node to add as child of this Node nodes)Adds the specified nodes as the currently last child of this node. |
| public <T extends Node> void | attachTo(T
The Node to attach this Node to. parent)Adds this node as child to specified parent Node, synonym for: |
| public void | |
| public BoundingBox | |
| public BoundingBox | calculateBoundingBox(final BoundingBox out, boolean transform)
Calculate the bounding box of this Node. |
| public Matrix4 | Returns: the local transformCalculates the local transform based on the translation, scale and rotation |
| public void | calculateTransforms(boolean
whether to calculate the local/world transforms for children. recursive)Calculates the local and world transform of this node and optionally all its children. |
| public Matrix4 | Returns: the world transformCalculates the world transform; the product of local transform and the parent's world transform. |
| public Node | |
| public void | |
| public BoundingBox | |
| public BoundingBox | extendBoundingBox(final BoundingBox out, boolean transform)
Extends the bounding box with the bounds of this Node. |
| public Node | getChild(final int
The zero-based index of the child node to get, must be: 0 <= index < index)getChildCount().Returns: The child node at the specified index |
| public Node | |
| public int | |
| public Iterable | |
| public static Node | |
| public Node | |
| public boolean | |
| public boolean | |
| public <T extends Node> int | Returns: the zero-based index of the childThe zero-based index at which to add the child index, final T The Node to add as child of this Node child)Insert the specified node as child of this node at the specified index. |
| public <T extends Node> int | Returns: the zero-based index of the first inserted childThe zero-based index at which to add the child index, final Iterable<T> The nodes to add as child of this Node nodes)Insert the specified nodes as children of this node at the specified index. |
| public <T extends Node> boolean | Returns: Whether the removal was successful.The child node to remove. child)Removes the specified node as child of this node. |
| protected Node |
| children | back to summary |
|---|---|
| private final Array<Node> children | |
| globalTransform | back to summary |
|---|---|
| public final Matrix4 globalTransform the global transform, product of local transform and transform of the parent node, calculated via
| |
| id | back to summary |
|---|---|
| public String id the id, may be null, FIXME is this unique? | |
| inheritTransform | back to summary |
|---|---|
| public boolean inheritTransform Whether this node should inherit the transformation of its parent node, defaults to true. When this flag is false the value
of | |
| isAnimated | back to summary |
|---|---|
| public boolean isAnimated Whether this node is currently being animated, if so the translation, rotation and scale values are not used. | |
| localTransform | back to summary |
|---|---|
| public final Matrix4 localTransform the local transform, based on translation/rotation/scale ( | |
| parent | back to summary |
|---|---|
| protected Node parent | |
| parts | back to summary |
|---|---|
| public Array<NodePart> parts | |
| rotation | back to summary |
|---|---|
| public final Quaternion rotation the rotation, relative to the parent, not modified by animations | |
| scale | back to summary |
|---|---|
| public final Vector3 scale the scale, relative to the parent, not modified by animations | |
| translation | back to summary |
|---|---|
| public final Vector3 translation the translation, relative to the parent, not modified by animations | |
| Node | back to summary |
|---|---|
| public Node() | |
| addChild | back to summary |
|---|---|
| public <T extends Node> int addChild(final T child) Adds the specified node as the currently last child of this node. If the node is already a child of another node, then it is removed from its current parent.
| |
| addChildren | back to summary |
|---|---|
| public <T extends Node> int addChildren(final Iterable<T> nodes) Adds the specified nodes as the currently last child of this node. If the node is already a child of another node, then it is removed from its current parent.
| |
| attachTo | back to summary |
|---|---|
| public <T extends Node> void attachTo(T parent) Adds this node as child to specified parent Node, synonym for:
| |
| calculateBoneTransforms | back to summary |
|---|---|
| public void calculateBoneTransforms(boolean recursive) | |
| calculateBoundingBox | back to summary |
|---|---|
| public BoundingBox calculateBoundingBox(final BoundingBox out) Calculate the bounding box of this Node. This is a potential slow operation, it is advised to cache the result. | |
| calculateBoundingBox | back to summary |
|---|---|
| public BoundingBox calculateBoundingBox(final BoundingBox out, boolean transform) Calculate the bounding box of this Node. This is a potential slow operation, it is advised to cache the result. | |
| calculateLocalTransform | back to summary |
|---|---|
| public Matrix4 calculateLocalTransform() Calculates the local transform based on the translation, scale and rotation
| |
| calculateTransforms | back to summary |
|---|---|
| public void calculateTransforms(boolean recursive) Calculates the local and world transform of this node and optionally all its children.
| |
| calculateWorldTransform | back to summary |
|---|---|
| public Matrix4 calculateWorldTransform() Calculates the world transform; the product of local transform and the parent's world transform.
| |
| copy | back to summary |
|---|---|
| public Node copy() Creates a nested copy of this Node, any child nodes are copied using this method as well. The | |
| detach | back to summary |
|---|---|
| public void detach() Removes this node from its current parent, if any. Short for: | |
| extendBoundingBox | back to summary |
|---|---|
| public BoundingBox extendBoundingBox(final BoundingBox out) Extends the bounding box with the bounds of this Node. This is a potential slow operation, it is advised to cache the result. | |
| extendBoundingBox | back to summary |
|---|---|
| public BoundingBox extendBoundingBox(final BoundingBox out, boolean transform) Extends the bounding box with the bounds of this Node. This is a potential slow operation, it is advised to cache the result. | |
| getChild | back to summary |
|---|---|
public Node getChild(final int index)
| |
| getChild | back to summary |
|---|---|
public Node getChild(final String id, boolean recursive, boolean ignoreCase)
| |
| getChildCount | back to summary |
|---|---|
public int getChildCount()
| |
| getChildren | back to summary |
|---|---|
| public Iterable | |
| getNode | back to summary |
|---|---|
| public static Node getNode(final Array<Node> nodes, final String id, boolean recursive, boolean ignoreCase) Helper method to recursive fetch a node from an array
| |
| getParent | back to summary |
|---|---|
public Node getParent()
| |
| hasChildren | back to summary |
|---|---|
public boolean hasChildren()
| |
| hasParent | back to summary |
|---|---|
public boolean hasParent()
| |
| insertChild | back to summary |
|---|---|
| public <T extends Node> int insertChild(int index, final T child) Insert the specified node as child of this node at the specified index. If the node is already a child of another node,
then it is removed from its current parent. If the specified index is less than zero or equal or greater than
| |
| insertChildren | back to summary |
|---|---|
| public <T extends Node> int insertChildren(int index, final Iterable<T> nodes) Insert the specified nodes as children of this node at the specified index. If the node is already a child of another node,
then it is removed from its current parent. If the specified index is less than zero or equal or greater than
| |
| removeChild | back to summary |
|---|---|
| public <T extends Node> boolean removeChild(final T child) Removes the specified node as child of this node. On success, the child node will be not attached to any parent node (its
| |
| set | back to summary |
|---|---|
| protected Node set(Node other) Creates a nested copy of this Node, any child nodes are copied using the
| |