2020-04-15 02:03:56 +02:00
|
|
|
#pragma once
|
2022-11-15 12:19:11 +01:00
|
|
|
#include "Math/Vector.h"
|
|
|
|
|
#include "Math/Matrix.h"
|
2020-04-15 02:03:56 +02:00
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
2022-11-15 12:19:11 +01:00
|
|
|
namespace Math
|
|
|
|
|
{
|
2020-04-15 02:03:56 +02:00
|
|
|
class Transform
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Transform();
|
2020-05-05 01:51:13 +02:00
|
|
|
Transform(const Transform &other);
|
|
|
|
|
Transform(Transform &&other);
|
2021-03-31 12:18:16 +02:00
|
|
|
explicit Transform(Vector position);
|
2020-04-15 02:03:56 +02:00
|
|
|
Transform(Vector position, Quaternion rotation);
|
|
|
|
|
Transform(Vector position, Quaternion rotation, Vector scale);
|
|
|
|
|
Transform(Quaternion rotation, Vector scale);
|
|
|
|
|
~Transform();
|
2022-11-15 12:19:11 +01:00
|
|
|
Matrix4 toMatrix() const;
|
2021-01-19 15:30:00 +01:00
|
|
|
Vector transformPosition(const Vector &v) const;
|
2020-04-15 02:03:56 +02:00
|
|
|
|
2020-05-05 01:51:13 +02:00
|
|
|
Vector getPosition() const;
|
|
|
|
|
Quaternion getRotation() const;
|
|
|
|
|
Vector getScale() const;
|
2022-11-29 16:34:42 +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
|
|
|
|
2022-03-19 22:45:30 +01:00
|
|
|
Vector getForward() const;
|
|
|
|
|
Vector getRight() const;
|
|
|
|
|
Vector getUp() const;
|
2020-04-15 02:03:56 +02:00
|
|
|
|
2020-05-05 01:51:13 +02:00
|
|
|
bool equals(const Transform &other, float tolerance = 0.000000001f);
|
|
|
|
|
static void multiply(Transform *outTransform, const Transform *a, const Transform *b);
|
2022-03-19 22:45:30 +01:00
|
|
|
static void add(Transform *outTransform, const Transform *a, const Transform *b);
|
2020-04-15 02:03:56 +02:00
|
|
|
|
2020-05-05 01:51:13 +02:00
|
|
|
Transform &operator=(const Transform &other);
|
|
|
|
|
Transform &operator=(Transform &&other);
|
2022-03-19 22:45:30 +01:00
|
|
|
Transform operator+(const Transform& other) const;
|
2021-01-19 15:30:00 +01:00
|
|
|
Transform operator*(const Transform &other) const;
|
2020-04-15 02:03:56 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Vector4 position;
|
|
|
|
|
Quaternion rotation;
|
|
|
|
|
Vector4 scale;
|
|
|
|
|
};
|
2022-11-15 12:19:11 +01:00
|
|
|
} // namespace Math
|
2020-04-15 02:03:56 +02:00
|
|
|
} // namespace Seele
|