I'm trying to create a curve conveyor which is used for convey the box.
I adopt btConvexHullShape class to make the collision shape of conveyor suface.
but it has one problem: the Box will shake when it drop onto the suface.
It needs to be emphasized that the bottom of the box and the surface of the conveyor are parallel to the horizontal plane.
I think there are something wrong with btBoxShape collide with btConvexHullShape.
So, I make a example to show these wrong.
The result like the following GIF:
The following is my code to create a triangular prism with btConvexHullShape class:
Code: Select all
btConvexHullShape* hull = new btConvexHullShape();
const btVector3 v1 = btVector3(0, 0, 2);
hull->addPoint(v1);
const btVector3 v2 = btVector3(0, 0.1, 2);
hull->addPoint(v2);
const btVector3 v3 = btVector3(0, 0, -2);
hull->addPoint(v3);
const btVector3 v4 = btVector3(0, 0.1, -2);
hull->addPoint(v4);
const btVector3 v5 = btVector3(-5, 0.1f, 0);
hull->addPoint(v5);
const btVector3 v6 = btVector3(-5, 0, 0);
hull->addPoint(v6);
hull->optimizeConvexHull();
hull->setMargin(0);
btTransform t;
t.setIdentity();
btRigidBody* hullBody = createRigidBody(0, t, hull);
Is there any other way without this error to make the custom collision shape, such as sector surface and hollow cylinder?
Thanks!