Renamed Formula::CollisionResponse::Impulse to..
.. Formula::CollisionResponse::Bounce
This commit is contained in:
parent
24418603ad
commit
4e21e2b0c0
|
@ -39,9 +39,9 @@ namespace
|
|||
deuterG_Magnitude = deuterG.Dot( normal );
|
||||
|
||||
// bounce
|
||||
Float impulse = Formula::CollisionResponse::Impulse( deuterState.GetRestitutionCoeff(),
|
||||
deuterState.GetMass(), deuterG_Magnitude,
|
||||
protoState.GetMass(), protoG_Magnitude );;
|
||||
Float impulse = Formula::CollisionResponse::Bounce( deuterState.GetRestitutionCoeff(),
|
||||
deuterState.GetMass(), deuterG_Magnitude,
|
||||
protoState.GetMass(), protoG_Magnitude );;
|
||||
Float4 sumJ = normal*impulse;
|
||||
|
||||
sumJ -= Formula::CollisionResponse::Friction( impulse, normal,
|
||||
|
@ -54,9 +54,9 @@ namespace
|
|||
deuterG_Magnitude = deuterG.Dot( normal );
|
||||
|
||||
// bounce
|
||||
sumJ += normal * Formula::CollisionResponse::Impulse( protoState.GetRestitutionCoeff(),
|
||||
protoState.GetMass(), protoG_Magnitude,
|
||||
deuterState.GetMass(), deuterG_Magnitude );
|
||||
sumJ += normal * Formula::CollisionResponse::Bounce( protoState.GetRestitutionCoeff(),
|
||||
protoState.GetMass(), protoG_Magnitude,
|
||||
deuterState.GetMass(), deuterG_Magnitude );
|
||||
// FRICTION
|
||||
// Apply
|
||||
//sumJ += ( 1 / deuterState.GetMass() )*frictionImpulse;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace Oyster { namespace Physics { namespace Formula
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ namespace Oyster { namespace Physics { namespace Formula
|
|||
|
||||
namespace CollisionResponse
|
||||
{
|
||||
::Oyster::Math::Float Impulse( ::Oyster::Math::Float coeffOfRestitution,
|
||||
::Oyster::Math::Float massA, ::Oyster::Math::Float momentumA,
|
||||
::Oyster::Math::Float massB, ::Oyster::Math::Float momentumB );
|
||||
::Oyster::Math::Float Bounce( ::Oyster::Math::Float coeffOfRestitution,
|
||||
::Oyster::Math::Float massA, ::Oyster::Math::Float momentumA,
|
||||
::Oyster::Math::Float massB, ::Oyster::Math::Float momentumB );
|
||||
|
||||
::Oyster::Math::Float4 Friction( ::Oyster::Math::Float impulse, ::Oyster::Math::Float4 impulseNormal,
|
||||
::Oyster::Math::Float4 momentumA, ::Oyster::Math::Float staticFrictionA,
|
||||
|
|
Loading…
Reference in New Issue