21 PLOGI <<
"Begin play";
24 component->beginPlay();
33 if (component->canTick()) {
34 component->tick(deltaTime);
55 return glm::vec3(0.0f);
62 return glm::vec3(0.0f);
69 return glm::vec3(0.0f);
74 sceneNode.value()->setWorldPosition(newLocation);
80 sceneNode.value()->setWorldRotation(newRotation);
86 sceneNode.value()->rotateWorld(deltaRotation);
92 sceneNode.value()->setWorldScale(newScale);
98 return sceneNode.value()->getWorldMatrix();
100 return glm::mat4(1.0f);
104 const auto managedMeshComponent =
owningScene->getSceneManager()->registerGameObject(meshComponent);
106 return managedMeshComponent;
111 delete meshComponent;
112 meshComponent =
nullptr;
126 component->endPlay();
#define FUNCTION_NOT_IMPLEMENTED_F
#define TRACY_ZONE_SCOPED_FUNCTION
#define TRACY_ZONE_SCOPED_NAMED(name)
static entt::registry & get()
Gets the registry for all components.
std::vector< MeshComponent * > meshComponents
std::vector< MeshComponent * > getMeshComponents() const
Actor(std::shared_ptr< SceneNode > sceneNode, Scene *owningScene)
void setActorLocation(glm::vec3 newLocation)
Set the new world location for this actor.
Scene * getOwningScene() const
Get the pointer to the scene this entity is a part of.
virtual void beginPlay()
Gets executed when the actor is spawned into the world.
MeshComponent * registerMeshComponent(MeshComponent *meshComponent)
void tick(double deltaTime) override
Executed every frame.
void setActorScale(glm::vec3 newScale)
sets the world scale for this actor
void setActorRotation(glm::vec3 newRotation)
Sets the world rotation.
glm::vec3 getActorScale() const
Scales the actor to world scale.
glm::mat4 getWorldTransform() const
Gets the model matrix.
glm::vec3 getActorLocation() const
Gets the actors location in the world.
glm::vec3 getActorRotation() const
Gets the actors rotation in the world.
std::shared_ptr< SceneNode > getSceneNode() const
Getter for the scene graph node for this object.
std::optional< std::shared_ptr< SceneNode > > sceneNode
void rotateActor(glm::vec3 deltaRotation)
Applies an incremental rotation to the actor using quaternion multiplication. Use this instead of get...
void unregisterMeshComponent(MeshComponent *meshComponent)
EngineCore::Engine * getEngineModule()
gets the pointer to the engine object
static EngineManager & getInstance()
gets a reference to the engine manager
void tick(double deltaTime) override
Executes every frame if tick is enabled.
std::vector< std::shared_ptr< LogicComponent > > components
List of all logical components.
A component which can be attached as many times to an actor as one wants. It makes it possible to ren...
Log category system implementation.