Skip to content

Commit

Permalink
Fixed transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
matt77hias committed Apr 14, 2017
1 parent 0c0b04d commit b62716b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions MAGE/MAGE/src/math/transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ namespace mage {
@return The parent-to-object translation matrix of this transform.
*/
const XMMATRIX GetParentToObjectTranslationMatrix() const {
return XMMatrixTranslationFromVector(XMVectorSet(-m_translation.x, -m_translation.y, -m_translation.z, 0.0f));
return XMMatrixTranslationFromVector(-XMLoadFloat3(&m_translation));
}

//---------------------------------------------------------------------
Expand Down Expand Up @@ -540,7 +540,8 @@ namespace mage {
@return The object-to-parent rotation matrix of this transform.
*/
const XMMATRIX GetObjectToParentRotationMatrix() const {
return XMMatrixRotationY(GetRotationY()) * XMMatrixRotationX(GetRotationX()) * XMMatrixRotationZ(GetRotationZ());
//return XMMatrixRotationY(GetRotationY()) * XMMatrixRotationX(GetRotationX()) * XMMatrixRotationZ(GetRotationZ());
return XMMatrixRotationZ(GetRotationZ()) * XMMatrixRotationX(GetRotationX()) * XMMatrixRotationY(GetRotationY());
}

/**
Expand All @@ -549,7 +550,8 @@ namespace mage {
@return The parent-to-object rotation matrix of this transform.
*/
const XMMATRIX GetParentToObjectRotationMatrix() const {
return XMMatrixRotationZ(-GetRotationZ()) * XMMatrixRotationX(-GetRotationX()) * XMMatrixRotationY(-GetRotationY());
//return XMMatrixRotationZ(-GetRotationZ()) * XMMatrixRotationX(-GetRotationX()) * XMMatrixRotationY(-GetRotationY());
return XMMatrixRotationY(-GetRotationY()) * XMMatrixRotationX(-GetRotationX()) * XMMatrixRotationZ(-GetRotationZ());
}

//---------------------------------------------------------------------
Expand Down

0 comments on commit b62716b

Please sign in to comment.