Files
Seele/src/Engine/Actor/Actor.h
T

30 lines
690 B
C++
Raw Normal View History

2020-04-15 02:03:56 +02:00
#pragma once
#include "Entity.h"
2022-11-17 16:47:42 +01:00
#include "Component/Transform.h"
2020-04-15 02:03:56 +02:00
namespace Seele
{
2021-04-01 16:40:14 +02:00
DECLARE_REF(Actor)
// Actors are entities that are part of the scene hierarchy
// In order for that hierarchy to make sense it requires at least a transform component
class Actor : public Entity
2020-04-15 02:03:56 +02:00
{
public:
Actor(PScene scene);
2020-04-15 02:03:56 +02:00
virtual ~Actor();
2020-05-05 01:51:13 +02:00
2020-04-15 02:03:56 +02:00
PActor getParent();
void addChild(PActor child);
2022-04-13 13:01:35 +02:00
void removeChild(PActor child);
2020-04-15 02:03:56 +02:00
Array<PActor> getChildren();
2023-01-21 18:43:21 +01:00
Component::Transform& getTransform();
protected:
//Component::Transform& getTransform();
2020-05-05 01:51:13 +02:00
void setParent(PActor parent);
2020-04-15 02:03:56 +02:00
PActor parent;
Array<PActor> children;
};
2021-04-01 16:40:14 +02:00
DEFINE_REF(Actor)
2020-05-05 01:51:13 +02:00
} // namespace Seele