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);
|
2023-11-30 11:51:53 +01:00
|
|
|
void translate(Vector direction);
|
|
|
|
|
void rotate(Quaternion quat);
|
|
|
|
|
void scale(Vector scale);
|
2022-11-15 12:19:11 +01:00
|
|
|
private:
|
|
|
|
|
Math::Transform transform;
|
|
|
|
|
};
|
|
|
|
|
DECLARE_COMPONENT(Transform)
|
|
|
|
|
|
|
|
|
|
} // namespace Component
|
|
|
|
|
} // namespace Seele
|