bullet3
bullet3 copied to clipboard
Restitution not working for btConvexHullShape for small timesteps it does work for btBoxShape
Hi,
I have an issue with restitution for btConvexHullShape for small timesteps.
I modified the BasicDemo to show my problem. You can find the changed code here: https://github.com/bbird5490/bullet3
Basically I:
- changed the timestep in examples/CommonInterfaces/CommonRigidBodyBase.h to:
m_dynamicsWorld->stepSimulation(0.002, 10, 0.0002);
- replaced the btBoxShape by a ConvexHullShape that has the same shape and dimensions in
// btBoxShape* colShape = createBoxShape(btVector3(.1, .1, .1));
btConvexHullShape* colShape = new btConvexHullShape();
colShape->addPoint(btVector3(-.1, -.1, -.1));
colShape->addPoint(btVector3(-.1, -.1, .1));
colShape->addPoint(btVector3(-.1, .1, -.1));
colShape->addPoint(btVector3(-.1, .1, .1));
colShape->addPoint(btVector3( .1, -.1, -.1));
colShape->addPoint(btVector3( .1, -.1, .1));
colShape->addPoint(btVector3( .1, .1, -.1));
colShape->addPoint(btVector3( .1, .1, .1));
- added restitution values for the ground and the convex hull using
setRestitution
If you run the basic demo you will see that the convex hull does not bounce, while if you switch back to the BoxShape, it does bounce.
Also if you go back to the standard timestep the convex hull bounces too.
Am I doing something wrong?
Many thanks!