I always used it like this:
Code: Select all
float t = App.DeltaTime;
zbtStepSimulation(t, 0, 0);
So I tried this, thinking it would be less demanding than what I used to do:@fn void zbtStepSimulation(
float timeStep, int maxSubSteps, float fixedTimeStep)
@brief Proceed the simulation over time step.
@details By default, the @a timeStep is subdivided in constant sub-steps of each
@a fixedTimeStep. In order to keep the simulation real-time, the maximum
number of sub-steps can be clamped to @a maxSubSteps. You can disable
subdividing the time step/sub-stepping by passing @a maxSubSteps=0, but in
that case you have to keep the timeStep constant.
@param timeStep duration of simulation step in seconds
@param maxSubSteps if > 0, it will interpolate motion between fixedTimeStep's
@param fixedTimeStep fixed time step
Code: Select all
// Define a fixed time step for substeps (e.g., 1/60th of a second)
float fixedTimeStep = 1.0f / 60.0f; // 60Hz
// Calculate the number of substeps needed
int maxSubSteps = (t / fixedTimeStep) + 1;
// Limit maxSubSteps to a reasonable number to avoid performance issues
if (maxSubSteps > 10) maxSubSteps = 10;
// Update the physics simulation
zbtStepSimulation(t, maxSubSteps, fixedTimeStep);
Is there something wrong with what I do, or maybe some technical issue on Android?