Implementing ECS SystemBase and updating slang
This commit is contained in:
@@ -1,60 +1,31 @@
|
||||
#pragma once
|
||||
#include "MinimalEngine.h"
|
||||
#include "Math/Transform.h"
|
||||
#include "Entity.h"
|
||||
#include "Scene/Component/Transform.h"
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
DECLARE_REF(Actor)
|
||||
DECLARE_REF(Component)
|
||||
DECLARE_REF(Scene)
|
||||
class 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
|
||||
{
|
||||
public:
|
||||
Actor();
|
||||
Actor(PScene scene);
|
||||
virtual ~Actor();
|
||||
virtual void launchStart();
|
||||
virtual void start() {}
|
||||
void launchTick(float deltaTime) const;
|
||||
virtual void tick(float) const { }//co_return; }
|
||||
void launchUpdate();
|
||||
virtual void update() { }//co_return; }
|
||||
void notifySceneAttach(PScene scene);
|
||||
PScene getScene();
|
||||
|
||||
PActor getParent();
|
||||
void addChild(PActor child);
|
||||
void removeChild(PActor child);
|
||||
Array<PActor> getChildren();
|
||||
//void setAbsoluteLocation(Vector location);
|
||||
//void setAbsoluteRotation(Quaternion rotation);
|
||||
//void setAbsoluteRotation(Vector rotation);
|
||||
//void setWorldScale(Vector scale);
|
||||
|
||||
void setRelativeLocation(Vector location);
|
||||
void setRelativeRotation(Quaternion rotation);
|
||||
void setRelativeRotation(Vector rotation);
|
||||
void setRelativeScale(Vector scale);
|
||||
|
||||
//void addAbsoluteTranslation(Vector translation);
|
||||
//void addAbsoluteRotation(Quaternion rotation);
|
||||
//void addAbsoluteRotation(Vector rotation);
|
||||
|
||||
void addRelativeLocation(Vector translation);
|
||||
void addRelativeRotation(Quaternion rotation);
|
||||
void addRelativeRotation(Vector rotation);
|
||||
|
||||
PComponent getRootComponent();
|
||||
void setRootComponent(PComponent newRoot);
|
||||
|
||||
|
||||
// Returns a read-only copy of the actors transform
|
||||
Transform getTransform() const;
|
||||
const Component::Transform& getTransform() const;
|
||||
|
||||
protected:
|
||||
//Component::Transform& getTransform();
|
||||
void setParent(PActor parent);
|
||||
PScene owningScene;
|
||||
PActor parent;
|
||||
Array<PActor> children;
|
||||
PComponent rootComponent;
|
||||
};
|
||||
DEFINE_REF(Actor)
|
||||
} // namespace Seele
|
||||
Reference in New Issue
Block a user