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

60 lines
1.6 KiB
C++
Raw Normal View History

2020-04-15 02:03:56 +02:00
#pragma once
#include "MinimalEngine.h"
2020-05-05 01:51:13 +02:00
#include "Math/Transform.h"
2020-04-15 02:03:56 +02:00
namespace Seele
{
2021-04-01 16:40:14 +02:00
DECLARE_REF(Actor)
DECLARE_REF(Component)
DECLARE_REF(Scene)
2020-04-15 02:03:56 +02:00
class Actor
{
public:
Actor();
virtual ~Actor();
2022-01-12 14:40:26 +01:00
virtual void launchStart();
virtual void start() {}
2022-04-15 23:45:44 +02:00
void launchTick(float deltaTime) const;
virtual void tick(float) const { }//co_return; }
void launchUpdate();
virtual void update() { }//co_return; }
2020-05-05 01:51:13 +02:00
void notifySceneAttach(PScene scene);
PScene getScene();
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();
2022-03-19 22:45:30 +01:00
//void setAbsoluteLocation(Vector location);
//void setAbsoluteRotation(Quaternion rotation);
//void setAbsoluteRotation(Vector rotation);
//void setWorldScale(Vector scale);
2020-04-15 02:03:56 +02:00
void setRelativeLocation(Vector location);
2020-10-23 01:47:56 +02:00
void setRelativeRotation(Quaternion rotation);
void setRelativeRotation(Vector rotation);
2020-04-15 02:03:56 +02:00
void setRelativeScale(Vector scale);
2020-05-05 01:51:13 +02:00
2022-03-19 22:45:30 +01:00
//void addAbsoluteTranslation(Vector translation);
//void addAbsoluteRotation(Quaternion rotation);
//void addAbsoluteRotation(Vector rotation);
void addRelativeLocation(Vector translation);
void addRelativeRotation(Quaternion rotation);
void addRelativeRotation(Vector rotation);
2020-05-05 01:51:13 +02:00
2020-04-15 02:03:56 +02:00
PComponent getRootComponent();
void setRootComponent(PComponent newRoot);
2020-05-05 01:51:13 +02:00
// Returns a read-only copy of the actors transform
Transform getTransform() const;
protected:
2020-05-05 01:51:13 +02:00
void setParent(PActor parent);
PScene owningScene;
2020-04-15 02:03:56 +02:00
PActor parent;
Array<PActor> children;
PComponent rootComponent;
};
2021-04-01 16:40:14 +02:00
DEFINE_REF(Actor)
2020-05-05 01:51:13 +02:00
} // namespace Seele