Physics .setSpeed(float var)

Hey there,

I am trying to see if it is possible to speed up a physics simulation in JME. I have been playing around with BulletAppState.setSpeed(float var) to try and speed up the simulation, but I am having a hard time with it. It seems to speed up the simulation slightly and in a weird way making me think that it is not really doing what I hope it would. The API does not specify the limits of the argument for this method either so I don’t know what number to put in. It also does not explain what this method is really for.

Basically my end goal is to be able to run any physics simulation faster by several factors.

Is it possible to speed up a physics simulation? If so, how would I achieve this? Thanks in advance!

Based on the source code it seems it does exactly what it says on the tin, it speeds up time. (Kind of like a fast forward button on your VCR)

another way would be to just multiply the tpf argument it gets, just remember to increase the maxsubsteps accordingly.

You have to consider maxSubSteps and the actual speed at which your update loop runs. Otherwise as said, it does what it says on the box.

Multiplying the TPF argument is exactly what the “speed” property does.