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?
Is this a Bug In CCDPhysicsDemo?
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Is this a Bug In CCDPhysicsDemo?
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
The balls just bounce off fine in my test here. Which version of Bullet do you use?
Thanks,
Erwin