RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Node.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2014 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_NODE_H
10 #define RAMSES_NODE_H
11 
15 
16 namespace ramses
17 {
22  class RAMSES_API Node : public SceneObject
23  {
24  public:
30  bool hasChild() const;
31 
37  uint32_t getChildCount() const;
38 
47  Node* getChild(uint32_t index);
49  const Node* getChild(uint32_t index) const;
50 
60 
70 
78 
84  bool hasParent() const;
85 
93  const Node* getParent() const;
94 
104 
112 
123  status_t getModelMatrix(float(&modelMatrix)[16]) const;
124 
135  status_t getInverseModelMatrix(float(&inverseModelMatrix)[16]) const;
136 
154  status_t rotate(float x, float y, float z);
155 
174  status_t setRotation(float x, float y, float z);
175 
194  status_t setRotation(float x, float y, float z, ERotationConvention rotationConvention);
195 
217  status_t getRotation(float& x, float& y, float& z) const;
218 
239  status_t getRotation(float& x, float& y, float& z, ERotationConvention& rotationConvention) const;
240 
250  status_t translate(float x, float y, float z);
251 
261  status_t setTranslation(float x, float y, float z);
262 
272  status_t getTranslation(float& x, float& y, float& z) const;
273 
283  status_t scale(float x, float y, float z);
284 
294  status_t setScaling(float x, float y, float z);
295 
305  status_t getScaling(float& x, float& y, float& z) const;
306 
320 
329 
333  class NodeImpl& impl;
334 
335  protected:
339  friend class SceneImpl;
340 
346  explicit Node(NodeImpl& pimpl);
347 
351  virtual ~Node();
352  };
353 }
354 
355 #endif
#define RAMSES_API
Definition: APIExport.h:35
The Node is the base class of all nodes and provides scene graph functionality which propagates to it...
Definition: Node.h:23
status_t setScaling(float x, float y, float z)
Sets the absolute scale in all three dimensions.
status_t setRotation(float x, float y, float z, ERotationConvention rotationConvention)
Sets the absolute rotation in all three directions for right-handed rotation using the chosen Euler a...
EVisibilityMode getVisibility() const
Gets the visibility property of the Node. This is just the visibility state of this node object,...
status_t setParent(Node &node)
Sets parent Node for this node.
status_t getRotation(float &x, float &y, float &z, ERotationConvention &rotationConvention) const
Retrieves the absolute rotation for right-handed rotation in all three directions and the used Euler ...
status_t getTranslation(float &x, float &y, float &z) const
Retrieves the current absolute translation.
const Node * getChild(uint32_t index) const
Gets child node at provided index.
Node * getParent()
Gets parent Node of this Node.
Node(NodeImpl &pimpl)
Constructor for Node.
status_t addChild(Node &node)
Adds child Node to this node.
const Node * getParent() const
Gets parent Node of this Node.
status_t removeParent()
Removes the parent Node from this Node.
Node * getChild(uint32_t index)
Gets child node at provided index.
status_t setTranslation(float x, float y, float z)
Sets the absolute translation the absolute values.
status_t getRotation(float &x, float &y, float &z) const
Retrieves the absolute rotation for left-handed rotation using Euler ZYX rotation convention.
status_t removeAllChildren()
Removes all child Nodes from this node.
status_t rotate(float x, float y, float z)
Rotates in all three directions with the given values without affecting the currently set rotation co...
class NodeImpl & impl
Definition: Node.h:333
status_t setVisibility(EVisibilityMode mode)
Sets the visibility of the Node. Visibility of a node determines if a renderable is rendered or not a...
status_t removeChild(Node &node)
Removes a child Node from this node.
bool hasParent() const
Returns if Node has a parent Node.
status_t setRotation(float x, float y, float z)
Sets the absolute rotation in all three directions for left-handed rotation using Euler ZYX rotation ...
virtual ~Node()
Destructor of the Node.
uint32_t getChildCount() const
Gets the number of child Nodes of this node.
status_t scale(float x, float y, float z)
Scales in all three directions with the given values.
bool hasChild() const
Returns if node has at least one child Node.
status_t getModelMatrix(float(&modelMatrix)[16]) const
Gets model (world in scene space) matrix computed from the scene graph. Performance note: this call w...
status_t translate(float x, float y, float z)
Translates in all three directions with the given values.
status_t getScaling(float &x, float &y, float &z) const
Retrieves the current absolute scale in all three dimensions.
status_t getInverseModelMatrix(float(&inverseModelMatrix)[16]) const
Gets inverse model (world in scene space) matrix computed from the scene graph. Performance note: thi...
The SceneObject is a base class for all client API objects owned by a Scene.
Definition: SceneObject.h:20
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
EVisibilityMode
Definition: EVisibilityMode.h:21
ERotationConvention
Definition: ERotationConvention.h:23
uint32_t status_t
Status is a handle to the result of an API call.
Definition: RamsesFrameworkTypes.h:26