From ec9f2379c7de16aa0523bfd2f9776adc505d2973 Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Thu, 19 Dec 2013 22:06:48 +0100 Subject: [PATCH] Minor bug fixes in math librrary --- Code/OysterMath/LinearMath.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/OysterMath/LinearMath.h b/Code/OysterMath/LinearMath.h index 0ebf94e7..b5eab471 100644 --- a/Code/OysterMath/LinearMath.h +++ b/Code/OysterMath/LinearMath.h @@ -269,7 +269,7 @@ namespace LinearAlgebra3D template inline ::LinearAlgebra::Vector4 ExtractAngularAxis( const ::LinearAlgebra::Matrix4x4 &orientationMatrix ) { - return ::std::asin( ::LinearAlgebra::Vector4(orientationMatrix.v[1].z, orientationMatrix.v[2].x, orientationMatrix.v[0].y, 1) ); + return ::std::asin( ::LinearAlgebra::Vector4(orientationMatrix.v[1].z, orientationMatrix.v[2].x, orientationMatrix.v[0].y, 0) ); } template @@ -332,7 +332,7 @@ namespace LinearAlgebra3D } template - inline ::LinearAlgebra::Matrix4x4 & RotationMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, ::LinearAlgebra::Matrix4x4 targetMem = ::LinearAlgebra::Matrix4x4() ) + inline ::LinearAlgebra::Matrix4x4 & RotationMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, ::LinearAlgebra::Matrix4x4 &targetMem = ::LinearAlgebra::Matrix4x4() ) { ::LinearAlgebra::Quaternion conjugate = rotationQuaternion.GetConjugate(); @@ -344,7 +344,7 @@ namespace LinearAlgebra3D } template - inline ::LinearAlgebra::Matrix4x4 & OrientationMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector3 &translation, ::LinearAlgebra::Matrix4x4 targetMem = ::LinearAlgebra::Matrix4x4() ) + inline ::LinearAlgebra::Matrix4x4 & OrientationMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector3 &translation, ::LinearAlgebra::Matrix4x4 &targetMem = ::LinearAlgebra::Matrix4x4() ) { ::LinearAlgebra::Quaternion conjugate = rotationQuaternion.GetConjugate(); @@ -356,7 +356,7 @@ namespace LinearAlgebra3D } template - inline ::LinearAlgebra::Matrix4x4 & OrientationMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector4 &translation, ::LinearAlgebra::Matrix4x4 targetMem = ::LinearAlgebra::Matrix4x4() ) + inline ::LinearAlgebra::Matrix4x4 & OrientationMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector4 &translation, ::LinearAlgebra::Matrix4x4 &targetMem = ::LinearAlgebra::Matrix4x4() ) { ::LinearAlgebra::Quaternion conjugate = rotationQuaternion.GetConjugate(); @@ -368,14 +368,14 @@ namespace LinearAlgebra3D } template - inline ::LinearAlgebra::Matrix4x4 & ViewMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector3 &translation, ::LinearAlgebra::Matrix4x4 targetMem = ::LinearAlgebra::Matrix4x4() ) + inline ::LinearAlgebra::Matrix4x4 & ViewMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector3 &translation, ::LinearAlgebra::Matrix4x4 &targetMem = ::LinearAlgebra::Matrix4x4() ) { OrientationMatrix( rotationQuaternion, translation, targetMem ); return InverseOrientationMatrix( targetMem, targetMem ); } template - inline ::LinearAlgebra::Matrix4x4 & ViewMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector4 &translation, ::LinearAlgebra::Matrix4x4 targetMem = ::LinearAlgebra::Matrix4x4() ) + inline ::LinearAlgebra::Matrix4x4 & ViewMatrix( const ::LinearAlgebra::Quaternion &rotationQuaternion, const ::LinearAlgebra::Vector4 &translation, ::LinearAlgebra::Matrix4x4 &targetMem = ::LinearAlgebra::Matrix4x4() ) { OrientationMatrix( rotationQuaternion, translation, targetMem ); return InverseOrientationMatrix( targetMem, targetMem );