public class Node extends A3DObject
Constructor and Description |
---|
Node()
Initializes a new instance of the
Node class. |
Node(String name)
Initializes a new instance of the
Node class. |
Node(String name,
Entity entity)
Initializes a new instance of the
Node class. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(NodeVisitor visitor)
Walks through all descendant nodes(including the current node) and call the visitor with the node.
|
void |
addChildNode(Node node)
Add a child node to this node
|
void |
addEntity(Entity entity)
Add an entity to the node.
|
Node |
createChildNode()
Creates a child node
|
Node |
createChildNode(Entity entity)
Create a new child node with given entity attached
|
Node |
createChildNode(String nodeName)
Create a new child node with given node name
|
Node |
createChildNode(String nodeName,
Entity entity)
Create a new child node with given node name
|
Node |
findNode(String name)
Find child node by its name or return null if no matched node found
|
BoundingBox |
getBoundingBox()
Calculate the bounding box of the node
|
Node |
getChild(int index)
Gets the child node at specified index.
|
Node |
getChild(String nodeName)
Gets the child node with the specified name
|
List<Node> |
getChildNodes()
Gets the children nodes.
|
List<Entity> |
getEntities()
Gets all node entities.
|
Entity |
getEntity()
Gets the first entity attached to this node, if sets, will clear other entities.
|
boolean |
getExcluded()
Gets wheather to exclude this node and all child nodes/entities during exporting.
|
GlobalTransform |
getGlobalTransform()
Gets the global transform.
|
Material |
getMaterial()
Gets the first material associated with this node, if sets, will clear other materials
|
List<Material> |
getMaterials()
Gets the materials associated with this node.
|
List<CustomObject> |
getMetaDatas()
Gets the meta data defined in this node.
|
Node |
getParentNode()
Gets the parent node.
|
Transform |
getTransform()
Gets the local transform.
|
boolean |
getVisible()
Gets to show the node
|
void |
setEntity(Entity value)
Sets the first entity attached to this node, if sets, will clear other entities.
|
void |
setExcluded(boolean value)
Sets wheather to exclude this node and all child nodes/entities during exporting.
|
void |
setMaterial(Material value)
Sets the first material associated with this node, if sets, will clear other materials
|
void |
setParentNode(Node value)
Sets the parent node.
|
void |
setVisible(boolean value)
Sets to show the node
|
String |
toString()
Gets the string reprensentation of this node.
|
findProperty, getName, getProperty, removeProperty, removeProperty, setName, setProperty
public Node()
Node
class.public Node(String name, Entity entity)
Node
class.name
- Name.entity
- Default entity.public boolean getVisible()
public void setVisible(boolean value)
value
- New valuepublic Node createChildNode()
public Node createChildNode(String nodeName)
nodeName
- The new child node's namepublic Node createChildNode(Entity entity)
entity
- Default entity attached to the nodepublic Node createChildNode(String nodeName, Entity entity)
nodeName
- The new child node's nameentity
- Default entity attached to the nodepublic Entity getEntity()
public void setEntity(Entity value)
value
- New valuepublic boolean getExcluded()
public void setExcluded(boolean value)
value
- New valuepublic List<CustomObject> getMetaDatas()
public Material getMaterial()
public void setMaterial(Material value)
value
- New valuepublic Node getParentNode()
public void setParentNode(Node value)
value
- New valuepublic Transform getTransform()
public GlobalTransform getGlobalTransform()
public Node getChild(int index)
index
- Index.public Node getChild(String nodeName)
nodeName
- The child name to find.public boolean accept(NodeVisitor visitor)
visitor
- Visitor callback to visit the nodepublic String toString()
public BoundingBox getBoundingBox()
public void addEntity(Entity entity)
entity
- The entity to be attached to the nodepublic void addChildNode(Node node)
node
- The child node to be attachedCopyright © 2018. All rights reserved.