CcdPhysicsDemo, bug or feature ?

GilsonLaurent
Posts: 8
Joined: Wed Oct 31, 2007 2:59 pm

CcdPhysicsDemo, bug or feature ?

Post by GilsonLaurent »

Hello,

i noticed something strange in the CcdPhysicsDemo. The wall of tubes does not react directly to the box you can shoot with ".". The tubes start moving after the front side of the box has reached well into the middle of the tubes (checked with single-step mode with shootingspeed 40 and 20 in 2.63 and 2.66. It takes 5-7 steps from visual intersecting to reacting). They intersect by ~0.25 and the box reaches the center before anything happens.

On the other hand tubes lying on the ground look normal.

Why ?

- Are the objects a sleeping state and the wakeup takes so long ?
- Does the single-step mode forget about the collision detecting ?
- Are the tubes "glued" together ?

i'm using Linux, gcc and netbeans if that matters.

Thanks.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: CcdPhysicsDemo, bug or feature ?

Post by Erwin Coumans »

Single-stepping mode uses additional interpolation steps, not simulated. So those 5-7 steps are probably all pure graphical interpolation.

Can you enable the 'FIXED_STEP' in CcdPhysicsDemo.cpp and see if that helps?

//#define FIXED_STEP 1
#ifdef FIXED_STEP
m_dynamicsWorld->stepSimulation(1.0f/60.f,0);

This should be documented, and fixed_step (and interpolation step) should probably be exposed in the user-inferface.
Thanks for the feedback,
Erwin
GilsonLaurent
Posts: 8
Joined: Wed Oct 31, 2007 2:59 pm

Re: CcdPhysicsDemo, bug or feature ?

Post by GilsonLaurent »

Ah, now it makes sense. Thanks a lot, the FIXED_STEP makes the effect go away.