I'm using btDiscreteDynamicsWorld, and calls stepSimulation every update.
The timeStep is less than 1/60 but it will be bigger as I bulid more object.
I know that it may loses time if time step is bigger than fixed time step, So I gave maxSubStep parameter as 2,
Code: Select all
stepSimulation(timeStep, 2)
I'm also simulating physics world in server side too. In this case, I manually set duration of physics update to 1/60.
So timeStep in stepSimulation is bigger than 1/60.
These two simulation has to be same, so I can synchronize positions of players.
But I'm afraid these may simulating different speed, and gives different result.
Do I something wrong about it? Should I change something?
By the way, Client and server are updating vehicle component based on timeSteps.
[edit]
I need to sync these two simulation, so if these two are not different, how to get same position of vehicle from both dynamic world.
I've tried, motionState->getWorldTransform, rigidbody->getWorldTransform, rigidbody->getInterpolationWorldTransform.. but it doesn't match.
I'm using btDefaultMotionState class.