------------------------------------------------------------------- * @brief Build a 3x3 matrix from the transformations */
| 137 | * @brief Build a 3x3 matrix from the transformations |
| 138 | */ |
| 139 | inline void GetMatrix(aiMatrix3x3& mOut) { |
| 140 | mOut = aiMatrix3x3(); |
| 141 | if (1.0f != mScaling.x || 1.0f != mScaling.y) { |
| 142 | aiMatrix3x3 mScale; |
| 143 | mScale.a1 = mScaling.x; |
| 144 | mScale.b2 = mScaling.y; |
| 145 | mOut = mScale; |
| 146 | } |
| 147 | if (mRotation) { |
| 148 | aiMatrix3x3 mRot; |
| 149 | mRot.a1 = mRot.b2 = std::cos(mRotation); |
| 150 | mRot.a2 = mRot.b1 = std::sin(mRotation); |
| 151 | mRot.a2 = -mRot.a2; |
| 152 | mOut *= mRot; |
| 153 | } |
| 154 | if (mTranslation.x || mTranslation.y) { |
| 155 | aiMatrix3x3 mTrans; |
| 156 | mTrans.a3 = mTranslation.x; |
| 157 | mTrans.b3 = mTranslation.y; |
| 158 | mOut *= mTrans; |
| 159 | } |
| 160 | } |
| 161 | }; |
| 162 | |
| 163 | // --------------------------------------------------------------------------- |