Hi all,
This seems to have been spoken of here:
But it still seems to be an issue for me, whenever I use the do_physics method from the python side, there’s a considerable drop in frame rate. I’m using the Panda3D version 1.10.15
Here is what I do on the C++ side:
PUBLISHED:
void start_physics() {
bullet_task = new GenericAsyncTask("cpp_bullet_task", &do_world_physics, physics_world);
AsyncTaskManager::get_global_ptr()->add(bullet_task );
}
private:
static AsyncTask::DoneStatus do_world_physics(GenericAsyncTask *task, void *data) {
BulletWorld *bw= (BulletWorld *)data;
ClockObject *co = ClockObject::get_global_clock();
bw->do_physics(co->get_dt(), 10, 1.0 / 180.0);
return AsyncTask::DS_cont;
}
private:
PT(GenericAsyncTask) bullet_task ;
Or just:
BLOCKING void do_phys_stuff()
{
ClockObject *co = ClockObject::get_global_clock();
physics_world->do_physics(co->get_dt(), 10, 1.0 / 180.0);
}
And on the python side:
cpp_object.start_physics()
Or:
taskMgr.add(self.updatePhysiWrldTst, 'updatePhysiWrldTstNom')
...
def updatePhysiWrldTst(self,task):
cpp_object.do_phys_stuff()
return task.cont
I could just simulate things from the python side, but if the c++ side is considerably faster, then it would be great if this seemingly persistent issue is resolved. Am I doing something wrong?
Thanks in advance.