mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Warning if elapsed time < stepsize (no simulation but interpolation!)
This commit is contained in:
parent
6da6402397
commit
540f7f2150
@ -229,6 +229,7 @@ sync_p2b(float dt) {
|
|||||||
|
|
||||||
//_character->setVelocityForTimeInterval(v, dt);
|
//_character->setVelocityForTimeInterval(v, dt);
|
||||||
_character->setWalkDirection(v * dt);
|
_character->setWalkDirection(v * dt);
|
||||||
|
//_character->setWalkDirection(v);
|
||||||
_angular_velocity = 0.0f;
|
_angular_velocity = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,9 +148,17 @@ do_physics(float dt, int substeps, float stepsize) {
|
|||||||
|
|
||||||
// Simulation
|
// Simulation
|
||||||
_pstat_simulation.start();
|
_pstat_simulation.start();
|
||||||
_world->stepSimulation(dt, substeps, stepsize);
|
int n = _world->stepSimulation(dt, substeps, stepsize);
|
||||||
_pstat_simulation.stop();
|
_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
|
// Synchronize Bullet to Panda
|
||||||
_pstat_b2p.start();
|
_pstat_b2p.start();
|
||||||
sync_b2p();
|
sync_b2p();
|
||||||
|
@ -56,7 +56,7 @@ PUBLISHED:
|
|||||||
void set_gravity(float gx, float gy, float gz);
|
void set_gravity(float gx, float gy, float gz);
|
||||||
const LVector3f get_gravity() const;
|
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 set_debug_node(BulletDebugNode *node);
|
||||||
void clear_debug_node();
|
void clear_debug_node();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user