I am trying to implement the bullet physics in my own rendering engine.
In my rendering engine in every loop firstly i am calling a physicsupdate function then a render function.
Now in physics update function i am calling stepsimulation bullet function with following parameters--
Code: Select all
m_dynamicsWorld->stepSimulation(et, maxsubsteps, internal_rate);
i am also using the internaltickcallback function as given below
Code: Select all
static void tick_callback(btDynamicsWorld * w, btScalar ts)
{
cout<<"I AM IN TICK CALLBACK"<<endl;
}
Code: Select all
Render()
{
cout<<"RENDERING";
}
Code: Select all
RENDERING
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
RENDERING
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
RENDERING
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
I AM IN TICK CALLBACK
RENDERING
I AM IN TICK CALLBACK
...
What does this mean, the step simulation is calling tickcallback when it computes its physics step.
it means in a single rendering call the physics simulation is called many times.
if this is the case then how can i make the physics step calls according to my frames per seconds of the rendering engine?