planeConstant

Post Reply
Cosmo
Posts: 1
Joined: Sat Apr 27, 2019 3:29 pm

planeConstant

Post by Cosmo »

Hi,
I'm learning and experimenting with Bullet. Particulary, I'm trying to integrete it into the render engine I'm using.
For learning purpose, I create a very basic scene with a ball falling down into the floor.
My question is: what kind of information is rapresented by planeConstant parameter of btStaticPlaneShape?
If I set up its value to 4 or 5, my sphere seems to collides and stops in a right manner, without any compenetration with the floor.
Otherwise (value of planeConstant==1) the sphere goes into the ground a little bit, before it stops.
Could someone explain me the reason of that strange behavior?
Thanks in advance, kind regards

Cosmo
anthrax11
Posts: 72
Joined: Wed Feb 24, 2010 9:49 pm

Re: planeConstant

Post by anthrax11 »

The plane normal represents the angle at which the plane lies.
The plane constant lets you move the plane along the plane normal.
The magnitude of the plane normal does not affect anything about the plane, only the direction is considered.

Assuming your coordinate system is Y-up, if you set planeNormal=(0,1,0) and planeConstant=4, you get an xz-plane that is raised by 4 units along the y-axis. If any other object gets to y<4, then that object is pushed upward by the plane object.

A btBoxShape seems to work better as a floor shape, because it resists penetration more. I think it's because the plane shape internally uses two very large triangles and then the ratio between the sizes of the colliding triangles is very large, which doesn't work well in general. I don't know for sure, though. Under btStaticPlaneShape, the user manual says that "This shape has been introduced mainly for demo purposes," so maybe it's better to avoid that shape.
Post Reply