Represents an entity in the scene that can have components and interact with the world. The Actor class manages its own state, transform, components, and can be attached to a Scene. To create a new Actor you just have to create a class that hinerits from Actor. If you want you can use the EmptyActor class.
Actor(Vector3D position = 0, Vector3D size = 1, Quaternion rotation = Quaternion(0, 0));
Contructor of an Actor.
virtual void Start();
This function is called when the map is load or reload.
virtual void Update();
This function is called each tick.
virtual void Destroy();
This function is called when the actor is destroyed.
void AttachScene(Scene& scene);
This function can be used to change the attached scene of an actor.
void AddComponent(Component* component);
This function can be used if you want to add a component to an actor.
When you create a new component this function will automatically be called.
void RemoveComponent(Component* component);
This function can be used to remove a component from an actor.
void SetActive(ActorState state);
This function can be used to change the actor state.
There is 3 states : Active, Paused, Dead.
void SetPosition(Vector3D pPosition);
This function can be used to change the world location of the actor.
void SetSize(Vector3D pSize);
This function can be used to change the world scale of the actor.
void RotateX(float pAnle);
This function can be used to rotate the actor around the X axis.
void RotateY(float pAngle);
This function can be used to rotate the actor around the Y axis.
void RotateZ(float pAngle);
This function can be used to rotate the actor around the Z axis.
std::vector<Component*> GetComponents() const;
Returns all the components attached to this actor
ActorState GetState();
Returns the state of the actor.
Scene& GetScene();
Returns the scene bind to this actor.
TransformComponent& GetTransformComponent();
Returns the transform component of the actor.
inline RigidbodyComponent* GetRigidBody()
Returns the rigidbody (if there is one) attached to this actor.
void SetTag(std::string pTag);
Set the tag of the actor.
inline std::string GetTag()
Returns the tag of the actor.
bool HasTag(std::string tag);
Returns if an actor has a specified tag.
template<typename C>
C* GetComponentOfType() const
Returns a component of a specified type.