Forces

gugus

23-06-2008 17:38:46

How are forces computed with TimeStep?

Does it just does something like
F=ma
v=a.TimeStep+Oldv

Or does it do something more complicated?

If I apply a force every loop,must I include Time in the strength of my force in order to have the same results with differents computers?(I am using ogre as time-controller,so there is no fixed time step).

betajaen

23-06-2008 18:17:06

No there are various NxForceModes which you can use.

gugus

23-06-2008 20:06:02

Thanks!So if i understand well,i should put this:
addForce(vector*t,NX_FORCE)
or
addForce(vector,NX_IMPULSE)
in order to get the same result with 2 computers running at different speed. Am I right?

Edit:the first one seems wrong to me,as t is the time from the loop.

fatpwnage

24-06-2008 14:24:37

The physics engine is designed so that the simulation will run at the same speed on any machine, regardless of framerate.

If you want to apply a force every frame, you should use NX_SMOOTH_IMPULSE (see below).

Paraphrase of the PhysX docs:

NX_FORCE has units of mass * distance / time^2
NX_IMPULSE has units of mass * distance / time
NX_VELOCITY_CHANGE has units of distance / time (so this effect is mass independent)
NX_SMOOTH_IMPULSE is a NX_IMPULSE but has the effect applied over all substeps. This is to be used for motion controllers that repeatedly apply an impulse.
NX_SMOOTH_VELOCITY_CHANGE is the same as NX_VELOCITY_CHANGE but the effect is applied over all substeps.
NX_ACCELERATION has units of distance / time^2, ie acceleration.

gugus

02-07-2008 17:44:55

What exactly is substep? I have a general idea of what it is,but i don't know precisely.