From 78706f992980ef1c783b75828cc44673cecbe8b2 Mon Sep 17 00:00:00 2001 From: Dander7BD Date: Tue, 28 Jan 2014 11:43:24 +0100 Subject: [PATCH] Revert "Formula fix" This reverts commit 8435a2c9708335799cf3bf9d9532cf5f7fbd3261. --- Code/OysterPhysics3D/OysterPhysics3D.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Code/OysterPhysics3D/OysterPhysics3D.h b/Code/OysterPhysics3D/OysterPhysics3D.h index c6eca8e8..f814ff46 100644 --- a/Code/OysterPhysics3D/OysterPhysics3D.h +++ b/Code/OysterPhysics3D/OysterPhysics3D.h @@ -59,20 +59,11 @@ namespace Oyster { namespace Physics3D /****************************************************************** * Returns the world tangential momentum at worldPos, of a mass in rotation. - * G = ( H x r ) / ( |H| * |r|^2 ) <-> H = r x G * @todo TODO: improve doc ******************************************************************/ inline ::Oyster::Math::Float4 TangentialLinearMomentum( const ::Oyster::Math::Float4 &angularMomentum, const ::Oyster::Math::Float4 &worldOffset ) { - ::Oyster::Math::Float magnitudeH_squared = angularMomentum.Dot( angularMomentum ); - if( magnitudeH_squared > 0 ) - { - return ::Oyster::Math::Float4( angularMomentum.xyz.Cross(worldOffset.xyz), 0.0f ) /= ( (::Oyster::Math::Float)::std::sqrt(magnitudeH_squared) * worldOffset.Dot( worldOffset ) ); - } - else - { - return ::Oyster::Math::Float4::null; - } + return ::Oyster::Math::Float4( angularMomentum.xyz.Cross(worldOffset.xyz), 0.0f ) /= worldOffset.Dot( worldOffset ); } /******************************************************************