diff options
author | chai <chaifix@163.com> | 2019-04-03 09:00:13 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-04-03 09:00:13 +0800 |
commit | c8a6a8e2dd6f015a31b4f8191ad945a78fe77f3d (patch) | |
tree | 8060458d7aa5e514cdef32f6f92e157221efde4a /source/modules/asura-utils | |
parent | af7bdaa10ee71a319dc55c3c7556fa43a95c9dc9 (diff) |
*misc
Diffstat (limited to 'source/modules/asura-utils')
-rw-r--r-- | source/modules/asura-utils/io/renewable.h | 8 | ||||
-rw-r--r-- | source/modules/asura-utils/math/matrix44.cpp | 7 | ||||
-rw-r--r-- | source/modules/asura-utils/math/matrix44.h | 77 |
3 files changed, 14 insertions, 78 deletions
diff --git a/source/modules/asura-utils/io/renewable.h b/source/modules/asura-utils/io/renewable.h index a624c2c..4d047ea 100644 --- a/source/modules/asura-utils/io/renewable.h +++ b/source/modules/asura-utils/io/renewable.h @@ -21,12 +21,12 @@ namespace AsuraEngine virtual ~Renewable() {}; /// - /// ̳RenewableҪṩһRenew + /// ̳RenewableҪṩһUpdate /// - /// Effective C++09.Ӧýֹڹ캯еvirtualRenew - /// ӹ캯г룬ҪֶRenew + /// Effective C++09.Ӧýֹڹ캯еvirtualUpdate + /// ӹ캯г룬ҪֶUpdate /// - virtual bool Renew(AEIO::DecodedData* decode_data) = 0; + virtual bool Update(AEIO::DecodedData* decode_data) = 0; }; diff --git a/source/modules/asura-utils/math/matrix44.cpp b/source/modules/asura-utils/math/matrix44.cpp index 10c9ece..a1dc933 100644 --- a/source/modules/asura-utils/math/matrix44.cpp +++ b/source/modules/asura-utils/math/matrix44.cpp @@ -178,6 +178,13 @@ namespace AsuraEngine this->operator *=(t); } + void Matrix44::Transform(float x, float y, float angle, float sx, float sy, float ox, float oy) + { + Matrix44 t; + t.SetTransformation(x, y, angle, sx, sy, ox, oy); + this->operator *=(t); + } + // | x | // | y | // | 0 | diff --git a/source/modules/asura-utils/math/matrix44.h b/source/modules/asura-utils/math/matrix44.h index c0cea92..fa5be33 100644 --- a/source/modules/asura-utils/math/matrix44.h +++ b/source/modules/asura-utils/math/matrix44.h @@ -10,119 +10,48 @@ namespace AsuraEngine /// ҪתõOpenGLglm::mat4 /// https://blog.csdn.net/candycat1992/article/details/8830894 /// - class Matrix44 { public: static const Matrix44 Identity; - /// - /// Creates a new identity matrix. - /// Matrix44(); - /// - /// Copy constructor. - /// Matrix44(const Matrix44& m); - /// - /// Destructor. - /// ~Matrix44(); void operator = (const Matrix44& m); void SetOrtho(float _left, float _right, float _bottom, float _top, float _near, float _far); - /// - /// Multiplies this Matrix44 with another Matrix44, changing neither. - /// @param m The Matrix44 to multiply with this Matrix44. - /// @return The combined matrix. - /// Matrix44 operator * (const Matrix44 & m) const; - /// - /// Multiplies a Matrix44 into this Matrix44. - /// @param m The Matrix44 to combine into this Matrix44. - /// void operator *= (const Matrix44 & m); - /// - /// Gets a pointer to the 16 array elements. - /// @return The array elements. - /// const float* GetElements() const; - /// - /// ReSets this Matrix44 to the identity matrix. - /// void SetIdentity(); - /// - /// ReSets this Matrix44 to a translation. - /// @param x Translation along x-axis. - /// @param y Translation along y-axis. - /// void SetTranslation(float x, float y); - /// - /// ReSets this Matrix44 to a rotation. - /// @param r The angle in radians. - /// void SetRotation(float r); - /// - /// ReSets this Matrix44 to a scale transformation. - /// @param sx Scale factor along the x-axis. - /// @param sy Scale factor along the y-axis. - /// void SetScale(float sx, float sy); - /// - /// ReSets this Matrix44 to a shear transformation. - /// @param kx Shear along x-axis. - /// @param ky Shear along y-axis. - /// void SetShear(float kx, float ky); - /// - /// Creates a transformation with a certain position, orientation, scale - /// and offSet. Perfect for Drawables -- what a coincidence! - /// - /// @param x The translation along the x-axis. - /// @param y The translation along the y-axis. - /// @param angle The rotation (rad) around the center with offSet (ox,oy). - /// @param sx Scale along x-axis. - /// @param sy Scale along y-axis. - /// @param ox The offSet for rotation along the x-axis. - /// @param oy The offSet for rotation along the y-axis. - /// @param kx Shear along x-axis - /// @param ky Shear along y-axis - /// void SetTransformation(float x, float y, float angle, float sx, float sy, float ox, float oy); - /// - /// Multiplies this Matrix44 with a translation. - /// @param x Translation along x-axis. - /// @param y Translation along y-axis. - /// void Translate(float x, float y); - /// - /// Multiplies this Matrix44 with a rotation. - /// @param r Angle in radians. - /// void Rotate(float r); - /// - /// Multiplies this Matrix44 with a scale transformation. - /// @param sx Scale factor along the x-axis. - /// @param sy Scale factor along the y-axis. - /// void Scale(float sx, float sy); + void Transform(float x, float y, float angle, float sx, float sy, float ox, float oy); + /// /// Multiplies this Matrix44 with a shear transformation. /// @param kx Shear along the x-axis. @@ -157,4 +86,4 @@ namespace AsuraEngine namespace AEMath = AsuraEngine::Math; -#endif
\ No newline at end of file +#endif
\ No newline at end of file |