Represents a node in a scene graph.
More...
Represents a node in a scene graph.
The graph can be used whenever transformations of entities are needed.
See NodeManager::createOrRetrieve() or Node::create() for instantiation.
◆ ~Node()
virtual nkGraphics::Node::~Node |
( |
| ) |
|
|
virtual |
◆ setPositionRelative()
virtual void nkGraphics::Node::setPositionRelative |
( |
const nkMaths::Vector & |
value | ) |
|
|
virtual |
Sets the position of the node, relative to its parent.
- Parameters
-
value | The position to set. |
Reimplemented in nkGraphics::Camera.
◆ setPositionAbsolute()
virtual void nkGraphics::Node::setPositionAbsolute |
( |
const nkMaths::Vector & |
value | ) |
|
|
virtual |
Sets the position of the node, absolute in the world.
- Parameters
-
value | The position to use. |
Reimplemented in nkGraphics::Camera.
◆ translateRelative()
virtual void nkGraphics::Node::translateRelative |
( |
const nkMaths::Vector & |
value | ) |
|
|
virtual |
Translates the node, relative to its parent.
- Parameters
-
Reimplemented in nkGraphics::Camera.
◆ translateAbsolute()
virtual void nkGraphics::Node::translateAbsolute |
( |
const nkMaths::Vector & |
value | ) |
|
|
virtual |
◆ getPositionRelative()
- Returns
- The position of the node, relative to its parent.
◆ getPositionAbsolute()
- Returns
- The position of the node, absolute in the world.
◆ setOrientationRelative()
Sets the orientation of a node, relative to its parent.
- Parameters
-
value | The orientation to set. |
Reimplemented in nkGraphics::Camera.
◆ setOrientationAbsolute()
Sets the orientation of a node, absolute in the world.
- Parameters
-
value | The orientation to set. |
Reimplemented in nkGraphics::Camera.
◆ rotateRelative()
◆ rotateAbsolute()
◆ getOrientationRelative()
- Returns
- The orientation of the node, relative to its parent.
◆ getOrientationAbsolute()
- Returns
- The orientation of the node, absolute in the world.
◆ setScaleRelative()
virtual void nkGraphics::Node::setScaleRelative |
( |
const nkMaths::Vector & |
value | ) |
|
|
virtual |
Sets the scale of the node, relative to its parent.
- Parameters
-
Reimplemented in nkGraphics::Camera.
◆ setScaleAbsolute()
virtual void nkGraphics::Node::setScaleAbsolute |
( |
const nkMaths::Vector & |
value | ) |
|
|
virtual |
Sets the scale of the node, absolute in the world.
- Parameters
-
Reimplemented in nkGraphics::Camera.
◆ applyScale()
◆ getScaleRelative()
- Returns
- The scale of the node, relative to its parent.
◆ getScaleAbsolute()
- Returns
- The scale of the node, absolute in the world.
◆ setRelativeTransform()
void nkGraphics::Node::setRelativeTransform |
( |
const nkMaths::Matrix & |
value | ) |
|
Sets the transformation of the node, relative to its parent.
- Parameters
-
value | The transformation to set. |
◆ setAbsoluteTransform()
void nkGraphics::Node::setAbsoluteTransform |
( |
const nkMaths::Matrix & |
value | ) |
|
Sets the absolute transformation of the node. This will set the relative transformation so that it fits the absolute transformation required.
- Parameters
-
value | The transformation to set. |
◆ getRelativeTransform()
- Returns
- The full transformation of the node, relative to its parent.
◆ getAbsoluteTransform()
- Returns
- The full transformation of the node, absolute.
◆ updateTransformations()
void nkGraphics::Node::updateTransformations |
( |
| ) |
|
Updates the transformation of a node. Used internally.
◆ dispatchDirtyTransform()
void nkGraphics::Node::dispatchDirtyTransform |
( |
| ) |
|
Dispatches a dirty transform flag to the children. Used internally.
◆ getAbsoluteUp()
- Returns
- The up vector, absolute in the world.
◆ getAbsoluteFront()
- Returns
- The front vector, absolute in the world.
◆ getAbsoluteRight()
- Returns
- The right vector, absolute in the world.
◆ setParentNode()
void nkGraphics::Node::setParentNode |
( |
Node * |
parent | ) |
|
Sets the parent node for a given node. A child node will inherit all of its parent tree's transformations before applying its own.
- Parameters
-
parent | The parent node to set. Can be set to nullptr to detach the node from any parent tree. |
◆ getParentNode()
Node* nkGraphics::Node::getParentNode |
( |
| ) |
const |
◆ getChildNode()
Node* nkGraphics::Node::getChildNode |
( |
unsigned int |
index | ) |
const |
- Parameters
-
index | The index of the child to retrieve. |
- Returns
- The child node if available, nullptr else.
◆ getNumChildNode()
unsigned int nkGraphics::Node::getNumChildNode |
( |
| ) |
const |
- Returns
- The number of children nodes.
◆ setName()
Sets the name under which the node should be identified.
- Parameters
-
◆ getName()
- Returns
- The name of the node.
◆ getHidden()
bool nkGraphics::Node::getHidden |
( |
| ) |
const |
- Returns
- Whether the node is hidden from project exporting (true) or not (false).
◆ setHidden()
void nkGraphics::Node::setHidden |
( |
bool |
value | ) |
|
Sets whether the node should not export itself during a project (resource set) export. This can be used to hide programmatically generated resources from duplicating in the export.
- Parameters
-
value | Whether the node should be hidden (true) or not (false). |
◆ addEntityToTrack()
void nkGraphics::Node::addEntityToTrack |
( |
Entity * |
entity | ) |
|
Tracks entity for changes. Used internally, in theory external code should not used it. Rather, see Entity::setParentNode().
◆ stopEntityTracking()
void nkGraphics::Node::stopEntityTracking |
( |
Entity * |
entity | ) |
|
Stops tracking an entity for its changes. Used internally, in theory external code should not used it. Rather, see Entity::setParentNode().
◆ getTrackedEntityCount()
unsigned int nkGraphics::Node::getTrackedEntityCount |
( |
| ) |
const |
- Returns
- The number of entities currently tracked by the node.
◆ getTrackedEntity()
Entity* nkGraphics::Node::getTrackedEntity |
( |
unsigned int |
index | ) |
const |
- Parameters
-
index | The index of the tracked entity to retrieve. |
- Returns
- Requested entity if available, nullptr else.
◆ registerListener()
Register a listener.
- Parameters
-
listener | The listener to register. |
◆ unregisterListener()
Unregister a listener.
- Parameters
-
listener | The listener to unregister. |
◆ exportClassToTree()
virtual void nkGraphics::Node::exportClassToTree |
( |
nkExport::Node * |
rootNode | ) |
|
|
overridevirtual |
Exports an item into a tree describing its structure and its data.
- Parameters
-
rootNode | The node into which the object has to write its related information. |
Implements nkExport::Exportable.
Reimplemented in nkGraphics::Camera.
◆ importClassFromTree()
virtual void nkGraphics::Node::importClassFromTree |
( |
nkExport::Node * |
rootNode | ) |
|
|
overridevirtual |
Imports information from a tree which is supposed to describe its structure and data.
- Parameters
-
rootNode | The root node of the tree holding the information. |
Implements nkExport::Exportable.
Reimplemented in nkGraphics::Camera.
◆ create()
Creates a standalone resource, linking it to a system, but no manager. This method can be used to allocate a resource and manually manage its lifetime.
- Parameters
-
system | The system to create the resource into. If left to nullptr, then the Singleton instance will be used. |
- Returns
- The created resource instance.
The documentation for this class was generated from the following file:
- Documentation/Headers/NilkinsGraphics/Graph/Node.h