aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/math/je_transform.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-12 21:48:33 +0800
committerchai <chaifix@163.com>2019-01-12 21:48:33 +0800
commit8b00d67febf133e89f6a0bfabc41feed555dc4a9 (patch)
treefe48ef17c250afa40c2588300fcdb5920dba6951 /src/libjin/math/je_transform.cpp
parenta907c39756ef6b368d06643afa491c49a9044a8e (diff)
*去掉文件前缀je_
Diffstat (limited to 'src/libjin/math/je_transform.cpp')
-rw-r--r--src/libjin/math/je_transform.cpp104
1 files changed, 0 insertions, 104 deletions
diff --git a/src/libjin/math/je_transform.cpp b/src/libjin/math/je_transform.cpp
deleted file mode 100644
index 95ca14d..0000000
--- a/src/libjin/math/je_transform.cpp
+++ /dev/null
@@ -1,104 +0,0 @@
-#include "je_transform.h"
-
-namespace JinEngine
-{
- namespace Math
- {
-
- Transform::Transform()
- : mScale(1, 1)
- , mPosition(0, 0)
- , mOrigin(0, 0)
- , mRotation(0)
- {
- }
-
- Transform::Transform(float x, float y, float sx, float sy, float r, float ox, float oy)
- {
- set(x, y, sx, sy, r, ox, oy);
- }
-
- void Transform::set(float x, float y, float sx, float sy, float r, float ox, float oy)
- {
- setPosition(x, y);
- setScale(sx, sy);
- setRotation(r);
- setOrigin(ox, oy);
- }
-
- void Transform::setScale(float sx, float sy)
- {
- mScale.set(sx, sy);
- }
-
- Vector2<float> Transform::getScale() const
- {
- return mScale;
- }
-
- void Transform::scale(float sx, float sy)
- {
- mScale.x() *= sx;
- mScale.y() *= sy;
- }
-
- void Transform::setPosition(const Vector2<float>& p)
- {
- setPosition(p.x(), p.y());
- }
-
- void Transform::setPosition(float x, float y)
- {
- mPosition.set(x, y);
- }
-
- Vector2<float> Transform::getPosition() const
- {
- return mPosition;
- }
-
- void Transform::move(float x, float y)
- {
- mPosition.x() += x;
- mPosition.y() += y;
- }
-
- void Transform::move(const Vector2<float>& v)
- {
- move(v.x(), v.y());
- }
-
- void Transform::setOrigin(float x, float y)
- {
- mOrigin.set(x, y);
- }
-
- Vector2<float> Transform::getOrigin() const
- {
- return mOrigin;
- }
-
- void Transform::setRotation(float r)
- {
- mRotation = r;
- }
-
- float Transform::getRotation() const
- {
- return mRotation;
- }
-
- void Transform::rotate(float r)
- {
- mRotation += r;
- }
-
- Matrix Transform::getMatrix() const
- {
- Matrix m;
- m.setTransformation(mPosition.x(), mPosition.y(), mRotation, mScale.x(), mScale.y(), mOrigin.x(), mOrigin.y());
- return m;
- }
-
- }
-} \ No newline at end of file