public interface SceneNode
A scene node object can represent an entity that belongs to a node hierarchy.
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
Optional<SceneNode> |
getChild(String name) |
Obtains a child node based on the name.
|
List<SceneNode> |
getChildren() |
Obtains the list of child nodes of a node.
|
Entity |
getEntity() |
Obtains the entity reference of a node.
|
String |
getName() |
Obtains the name of a node.
|
Optional<SceneNode> |
getParent() |
Obtains the parent node of a specified node.
|
Vector3 |
getPosition() |
Obtains the position of the transformation component in a node.
|
Quaternion |
getRotation() |
Obtains the rotation part of the transformation component in a node.
|
Vector3 |
getScale() |
Obtains the scaling part of the transformation component in a node.
|
Scene |
getScene() |
Obtains the scene to which a node belongs.
|
boolean |
isAncestorOf(SceneNode node) |
Checks whether a node is the ancestor (parent or grandparent node) of another node.
|
boolean |
isEnabled() |
Obtains the state of a node.
|
boolean |
isExported() |
Obtains whether a node is exported.
|
Optional<SceneNode> |
lookupNodeByComponent(Class<? extends Component> componentType) |
Recursively searches for a node based on the component type.
|
Optional<SceneNode> |
lookupNodeByName(String name) |
Recursively searches for a node based on the name.
|
Optional<SceneNode> |
lookupNodeByPath(String path) |
Searches for a node based on the path name consisting of node names.
|
List<SceneNode> |
lookupNodesByComponent(Class<? extends Component> componentType) |
Recursively searches for multiple nodes in each hierarchy based on the component type.
|
void |
setEnabled(boolean isEnabled) |
Sets whether to enable a node.
|
void |
setExported(boolean isExported) |
Sets whether to export a node.
|
void |
setName(String name) |
Sets the name of a node.
|
void |
setParent(SceneNode parentNode) |
Sets the parent node for a node.
|
void |
setPosition(Vector3 position) |
Sets the position of the transformation component in a node.
|
void |
setRotation(Quaternion rotation) |
Sets the rotation part of the transformation component in a node.
|
void |
setScale(Vector3 scale) |
Sets the scaling part of the transformation component in a node.
|
String getName()
void setName(String name)
name - Indicates the name of the node.NullPointerException - Throws this exception if the name of the node is null.Scene getScene()
Optional<SceneNode> getParent()
void setParent(SceneNode parentNode)
parentNode - Indicates the parent node to set.NullPointerException - Throws this exception if the parameter is null.Vector3 getPosition()
void setPosition(Vector3 position)
position - Indicates the position of the transformation component in the local coordinate system.Quaternion getRotation()
void setRotation(Quaternion rotation)
rotation - Indicates the rotation part of the transformation component in the local coordinate system.Vector3 getScale()
void setScale(Vector3 scale)
scale - Indicates the scaling part of the transformation component in the local coordinate system.void setEnabled(boolean isEnabled)
isEnabled - Indicates whether the node is enabled.boolean isEnabled()
true if the node is enabled; returns false otherwise.void setExported(boolean isExported)
isExported - Indicates whether to export the node.boolean isExported()
true if the node is exported; returns false otherwise.List<SceneNode> getChildren()
boolean isAncestorOf(SceneNode node)
node - Indicates the node to check.true if the checked node is the ancestor of the specified node;
returns false otherwise.Optional<SceneNode> getChild(String name)
name - Indicates the name of the child node to query.Optional<SceneNode> lookupNodeByPath(String path)
path - Indicates the complete path for accessing the node. For example, parentNode/childNode/grandChild.Optional<SceneNode> lookupNodeByName(String name)
name - Indicates the name of the node.Optional<SceneNode> lookupNodeByComponent(Class<? extends Component> componentType)
componentType - Indicates the component type.List<SceneNode> lookupNodesByComponent(Class<? extends Component> componentType)
componentType - Indicates the component type.Entity getEntity()