Page 1 of 1

ApplyCentralForce

Posted: Sun Jun 14, 2009 8:52 pm
by hahanoob
I'm porting a small game where I used some basic homerolled physics over to Bullet. I'm curious if, when applying force in response to input, should I be modifying it by the dt between frames or does the simulation do that for me with some magic? Something like:

Code: Select all

Ship::Update(dt)
  if pressedForward
    body->applyCentralForce(Direction * amount * dt)
It seems like I should have to but I don't see any mention of it anywhere on the wiki or in examples.

Re: ApplyCentralForce

Posted: Mon Jun 15, 2009 1:09 am
by thloh85
It all depends on whether you want to apply a force continuously or just one time.
For one timer, just use the applyForce or applyCentralForce. For continuous force application, you could calculate the dt, or you could just set the applyForceImpulse of the rigid body.

I'm not a guru of bullet, but AFAIK, that's what a lot of people do.

*edited*