Modifier and Type | Field and Description |
---|---|
Matrix4 |
globalTransform
the global transform, product of local transform and transform of the parent node, calculated via
calculateWorldTransform() |
String |
id
the id, may be null, FIXME is this unique?
|
boolean |
inheritTransform
Whether this node should inherit the transformation of its parent node, defaults to true.
|
boolean |
isAnimated
Whether this node is currently being animated, if so the translation, rotation and scale values are not used.
|
Matrix4 |
localTransform
the local transform, based on translation/rotation/scale (
calculateLocalTransform() ) or any applied animation |
Array<NodePart> |
parts |
Quaternion |
rotation
the rotation, relative to the parent, not modified by animations
|
Vector3 |
scale
the scale, relative to the parent, not modified by animations
|
Vector3 |
translation
the translation, relative to the parent, not modified by animations
|
Constructor and Description |
---|
Node() |
Modifier and Type | Method and Description |
---|---|
<T extends Node> |
addChild(T child)
Adds the specified node as the currently last child of this node.
|
<T extends Node> |
addChildren(Iterable<T> nodes)
Adds the specified nodes as the currently last child of this node.
|
<T extends Node> |
attachTo(T parent)
Adds this node as child to specified parent Node, synonym for:
parent.addChild(this) |
void |
calculateBoneTransforms(boolean recursive) |
BoundingBox |
calculateBoundingBox(BoundingBox out)
Calculate the bounding box of this Node.
|
BoundingBox |
calculateBoundingBox(BoundingBox out,
boolean transform)
Calculate the bounding box of this Node.
|
Matrix4 |
calculateLocalTransform()
Calculates the local transform based on the translation, scale and rotation
|
void |
calculateTransforms(boolean recursive)
Calculates the local and world transform of this node and optionally all its children.
|
Matrix4 |
calculateWorldTransform()
Calculates the world transform; the product of local transform and the parent's world transform.
|
void |
detach()
Removes this node from its current parent, if any.
|
BoundingBox |
extendBoundingBox(BoundingBox out)
Extends the bounding box with the bounds of this Node.
|
BoundingBox |
extendBoundingBox(BoundingBox out,
boolean transform)
Extends the bounding box with the bounds of this Node.
|
Node |
getChild(int index) |
Node |
getChild(String id,
boolean recursive,
boolean ignoreCase) |
int |
getChildCount() |
Iterable<Node> |
getChildren() |
static Node |
getNode(Array<Node> nodes,
String id,
boolean recursive,
boolean ignoreCase)
Helper method to recursive fetch a node from an array
|
Node |
getParent() |
boolean |
hasChildren() |
boolean |
hasParent() |
<T extends Node> |
insertChild(int index,
T child)
Insert the specified node as child of this node at the specified index.
|
<T extends Node> |
insertChildren(int index,
Iterable<T> nodes)
Insert the specified nodes as children of this node at the specified index.
|
<T extends Node> |
removeChild(T child)
Removes the specified node as child of this node.
|
public String id
public boolean inheritTransform
globalTransform
will be the same as the value of localTransform
causing the transform to be independent
of its parent transform.public boolean isAnimated
public final Vector3 translation
public final Quaternion rotation
public final Vector3 scale
public final Matrix4 localTransform
calculateLocalTransform()
) or any applied animationpublic final Matrix4 globalTransform
calculateWorldTransform()
public Matrix4 calculateLocalTransform()
public Matrix4 calculateWorldTransform()
public void calculateTransforms(boolean recursive)
recursive
- whether to calculate the local/world transforms for children.public void calculateBoneTransforms(boolean recursive)
public BoundingBox calculateBoundingBox(BoundingBox out)
public BoundingBox calculateBoundingBox(BoundingBox out, boolean transform)
public BoundingBox extendBoundingBox(BoundingBox out)
public BoundingBox extendBoundingBox(BoundingBox out, boolean transform)
public <T extends Node> void attachTo(T parent)
parent.addChild(this)
parent
- The Node to attach this Node to.public void detach()
this.getParent().removeChild(this)
public boolean hasChildren()
public int getChildCount()
getChild(int)
public Node getChild(int index)
index
- The zero-based index of the child node to get, must be: 0 <= index < getChildCount()
.public Node getChild(String id, boolean recursive, boolean ignoreCase)
recursive
- false to fetch a root child only, true to search the entire node tree for the specified node.public <T extends Node> int addChild(T child)
child
- The Node to add as child of this Nodepublic <T extends Node> int addChildren(Iterable<T> nodes)
nodes
- The Node to add as child of this Nodepublic <T extends Node> int insertChild(int index, T child)
getChildCount()
then the Node is added as the currently last child.index
- The zero-based index at which to add the childchild
- The Node to add as child of this Nodepublic <T extends Node> int insertChildren(int index, Iterable<T> nodes)
getChildCount()
then the Node is added as the currently last child.index
- The zero-based index at which to add the childnodes
- The nodes to add as child of this Nodepublic <T extends Node> boolean removeChild(T child)
getParent()
method will return null). If the specified node currently isn't a child of this node then the removal
is considered to be unsuccessful and the method will return false.child
- The child node to remove.public Iterable<Node> getChildren()
Iterable
to all child nodes that this node contains.public Node getParent()
public boolean hasParent()
public static Node getNode(Array<Node> nodes, String id, boolean recursive, boolean ignoreCase)
recursive
- false to fetch a root node only, true to search the entire node tree for the specified node.Copyright © 2015. All rights reserved.