API Documentation
Node.h
1 // Node.h
3 //
5 
6 namespace nkGraphics
7 {
15  class Node : public nkExport::Exportable
16  {
17  public :
18 
19  // Destructor
23  virtual ~Node () ;
24 
25  // Position
31  virtual void setPositionRelative (const nkMaths::Vector& value) ;
37  virtual void setPositionAbsolute (const nkMaths::Vector& value) ;
43  virtual void translateRelative (const nkMaths::Vector& value) ;
49  virtual void translateAbsolute (const nkMaths::Vector& value) ;
58 
59  // Orientation
65  virtual void setOrientationRelative (const nkMaths::Quaternion& value) ;
71  virtual void setOrientationAbsolute (const nkMaths::Quaternion& value) ;
77  virtual void rotateRelative (const nkMaths::Quaternion& value) ;
83  virtual void rotateAbsolute (const nkMaths::Quaternion& value) ;
92 
93  // Scale
99  virtual void setScaleRelative (const nkMaths::Vector& value) ;
105  virtual void setScaleAbsolute (const nkMaths::Vector& value) ;
111  virtual void applyScale (const nkMaths::Vector& value) ;
120 
121  // Transformation
127  void setRelativeTransform (const nkMaths::Matrix& value) ;
134  void setAbsoluteTransform (const nkMaths::Matrix& value) ;
153 
154  // Axis
167 
168  // Hierarchy
175  void setParentNode (Node* parent) ;
179  Node* getParentNode () const ;
184  Node* getChildNode (unsigned int index) const ;
188  unsigned int getNumChildNode () const ;
189 
190  // Naming
201 
202  // Resources
206  bool getHidden () const ;
213  void setHidden (bool value) ;
214 
215  // Entity tracking
221  void addEntityToTrack (Entity* entity) ;
227  void stopEntityTracking (Entity* entity) ;
231  unsigned int getTrackedEntityCount () const ;
236  Entity* getTrackedEntity (unsigned int index) const ;
237 
238  // Listeners
251 
252  // Import / Export
253  virtual void exportClassToTree (nkExport::Node* rootNode) override ;
254  virtual void importClassFromTree (nkExport::Node* rootNode) override ;
255 
256  public :
257 
258  // Statics
266  static nkMemory::UniquePtr<Node> create (System* system = nullptr) ;
267  } ;
268 }
nkGraphics::Node::unregisterListener
void unregisterListener(NodeChangeListener *listener)
nkGraphics::Node::~Node
virtual ~Node()
nkGraphics::Node::setScaleAbsolute
virtual void setScaleAbsolute(const nkMaths::Vector &value)
nkGraphics::Node::setHidden
void setHidden(bool value)
nkGraphics::Node::getParentNode
Node * getParentNode() const
nkGraphics::System
Main interface with the component system.
Definition: System.h:14
nkGraphics::Node::getOrientationAbsolute
nkMaths::Quaternion getOrientationAbsolute()
nkExport::Exportable
An interface to define objects that can be exported using this component.
Definition: Exportable.h:15
nkGraphics::Node::getAbsoluteUp
nkMaths::Vector getAbsoluteUp()
nkMaths::Quaternion
A quaternion, symbolizing rotations as a 4D vector.
Definition: Quaternion.h:14
nkGraphics::Node::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkGraphics::Node::stopEntityTracking
void stopEntityTracking(Entity *entity)
nkGraphics::Node::getScaleAbsolute
nkMaths::Vector getScaleAbsolute()
nkGraphics::Node::setRelativeTransform
void setRelativeTransform(const nkMaths::Matrix &value)
nkGraphics::Node::getName
nkMemory::StringView getName() const
nkMaths::Matrix
Represents a 4x4 float matrix.
Definition: Matrix.h:14
nkGraphics::Node::setName
void setName(nkMemory::StringView value)
nkGraphics::Node::translateRelative
virtual void translateRelative(const nkMaths::Vector &value)
nkGraphics::Node::setParentNode
void setParentNode(Node *parent)
nkGraphics::Node::setOrientationAbsolute
virtual void setOrientationAbsolute(const nkMaths::Quaternion &value)
nkGraphics::Node::getTrackedEntity
Entity * getTrackedEntity(unsigned int index) const
nkGraphics::Node::setOrientationRelative
virtual void setOrientationRelative(const nkMaths::Quaternion &value)
nkGraphics::Node::getOrientationRelative
nkMaths::Quaternion getOrientationRelative() const
nkGraphics::Node::translateAbsolute
virtual void translateAbsolute(const nkMaths::Vector &value)
nkGraphics::Entity
An entity in a render queue. It drives the shader and possible graph position for a set of renderable...
Definition: Entity.h:15
nkGraphics::Node::getPositionAbsolute
nkMaths::Vector getPositionAbsolute()
nkGraphics::Node::getAbsoluteRight
nkMaths::Vector getAbsoluteRight()
nkGraphics::Node::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkGraphics::Node::addEntityToTrack
void addEntityToTrack(Entity *entity)
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkGraphics::Node::getTrackedEntityCount
unsigned int getTrackedEntityCount() const
nkGraphics::Node::getRelativeTransform
nkMaths::Matrix getRelativeTransform()
nkGraphics::Node::applyScale
virtual void applyScale(const nkMaths::Vector &value)
nkGraphics::Node::getPositionRelative
nkMaths::Vector getPositionRelative() const
nkGraphics::Node::create
static nkMemory::UniquePtr< Node > create(System *system=nullptr)
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkGraphics::Node::dispatchDirtyTransform
void dispatchDirtyTransform()
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkGraphics::Node::getAbsoluteFront
nkMaths::Vector getAbsoluteFront()
nkGraphics::Node::getHidden
bool getHidden() const
nkGraphics::Node::rotateAbsolute
virtual void rotateAbsolute(const nkMaths::Quaternion &value)
nkGraphics::Node::setPositionAbsolute
virtual void setPositionAbsolute(const nkMaths::Vector &value)
nkGraphics::Node::setAbsoluteTransform
void setAbsoluteTransform(const nkMaths::Matrix &value)
nkGraphics::Node::registerListener
void registerListener(NodeChangeListener *listener)
nkGraphics::Node::updateTransformations
void updateTransformations()
nkGraphics::Node
Represents a node in a scene graph.
Definition: Node.h:16
nkGraphics
Encompasses all API of component NilkinsGraphics.
Definition: BoundingBox.h:7
nkGraphics::Node::setScaleRelative
virtual void setScaleRelative(const nkMaths::Vector &value)
nkGraphics::Node::getChildNode
Node * getChildNode(unsigned int index) const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkGraphics::Node::setPositionRelative
virtual void setPositionRelative(const nkMaths::Vector &value)
nkGraphics::Node::rotateRelative
virtual void rotateRelative(const nkMaths::Quaternion &value)
nkGraphics::NodeChangeListener
A base class for a listener for node changes.
Definition: NodeChangeListener.h:12
nkGraphics::Node::getNumChildNode
unsigned int getNumChildNode() const
nkGraphics::Node::getAbsoluteTransform
nkMaths::Matrix getAbsoluteTransform()
nkGraphics::Node::getScaleRelative
nkMaths::Vector getScaleRelative() const