Hey, what's the difference between the applyTorqueImpulse and the applyTorque methods in an btRigidBody ?
I have the Examples, User Manual and Doxygen Output.
I there any other documentation I am missing?
Thanks.
Luke
applyTorqueImpulse and applyTorque, whats the difference ?
-
- Posts: 15
- Joined: Fri Sep 08, 2006 3:39 pm
The word impulse in physics typically means an instantaneous velocity and/or rotation change.
I can't comment directly about the API because I'm not an experienced user (yet). My initial assumption would be that applyTorque() will apply the given torque (given in units such as Nm) over the next timestep, whereas applyTorqueImpulse will apply the given input (possibly in units such as Nms?) will be applied immediately, changing the current angular momentum and rotation.
I can't comment directly about the API because I'm not an experienced user (yet). My initial assumption would be that applyTorque() will apply the given torque (given in units such as Nm) over the next timestep, whereas applyTorqueImpulse will apply the given input (possibly in units such as Nms?) will be applied immediately, changing the current angular momentum and rotation.
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
This is correct. The applyTorqueImpuse changes the angular velocity directly, whereas applyTorque the torque accumulates and applies at the next simulation step:
and
Similar to applyImpulse and applyForce.
Hope this helps,
Erwin
Code: Select all
void applyTorqueImpulse(const btVector3& torque)
{
m_angularVelocity += m_invInertiaTensorWorld * torque;
}
Code: Select all
void applyTorque(const btVector3& torque)
{
m_totalTorque += torque;
}
Hope this helps,
Erwin
-
- Posts: 15
- Joined: Fri Sep 08, 2006 3:39 pm