how to perform a 'bullet time fx'

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
coimbra79
Posts: 33
Joined: Thu Dec 29, 2011 12:42 am

how to perform a 'bullet time fx'

Post by coimbra79 »

hi!
i need to perform a bullet time effect , for major accuracy in some hard action, to semplify some level in my app.
i'm tried decreasing the time step duration, but the physics is altered causing an undesirable effect...
wath the way?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: how to perform a 'bullet time fx'

Post by Norbo »

If you are using Space.Update(dt), scale dt by the desired slowdown. That is, if you want to run at 10% speed, multiply dt by 0.1f. This works because Space.Update(dt) takes however many steps of length Space.TimeStepSettings.TimeStepDuration are necessary to reach the accumulated time. By passing in less time, less time accumulates and less time steps run. However, this does not change the simulation accuracy at all.

If you find additional accuracy is required, decrease the Space.TimeStepSettings.TimeStepDuration. So, if you want to run at 10% speed, use Space.Update(dt * 0.1f) as before, and also set the Space.TimeStepSettings.TimeStepDuration = normalTimeStep * 0.1f. ('normalTimeStep' would be equal to 1/60f by default.)

If you are using Space.Update() without parameters, each Update call performs one time step. So, shrinking Space.TimeStepSettings.TimeStepDuration by the factor would do the trick.

Beware that constantly changing the time step duration can make the simulation harder to handle for the engine. Doing it once every once in a while shouldn't be a problem though.
coimbra79
Posts: 33
Joined: Thu Dec 29, 2011 12:42 am

Re: how to perform a 'bullet time fx'

Post by coimbra79 »

clack!
NICE NORBO!
so to perform a real 'bullet time fx' i have to decrease timestepduration & the td parameter when update the space...
Work too coolly!
tank!
Post Reply