Havok physics speed goes x2 if a second engine exists

This is a combination of multiple things leading to edge cases and not bugs.
I may have missed subtilities but the core of the explanation should be the same.

Physics tick update is done in render method.
Render is called 2 times: in default PG runRenderLoop call plus in the PG itself.

Removing the 2nd runRenderLoop call leads to way slower tick update. This happens because no renderloop is being use with the engine. its delta time is 0 and this clamp will set it to 1ms instead:

So, to sum up: 2 scene.render calls on the same scene = twice as fast. no renderloop on an engine = update with a delta time of 1ms

There is a 3rd way:

2 engines, 1 render loop. delta time is clamped at 1ms but engine is instanciated with flag to not use delta time but use fixed delta (with a default of 1/60)

This behavior is expected.

1 Like