add option for deformable rigid split impulse
This commit is contained in:
@@ -332,6 +332,48 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void applyPushImpulse(const btVector3& impulse, const btVector3& rel_pos)
|
||||
{
|
||||
if (m_inverseMass != btScalar(0.))
|
||||
{
|
||||
applyCentralPushImpulse(impulse);
|
||||
if (m_angularFactor)
|
||||
{
|
||||
applyTorqueTurnImpulse(rel_pos.cross(impulse * m_linearFactor));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
btVector3 getPushVelocity()
|
||||
{
|
||||
return m_pushVelocity;
|
||||
}
|
||||
|
||||
btVector3 getTurnVelocity()
|
||||
{
|
||||
return m_turnVelocity;
|
||||
}
|
||||
|
||||
void setPushVelocity(const btVector3& v)
|
||||
{
|
||||
m_pushVelocity = v;
|
||||
}
|
||||
|
||||
void setTurnVelocity(const btVector3& v)
|
||||
{
|
||||
m_turnVelocity = v;
|
||||
}
|
||||
|
||||
void applyCentralPushImpulse(const btVector3& impulse)
|
||||
{
|
||||
m_pushVelocity += impulse * m_linearFactor * m_inverseMass;
|
||||
}
|
||||
|
||||
void applyTorqueTurnImpulse(const btVector3& torque)
|
||||
{
|
||||
m_turnVelocity += m_invInertiaTensorWorld * torque * m_angularFactor;
|
||||
}
|
||||
|
||||
void clearForces()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user