hi
i have two questions:
1. is it possible and how to correctly implement a slow motion simulation ?
2. the same about frame by frame simulation - simulating scene one frame forward after hitting a key for example
TIA
slow motion
-
- Posts: 172
- Joined: Sat Sep 24, 2011 7:31 am
Re: slow motion
I'd imagine just calling Space.Update() once when that key is pressed would work just fine.quaikohc wrote: 2. the same about frame by frame simulation - simulating scene one frame forward after hitting a key for example
As for the first, if I had to try something I'd try lowering the value passed into Space.Update().
Re: slow motion
That's one way to do it, though it relies on internal time stepping and using the interpolation buffers for smooth motion. Each individual timestep (A Space.Update(dt) call can have 0 to many timesteps in it, depending on dt) will still cover whatever is in the Space.TimeStepSettings.TimeStepDuration.if I had to try something I'd try lowering the value passed into Space.Update().1. is it possible and how to correctly implement a slow motion simulation?
Changing the Space.TimeStepSettings.TimeStepDuration is the other main way. It defaults to 1/60f. If you change it to 1/120f, time will progress at 1/2 the normal rate assuming you do the same number of time steps. If you're using internal time stepping (calling Space.Update(dt) rather than Space.Update()), watch out- it will try to simulate the passed in time using more time steps.
Also note that changing the time step duration constantly can harm simulation stability. Occasionally changing it to slow mo and back shouldn't cause a big problem, but keep it in mind.
Yup. The parameterless Space.Update() performs one time step.I'd imagine just calling Space.Update() once when that key is pressed would work just fine.2. the same about frame by frame simulation - simulating scene one frame forward after hitting a key for example