diff --git a/panda/src/bullet/bulletCharacterControllerNode.cxx b/panda/src/bullet/bulletCharacterControllerNode.cxx index c42977c32e..523889a7cc 100644 --- a/panda/src/bullet/bulletCharacterControllerNode.cxx +++ b/panda/src/bullet/bulletCharacterControllerNode.cxx @@ -229,6 +229,7 @@ sync_p2b(float dt) { //_character->setVelocityForTimeInterval(v, dt); _character->setWalkDirection(v * dt); + //_character->setWalkDirection(v); _angular_velocity = 0.0f; } diff --git a/panda/src/bullet/bulletWorld.cxx b/panda/src/bullet/bulletWorld.cxx index 0bccb85a61..b75b53d8dc 100644 --- a/panda/src/bullet/bulletWorld.cxx +++ b/panda/src/bullet/bulletWorld.cxx @@ -148,9 +148,17 @@ do_physics(float dt, int substeps, float stepsize) { // Simulation _pstat_simulation.start(); - _world->stepSimulation(dt, substeps, stepsize); + int n = _world->stepSimulation(dt, substeps, stepsize); _pstat_simulation.stop(); + if (!n) { + bullet_cat.warning() << "interpolated transforms!" << endl; + } + + //if (dt > substeps * stepsize) { + // bullet_cat.warning() << "lost simulation time!" << endl; + //} + // Synchronize Bullet to Panda _pstat_b2p.start(); sync_b2p(); diff --git a/panda/src/bullet/bulletWorld.h b/panda/src/bullet/bulletWorld.h index 19d3140bd9..7c69efa764 100644 --- a/panda/src/bullet/bulletWorld.h +++ b/panda/src/bullet/bulletWorld.h @@ -56,7 +56,7 @@ PUBLISHED: void set_gravity(float gx, float gy, float gz); const LVector3f get_gravity() const; - void do_physics(float dt, int substeps=10, float stepsize=1.0f/60.0f); + void do_physics(float dt, int substeps=1, float stepsize=1.0f/60.0f); void set_debug_node(BulletDebugNode *node); void clear_debug_node();