Files
Seele/src/Engine/Math/Transform.h
T

38 lines
1.1 KiB
C++
Raw Normal View History

2020-04-15 02:03:56 +02:00
#pragma once
#include "Vector.h"
2020-05-05 01:51:13 +02:00
#include "Matrix.h"
2020-04-15 02:03:56 +02:00
namespace Seele
{
class Transform
{
public:
Transform();
2020-05-05 01:51:13 +02:00
Transform(const Transform &other);
Transform(Transform &&other);
2020-04-15 02:03:56 +02:00
Transform(Vector position);
Transform(Vector position, Quaternion rotation);
Transform(Vector position, Quaternion rotation, Vector scale);
Transform(Quaternion rotation, Vector scale);
~Transform();
Vector inverseTransformPosition(const Vector &v) const;
2020-05-05 01:51:13 +02:00
Matrix4 toMatrix();
static Vector getSafeScaleReciprocal(const Vector4 &inScale, float tolerance = 0.000000001f);
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;
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);
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);
2020-06-02 11:46:18 +02:00
Transform &operator*(const Transform &other);
2020-04-15 02:03:56 +02:00
private:
Vector4 position;
Quaternion rotation;
Vector4 scale;
};
} // namespace Seele