Represents a node in a scene graph for 3D rendering.
More...
#include <Node.hpp>
|
| Node ()=default |
| Default constructor for Node. Initializes an empty node with no parent and no children.
|
|
virtual | ~Node ()=default |
| Default destructor for Node. Cleans up the node and its children.
|
|
| Node (const Node &)=delete |
| Deleted copy constructor for Node. Prevents copying of Node instances.
|
|
| Node (const Node &&)=delete |
| Deleted move constructor for Node. Prevents moving of Node instances.
|
|
Node & | operator= (const Node &)=delete |
| Deleted assignment operator for Node. Prevents assignment of Node instances.
|
|
Node & | operator= (const Node &&)=delete |
| Deleted move assignment operator for Node. Prevents moving of Node instances.
|
|
void | add_child (std::shared_ptr< Node > child) |
| Get the parent node.
|
|
void | remove_child (std::shared_ptr< Node > child) |
| Remove a child node.
|
|
const std::vector< std::shared_ptr< Node > > & | get_children () const |
| Get the parent node.
|
|
mat4 | get_transform_matrix () override |
| Get the transform matrix object.
|
|
| Transform () |
| Default constructor for the Transform class.
|
|
virtual | ~Transform ()=default |
| Virtual destructor for the Transform class.
|
|
void | set_position (const vec3 &pos) |
| Sets the position of the object.
|
|
vec3 | get_position () const |
| Gets the current position of the object.
|
|
void | set_rotation (const vec3 &rot) |
| Moves the object by a specified vector.
|
|
vec3 | get_rotation () const |
| Gets the current rotation of the object.
|
|
void | rotate (const float angle, const vec3 &axis) |
| Rotates the object by a specified angle around a given axis.
|
|
void | set_scale (const vec3 &scale) |
| Sets the scale of the object.
|
|
vec3 | get_scale () const |
| Sets the scale of the object uniformly.
|
|
bool | is_dirty () const |
| Checks if the transformation matrix is dirty (needs recalculation).
|
|
|
std::vector< std::shared_ptr< Node > > | children |
| List of child nodes.
|
|
Node * | parent = nullptr |
| Pointer to the parent node.
|
|
vec3 | position |
| The position of the object in 3D space.
|
|
vec3 | rotation |
| The rotation of the object in degrees around each axis (x, y, z).
|
|
vec3 | scale |
| The scale of the object in 3D space, default is (1, 1, 1).
|
|
bool | dirty = true |
| Flag indicating whether the transformation matrix needs to be recalculated.
|
|
Represents a node in a scene graph for 3D rendering.
The Node class extends the Transform class to include child nodes, allowing for hierarchical transformations and management of child nodes.
◆ Node() [1/3]
Default constructor for Node. Initializes an empty node with no parent and no children.
◆ ~Node()
virtual Ragot::Node::~Node |
( |
| ) |
|
|
virtualdefault |
Default destructor for Node. Cleans up the node and its children.
◆ Node() [2/3]
Ragot::Node::Node |
( |
const Node & | | ) |
|
|
delete |
Deleted copy constructor for Node. Prevents copying of Node instances.
◆ Node() [3/3]
Ragot::Node::Node |
( |
const Node && | | ) |
|
|
delete |
Deleted move constructor for Node. Prevents moving of Node instances.
◆ add_child()
void Ragot::Node::add_child |
( |
std::shared_ptr< Node > | child | ) |
|
|
inline |
Get the parent node.
- Returns
- Node* Pointer to the parent node, or nullptr if no parent exists.
◆ get_children()
const std::vector< std::shared_ptr< Node > > & Ragot::Node::get_children |
( |
| ) |
const |
|
inline |
Get the parent node.
- Returns
- Node* Pointer to the parent node, or nullptr if no parent exists.
◆ get_transform_matrix()
mat4 Ragot::Node::get_transform_matrix |
( |
| ) |
|
|
inlineoverridevirtual |
Get the transform matrix object.
- Returns
- mat4 The transformation matrix of the node, including its parent's transformation.
Reimplemented from Ragot::Transform.
◆ operator=() [1/2]
Node & Ragot::Node::operator= |
( |
const Node && | | ) |
|
|
delete |
Deleted move assignment operator for Node. Prevents moving of Node instances.
- Returns
- Node& Reference to the current object.
◆ operator=() [2/2]
Node & Ragot::Node::operator= |
( |
const Node & | | ) |
|
|
delete |
Deleted assignment operator for Node. Prevents assignment of Node instances.
◆ remove_child()
void Ragot::Node::remove_child |
( |
std::shared_ptr< Node > | child | ) |
|
|
inline |
Remove a child node.
This method removes the specified child node from the list of children. If the child exists, it is removed and its parent pointer is set to nullptr.
- Parameters
-
child | The child node to remove. |
◆ children
std::vector< std::shared_ptr < Node > > Ragot::Node::children |
|
protected |
◆ parent
Node* Ragot::Node::parent = nullptr |
|
protected |
Pointer to the parent node.
The documentation for this class was generated from the following file: