Warning if elapsed time < stepsize (no simulation but interpolation!)

This commit is contained in:
enn0x 2011-09-11 20:37:58 +00:00
parent 6da6402397
commit 540f7f2150
3 changed files with 11 additions and 2 deletions

View File

@ -229,6 +229,7 @@ sync_p2b(float dt) {
//_character->setVelocityForTimeInterval(v, dt);
_character->setWalkDirection(v * dt);
//_character->setWalkDirection(v);
_angular_velocity = 0.0f;
}

View File

@ -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();

View File

@ -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();