Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Entities::RootNode Class Reference

A subclass of EngineCore::SceneNode which is the root node of a scene graph. More...

#include <SceneGraph.h>

Inheritance diagram for Engine::Entities::RootNode:
Collaboration diagram for Engine::Entities::RootNode:

Public Member Functions

 RootNode (entt::registry &registry)
 Creates the root node in the given ECS registry. The root never moves, so its world matrix is always cached.
Public Member Functions inherited from Engine::Entities::SceneNode
 ~SceneNode ()
 Destroys this scene node and releases its ECS registration state.
Ecs::Transform & getLocalTransform ()
 Gets the local transform of the scene node. The local transform is relative to the parent node.
const Ecs::Transform & getLocalTransform () const
 Gets the local transform of the scene node. The local transform is relative to the parent node.
void registerWithEcs ()
 Registers this scene node and its transform data in the ECS registry.
entt::entity getEntity () const
 Gets the entity associated with this scene node.
void setWorldPosition (const glm::vec3 &newLocation)
 Sets the world position of the scene node. This will calculate the corresponding local position based on the parent's world transform.
void setWorldRotation (const glm::vec3 &newRotation)
 Sets the world rotation of this node with euler angles.
void setWorldRotation (const glm::quat &newRotation)
 Sets a new world rotation with a quaternion on this node.
void rotateWorld (const glm::vec3 &deltaRotation)
 Applies an incremental rotation to the current world rotation using quaternion multiplication. This avoids euler angle instability that occurs with get/set rotation round-trips.
void rotateWorld (const glm::quat &deltaRotation)
 Applies an incremental rotation to the current world rotation using quaternion multiplication.
void setWorldScale (const glm::vec3 &newScale)
 sets the scale for this node
void setLocalModelMatrix (const glm::mat4 &newModelMatrix)
 Overwrites all components of the transform.
void setWorldModelMatrix (const glm::mat4 &newModelMatrix)
 Overwrites all components of this transform.
void addChild (const std::shared_ptr< SceneNode > &newChild)
 Adds a child node to this node.
void addChildren (std::vector< std::shared_ptr< SceneNode > > newChildren)
 adds new children to this node
void clearChildren ()
 Removes all children from this node.
void removeChild (const std::shared_ptr< SceneNode > &child)
 Removes a single child from this node.
void reparentTo (const std::shared_ptr< SceneNode > &newParent, AttachmentTransformRule rule=AttachmentTransformRule::KeepWorld)
 Safely reparents this node while preserving either world or local transform.
void detachFromParent ()
 Detaches this node from its parent, transferring ownership away from the scene graph.
const glm::mat4 & getWorldMatrix () const
 get the world matrix as a raw glm matrix
bool isWorldMatrixDirty () const
 Checks if the world matrix has to be recalculated.
bool isRoot () const
 Checks if this node is the root node.
bool isDirectChildOf (const std::shared_ptr< SceneNode > &potentialParent) const
 Checks whether this node is directly attached to the given parent.
std::vector< std::weak_ptr< SceneNode > > getChildren () const
 Get a list of all children of this node.
void markDirtyRecursive () const
 Marks this node and its children as dirty.

Additional Inherited Members

Protected Member Functions inherited from Engine::Entities::SceneNode
 SceneNode (entt::registry &registry, bool disableCaching=false)
 Constructs a new Scene Node object.

Detailed Description

A subclass of EngineCore::SceneNode which is the root node of a scene graph.

Definition at line 223 of file SceneGraph.h.

Constructor & Destructor Documentation

◆ RootNode()

Engine::Entities::RootNode::RootNode ( entt::registry & registry)
explicit

Creates the root node in the given ECS registry. The root never moves, so its world matrix is always cached.

References Engine::Entities::SceneNode::registry.


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/World/SceneGraph.h