Is this a Bug In CCDPhysicsDemo?

michaelth
Posts: 21
Joined: Mon Oct 22, 2007 12:47 pm

Is this a Bug In CCDPhysicsDemo?

Post by michaelth »

I change some code in CCDPhysicsDemo just as follows.And I romove other RigidBodys in the previous CCDPhysicsDemo.So there just 2 Sphere RigidBodies as follows in the DynamicWorld.
////////////////////
btTransform trans;
trans.setIdentity();
trans.setOrigin(btVector3(0,-30,0));
btRigidBody* Body1=localCreateRigidBody(10.f,trans,shapePtr[1]);
Body1->setLinearVelocity(btVector3(0,20.0f,0));

trans.setIdentity();
trans.setOrigin(btVector3(0,30,0));
btRigidBody* Body2=localCreateRigidBody(10.f,trans,shapePtr[1]);
Body2->setLinearVelocity(btVector3(0,-20.0f,0));
/////////////
And The 2 balls just Stop when they have collision.But If I set the 2 Bodies's Velocity to 10,-10.
Body1->setLinearVelocity(btVector3(0,10.0f,0));
Body1->setLinearVelocity(btVector3(0,-10.0f,0));
And The 2 balls are away after they have collision.
So Why?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Is this a Bug In CCDPhysicsDemo?

Post by Erwin Coumans »

I assume you also set the gravity to zero?

The balls just bounce off fine in my test here. Which version of Bullet do you use?
Thanks,
Erwin