Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
EngineCore::StaticMeshActor Class Reference

Wrapper for entt component creation which ensures types safety and attaches the correct component with systmes to the entity. More...

#include <StaticMeshActor.h>

Inheritance diagram for EngineCore::StaticMeshActor:
Collaboration diagram for EngineCore::StaticMeshActor:

Public Member Functions

 StaticMeshActor (const std::shared_ptr< EngineCore::SceneNode > &node, Scene *owningScene, Asset::Path meshPath)
Public Member Functions inherited from EngineCore::Actor
 Actor (std::shared_ptr< SceneNode > sceneNode, Scene *owningScene)
 ~Actor ()
virtual void beginPlay ()
 Gets executed when the actor is spawned into the world.
void tick (double deltaTime) override
 Executed every frame.
virtual void endPlay ()
glm::vec3 getActorLocation () const
 Gets the actors location in the world.
glm::vec3 getActorRotation () const
 Gets the actors rotation in the world.
glm::vec3 getActorScale () const
 Scales the actor to world scale.
void setActorLocation (glm::vec3 newLocation)
 Set the new world location for this actor.
void setActorRotation (glm::vec3 newRotation)
 Sets the world rotation.
void rotateActor (glm::vec3 deltaRotation)
 Applies an incremental rotation to the actor using quaternion multiplication. Use this instead of getActorRotation() + setActorRotation() for continuous rotation to avoid euler angle instability/jiggling.
void setActorScale (glm::vec3 newScale)
 sets the world scale for this actor
glm::mat4 getWorldTransform () const
 Gets the model matrix.
MeshComponentregisterMeshComponent (MeshComponent *meshComponent)
void unregisterMeshComponent (MeshComponent *meshComponent)
std::vector< MeshComponent * > getMeshComponents () const
ScenegetOwningScene () const
 Get the pointer to the scene this entity is a part of.
std::shared_ptr< SceneNodegetSceneNode () const
 Getter for the scene graph node for this object.
Public Member Functions inherited from EngineCore::Entity
 Entity ()
virtual ~Entity ()
void enableTick (bool enable)
 Enables or disables ticking for this entity.
void tick (double deltaTime) override
 Executes every frame if tick is enabled.
template<typename T, typename... Args>
T * addComponent (Args &&... args)
 Adds a component to the entity. Checks for uniqueness if the component defines 'static constexpr bool IsUnique = true;'.
template<typename T>
T * getComponent () const
 Returns the first component of type T found.
template<typename T>
std::vector< T * > getComponents () const
 Returns all components of type T.
void removeComponent (LogicComponent *component)
 Removes a specific component instance.
template<typename T>
bool removeFirstComponent ()
 Removes the first component of type T found.
template<typename T>
bool hasComponent () const
 Checks if a component of type T exists.
bool canTick () const
 Tells you if the entity can execute its tick function.
bool canEverTick () const
 Tells if this entity can ever tick.
Public Member Functions inherited from EngineCore::ITickable
virtual ~ITickable ()=default
virtual void preTick ()
 Function which executes immediately before the execution of ITickable::preTick()
virtual void postTick ()
 Function which executes immediately after the execution of ITickable::postTick()

Private Attributes

MeshComponentmeshComponent = nullptr

Additional Inherited Members

Public Attributes inherited from EngineCore::Actor
std::vector< MeshComponent * > meshComponents
Protected Member Functions inherited from EngineCore::Entity
uuids::uuid getUUID () const
 Getter for the UUID of this entity.
std::string getUuidString () const
 Getter for the UUID of this entity as a string.
Protected Attributes inherited from EngineCore::Actor
std::optional< std::shared_ptr< SceneNode > > sceneNode
Protected Attributes inherited from EngineCore::Entity
std::vector< std::shared_ptr< LogicComponent > > components
 List of all logical components.
entt::entity data = entt::null
bool allowTicking = false

Detailed Description

Wrapper for entt component creation which ensures types safety and attaches the correct component with systmes to the entity.

Author
Konstantin Passig
Date
05.12.2025

Definition at line 14 of file StaticMeshActor.h.

Constructor & Destructor Documentation

◆ StaticMeshActor()

EngineCore::StaticMeshActor::StaticMeshActor ( const std::shared_ptr< EngineCore::SceneNode > & node,
Scene * owningScene,
Asset::Path meshPath )
explicit

Definition at line 6 of file StaticMeshActor.cpp.

References EngineCore::Actor::Actor(), EngineCore::Entity::addComponent(), EngineCore::Entity::data, meshComponent, EngineCore::Actor::owningScene, and EngineCore::Actor::Scene.

Here is the call graph for this function:

Member Data Documentation

◆ meshComponent

MeshComponent* EngineCore::StaticMeshActor::meshComponent = nullptr
private

Definition at line 25 of file StaticMeshActor.h.

Referenced by StaticMeshActor().


The documentation for this class was generated from the following files: