2022-11-15 12:19:11 +01:00
|
|
|
#pragma once
|
|
|
|
|
#include "Math/Transform.h"
|
|
|
|
|
#include "Component.h"
|
|
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
|
|
|
|
namespace Component
|
|
|
|
|
{
|
|
|
|
|
struct Transform
|
|
|
|
|
{
|
|
|
|
|
Math::Vector getPosition() const { return transform.getPosition(); }
|
|
|
|
|
Math::Quaternion getRotation() const { return transform.getRotation(); }
|
|
|
|
|
Math::Vector getScale() const { return transform.getScale(); }
|
|
|
|
|
|
|
|
|
|
Math::Vector getForward() const { return transform.getForward(); }
|
|
|
|
|
Math::Vector getUp() const { return transform.getUp(); }
|
|
|
|
|
Math::Vector getRight() const { return transform.getRight(); }
|
|
|
|
|
|
|
|
|
|
Math::Matrix4 toMatrix() const { return transform.toMatrix(); }
|
|
|
|
|
|
2022-11-29 16:34:42 +01:00
|
|
|
bool isDirty() const { return dirty; }
|
|
|
|
|
void clean() { dirty = false; }
|
|
|
|
|
|
|
|
|
|
void setPosition(Math::Vector pos);
|
|
|
|
|
void setRotation(Math::Quaternion quat);
|
|
|
|
|
void setScale(Math::Vector scale);
|
|
|
|
|
|
2022-11-15 12:19:11 +01:00
|
|
|
void setRelativeLocation(Math::Vector location);
|
|
|
|
|
void setRelativeRotation(Math::Quaternion rotation);
|
|
|
|
|
void setRelativeRotation(Math::Vector rotation);
|
|
|
|
|
void setRelativeScale(Math::Vector scale);
|
|
|
|
|
|
|
|
|
|
void addRelativeLocation(Math::Vector translation);
|
|
|
|
|
void addRelativeRotation(Math::Quaternion rotation);
|
|
|
|
|
void addRelativeRotation(Math::Vector rotation);
|
|
|
|
|
private:
|
2022-11-29 16:34:42 +01:00
|
|
|
bool dirty = true;
|
2022-11-15 12:19:11 +01:00
|
|
|
Math::Transform transform;
|
|
|
|
|
};
|
|
|
|
|
DECLARE_COMPONENT(Transform)
|
|
|
|
|
|
|
|
|
|
} // namespace Component
|
|
|
|
|
} // namespace Seele
|