aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/math/transform.h
blob: 0a0fa0a74dc3b11031cfac7b0bc54f97acd02ecb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef __JE_TRANSFORM_H__
#define __JE_TRANSFORM_H__

#include "matrix.h"
#include "vector2.hpp"

namespace JinEngine
{
	namespace Math
	{

		class Transform
		{
		public:
			Transform();
			Transform(float x, float y, float sx, float sy, float r, float ox, float oy);

			void set(float x, float y, float sx, float sy, float r, float ox, float oy);

			void setScale(float sx, float sy);
			Vector2<float> getScale() const;
			void scale(float sx, float sy);

			void setPosition(float x, float y);
			void setPosition(const Vector2<float>& p);
			Vector2<float> getPosition() const;
			void move(float x, float y);
			void move(const Vector2<float>& v);

			void setOrigin(float x, float y);
			Vector2<float> getOrigin() const;

			void setRotation(float r);
			float getRotation() const;
			void rotate(float r);

			Matrix getMatrix() const;

		private:
			Vector2<float> mPosition;
			Vector2<float> mOrigin;
			Vector2<float> mScale;
			float		  mRotation;

		};

	}
}

#endif