| 60 | } |
| 61 | |
| 62 | void Matrix::NormalizeScale() |
| 63 | { |
| 64 | const float scaleX = 1.0f / Float3(M11, M21, M31).Length(); |
| 65 | const float scaleY = 1.0f / Float3(M12, M22, M32).Length(); |
| 66 | const float scaleZ = 1.0f / Float3(M13, M23, M33).Length(); |
| 67 | |
| 68 | M11 *= scaleX; |
| 69 | M21 *= scaleX; |
| 70 | M31 *= scaleX; |
| 71 | |
| 72 | M12 *= scaleY; |
| 73 | M22 *= scaleY; |
| 74 | M32 *= scaleY; |
| 75 | |
| 76 | M13 *= scaleZ; |
| 77 | M23 *= scaleZ; |
| 78 | M33 *= scaleZ; |
| 79 | } |
| 80 | |
| 81 | void Matrix::Decompose(float& yaw, float& pitch, float& roll) const |
| 82 | { |