Correct Manner to Apply Forces

Post Reply
TBurnett
Posts: 1
Joined: Sat Nov 21, 2015 5:09 pm

Correct Manner to Apply Forces

Post by TBurnett »

Where can I find a simple demonstration of applying forces to bodies? Seems like this topic should be included as a demo.
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland
Contact:

Re: Correct Manner to Apply Forces

Post by benelot »

If you have a simple btRigidBody, you can use the method:

Code: Select all

void applyForce(const btVector3& force, const btVector3& rel_pos) 
This applies a central force and additionally applies a torque depending on what you set in relative position.

To apply a torque, you can use:

Code: Select all

void applyTorque(const btVector3& torque)
Torque can only be applied to the center of mass (that is how it is defined in physics, not a limitation of Bullet Physics).

What exactly do you need?
Post Reply