Hi everyone,
I am just getting started with Bullet and wondering if the results I am getting are as expected.
I built a small example with a static plane and a cube:
It seems to me that the cube should not bounce and rotate quite so much?
Implementation details:
Restitution is 0 for all bodies, timestep is 1/120s, cube has an edge length of 0.2 and 0.1 weight, gravity is -1.
I am using bullet 2.87, wrapped using BulletSharpPInvoke (but I don't think that should make a difference).
The results get more stable with a smaller timestep, but I would expect 120 Hz should be plenty for such a simple setup?
Is this normal and what can I do to improve the simulation, aside from decreasing the timestep?
Thank you very much,
Bart
Strong bounce on collision, is this expected?
-
- Posts: 2
- Joined: Mon Feb 05, 2018 12:58 pm
-
- Posts: 2
- Joined: Mon Feb 05, 2018 12:58 pm
Re: Strong bounce on collision, is this expected?
To make sure I wasn't doing anything weird, I replicated the Hello World example and plotted the output.
This is the path using a sphere collider:
This is the same simulation using a cube collider:
Is it really normal that the cube has so much more bounce?
This is the path using a sphere collider:
This is the same simulation using a cube collider:
Is it really normal that the cube has so much more bounce?
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Strong bounce on collision, is this expected?
For a static plane, only a single contact is added for each simulation step (by default) causing a small amount of rotation and penetration. We don't have specialized plane versus cube and plane versus convex etc. For cube versus plane it would be trivial to add of course, but you would still have the same issue for other convex shapes (convex hull, cylinder, capsule etc). You can also use a thin cube as ground plane (don't make it too thin though).
One way to improve the behavior is to try to compute multiple contact point for each step, as long as the number of current contacts is below the minimumPointsPerturbationThreshold (equal or above will have no effect).
Similar for convex versus convex, there is this method:
One way to improve the behavior is to try to compute multiple contact point for each step, as long as the number of current contacts is below the minimumPointsPerturbationThreshold (equal or above will have no effect).
Code: Select all
int numPerturbationIterations=3
int minimumPointsPerturbationThreshold = 3;
collisionConfiguration->setPlaneConvexMultipointIterations(numPerturbationIterations, int minimumPointsPerturbationThreshold);
Code: Select all
collisionConfiguration->setConvexConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);