Advertisement

Bullet Physics - A wierd error with just 2 static planes and a box : complete code included

Started by May 17, 2012 05:05 AM
1 comment, last by AgentC 12 years, 9 months ago
Long story short, I have 2 static planes. One at (0,0,0) and another at (0, 500, 0). I instantiate a btRayCastVehicle at (0, 10, 0), so above the lower plane. There is no other force or body in the world. The vehicle shoots straight up and keeps on going !! There is absolutely no reason for this to happen.

Reproduction code included.



If I replace the planes with btBoxShape, then this doesnt happen. But I want to use 2 planes above each other and parallel to each other.

If I place the planes closer to each other, say 50 units, then the vehicle (or in fact any other box), shoots up slower, but shoots up nevertheless. I cant understand how the position of 2 static planes can affect the position of a dynamic rigid body like a box when there are no other forces in the world at all, and no intervention from the user.
Perhaps a silly question, the planes aren't intersecting your [color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[background=rgb(250, 251, 252)]btRayCastVehicle? Perhaps it could be collision checking gone awry.[/background]

[/font]

Advertisement
Both planes have their normal pointing upward, so Bullet may think the vehicle is "inside" (= on its negative side) of the ceiling plane, and is trying to push it out. I haven't actually used Bullet planes myself so I'm not sure if they're assumed to have an infinite "volume" on the negative side, but try pointing the ceiling plane's normal down instead.

This topic is closed to new replies.

Advertisement