Renamed Formula::CollisionResponse::Impulse to..

.. Formula::CollisionResponse::Bounce
This commit is contained in:
Dander7BD 2013-12-19 11:21:49 +01:00
parent 24418603ad
commit 4e21e2b0c0
3 changed files with 10 additions and 10 deletions

View File

@ -39,9 +39,9 @@ namespace
deuterG_Magnitude = deuterG.Dot( normal ); deuterG_Magnitude = deuterG.Dot( normal );
// bounce // bounce
Float impulse = Formula::CollisionResponse::Impulse( deuterState.GetRestitutionCoeff(), Float impulse = Formula::CollisionResponse::Bounce( deuterState.GetRestitutionCoeff(),
deuterState.GetMass(), deuterG_Magnitude, deuterState.GetMass(), deuterG_Magnitude,
protoState.GetMass(), protoG_Magnitude );; protoState.GetMass(), protoG_Magnitude );;
Float4 sumJ = normal*impulse; Float4 sumJ = normal*impulse;
sumJ -= Formula::CollisionResponse::Friction( impulse, normal, sumJ -= Formula::CollisionResponse::Friction( impulse, normal,
@ -54,9 +54,9 @@ namespace
deuterG_Magnitude = deuterG.Dot( normal ); deuterG_Magnitude = deuterG.Dot( normal );
// bounce // bounce
sumJ += normal * Formula::CollisionResponse::Impulse( protoState.GetRestitutionCoeff(), sumJ += normal * Formula::CollisionResponse::Bounce( protoState.GetRestitutionCoeff(),
protoState.GetMass(), protoG_Magnitude, protoState.GetMass(), protoG_Magnitude,
deuterState.GetMass(), deuterG_Magnitude ); deuterState.GetMass(), deuterG_Magnitude );
// FRICTION // FRICTION
// Apply // Apply
//sumJ += ( 1 / deuterState.GetMass() )*frictionImpulse; //sumJ += ( 1 / deuterState.GetMass() )*frictionImpulse;

View File

@ -36,7 +36,7 @@ namespace Oyster { namespace Physics { namespace Formula
namespace CollisionResponse namespace CollisionResponse
{ {
inline ::Oyster::Math::Float Impulse( ::Oyster::Math::Float e, ::Oyster::Math::Float mA, ::Oyster::Math::Float gA, ::Oyster::Math::Float mB, ::Oyster::Math::Float gB ) inline ::Oyster::Math::Float Bounce( ::Oyster::Math::Float e, ::Oyster::Math::Float mA, ::Oyster::Math::Float gA, ::Oyster::Math::Float mB, ::Oyster::Math::Float gB )
{ {
return (e + 1) * (mB*gA - mA*gB) / (mA + mB); return (e + 1) * (mB*gA - mA*gB) / (mA + mB);
} }

View File

@ -17,9 +17,9 @@ namespace Oyster { namespace Physics { namespace Formula
namespace CollisionResponse namespace CollisionResponse
{ {
::Oyster::Math::Float Impulse( ::Oyster::Math::Float coeffOfRestitution, ::Oyster::Math::Float Bounce( ::Oyster::Math::Float coeffOfRestitution,
::Oyster::Math::Float massA, ::Oyster::Math::Float momentumA, ::Oyster::Math::Float massA, ::Oyster::Math::Float momentumA,
::Oyster::Math::Float massB, ::Oyster::Math::Float momentumB ); ::Oyster::Math::Float massB, ::Oyster::Math::Float momentumB );
::Oyster::Math::Float4 Friction( ::Oyster::Math::Float impulse, ::Oyster::Math::Float4 impulseNormal, ::Oyster::Math::Float4 Friction( ::Oyster::Math::Float impulse, ::Oyster::Math::Float4 impulseNormal,
::Oyster::Math::Float4 momentumA, ::Oyster::Math::Float staticFrictionA, ::Oyster::Math::Float4 momentumA, ::Oyster::Math::Float staticFrictionA,