Added Math3D methods

ViewMatrix_LookAtDirection
ViewMatrix_LookAtPos

as requested by Pär
This commit is contained in:
Dander7BD 2013-11-22 10:49:07 +01:00
parent ba4576a07a
commit dad958b612
2 changed files with 16 additions and 0 deletions

View File

@ -141,6 +141,16 @@ namespace Oyster { namespace Math3D
return targetMem = ::LinearAlgebra3D::OrientationMatrix_LookAtPos( worldLookAt, normalizedUpVector, worldPos ); return targetMem = ::LinearAlgebra3D::OrientationMatrix_LookAtPos( worldLookAt, normalizedUpVector, worldPos );
} }
Float4x4 & ViewMatrix_LookAtDirection( const Float3 &normalizedDirection, const Float3 &normalizedUpVector, const Float3 &worldPos, Float4x4 &targetMem )
{
return ::LinearAlgebra3D::InverseOrientationMatrix( ::LinearAlgebra3D::OrientationMatrix_LookAtDirection( normalizedDirection, normalizedUpVector, worldPos ), targetMem );
}
Float4x4 & ViewMatrix_LookAtPos( const Float3 &worldLookAt, const Float3 &normalizedUpVector, const Float3 &worldPos, Float4x4 &targetMem )
{
return ::LinearAlgebra3D::InverseOrientationMatrix( ::LinearAlgebra3D::OrientationMatrix_LookAtPos( worldLookAt, normalizedUpVector, worldPos ), targetMem );
}
Float4x4 & InverseOrientationMatrix( const Float4x4 &orientationMatrix, Float4x4 &targetMem ) Float4x4 & InverseOrientationMatrix( const Float4x4 &orientationMatrix, Float4x4 &targetMem )
{ {
return ::LinearAlgebra3D::InverseOrientationMatrix( orientationMatrix, targetMem ); return ::LinearAlgebra3D::InverseOrientationMatrix( orientationMatrix, targetMem );

View File

@ -213,6 +213,12 @@ namespace Oyster { namespace Math3D /// Oyster's native math library specialized
//! @todo TODO: Add documentation and not tested //! @todo TODO: Add documentation and not tested
Float4x4 & OrientationMatrix_LookAtPos( const Float3 &worldLookAt, const Float3 &normalizedUpVector, const Float3 &worldPos, Float4x4 &targetMem = Float4x4() ); Float4x4 & OrientationMatrix_LookAtPos( const Float3 &worldLookAt, const Float3 &normalizedUpVector, const Float3 &worldPos, Float4x4 &targetMem = Float4x4() );
//! @todo TODO: Add documentation and not tested
Float4x4 & ViewMatrix_LookAtDirection( const Float3 &normalizedDirection, const Float3 &normalizedUpVector, const Float3 &worldPos, Float4x4 &targetMem = Float4x4() );
//! @todo TODO: Add documentation and not tested
Float4x4 & ViewMatrix_LookAtPos( const Float3 &worldLookAt, const Float3 &normalizedUpVector, const Float3 &worldPos, Float4x4 &targetMem = Float4x4() );
/// If orientationMatrix is assumed to be by all definitions a rigid orientation matrix aka rigid body matrix. Then this is a much faster inverse method. /// If orientationMatrix is assumed to be by all definitions a rigid orientation matrix aka rigid body matrix. Then this is a much faster inverse method.
Float4x4 & InverseOrientationMatrix( const Float4x4 &orientationMatrix, Float4x4 &targetMem = Float4x4() ); Float4x4 & InverseOrientationMatrix( const Float4x4 &orientationMatrix, Float4x4 &targetMem = Float4x4() );