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