Page 1 of 1

Collision Rules and Wheel Detectors

Posted: Mon Apr 11, 2011 1:18 am
by ckcornflake
I am trying to create a set of boxes where if the wheel of my airplane vehicles passes through a box, a new joint constraint is added. Currently the way I am trying to do it is setting up the collision rules of the detector of each wheel so that there is no response to the boxes, but contact points are generated. No when I debug the game, I see that the collision pair between the wheel and the boxes indeed have the collision rule of "NoReponse", however, my plane's flight path is interrupted and crashes when the wheels pass through these boxes. I am using version 14.3 and I'm not sure if this is a bug or not. Am I doing something wrong? Or is there a better way for doing what I want to do?


And just to be sure, I am checking all the collision pairs of the space, and the only collision pairs are between the wheels and the boxes, so the sub bodies and the plane itself are not the culprits for causing the plane to change course.

Re: Collision Rules and Wheel Detectors

Posted: Mon Apr 11, 2011 1:57 am
by Norbo
Are the collision rules being set at initialization, or are they being set by a collision event? A collision event may be triggered too late to stop a frame's worth of impulse.

If the collision rules are set up at initialization, and the pairs are NoResponse, then they really should not be influencing the simulation. You can check the collision pairs' contacts' penetration impulses to see if it is really is applying forces. If they are, something is wrong, though I don't know what at the moment.

If the contacts are not applying any force, then the culprit is elsewhere.

Using a more recent version might make debugging this easier for you, since it's open source and all (if the problem is still around) :)

Re: Collision Rules and Wheel Detectors

Posted: Tue Apr 12, 2011 12:53 am
by ckcornflake
Thanks for the help. I ended up deciding that I don't need to test detection at the wheels and used another entity that is a subbody of the airplane, which works just fine. I didn't get a chance to check the impulses, but if the situation arises again I'll definitely look a little deeper. Good point about upgrading to the open sourced version too :-) .

I have another question about wheels though. I've noticed that when my plane lands on a box entity, the wheels and suspension cause my plane to be very jittery and shaky. However, when my plane is on terrain, the shaking and bouncing goes away. I set bounciness and friction on the box to be the same as the terrain, but it doesn't get rid of the shakiness. Any ideas why this might be happening?

Re: Collision Rules and Wheel Detectors

Posted: Tue Apr 12, 2011 1:29 am
by Norbo
I have another question about wheels though. I've noticed that when my plane lands on a box entity, the wheels and suspension cause my plane to be very jittery and shaky. However, when my plane is on terrain, the shaking and bouncing goes away. I set bounciness and friction on the box to be the same as the terrain, but it doesn't get rid of the shakiness. Any ideas why this might be happening?
Under v0.14.3, if I remember correctly, the box raycast special case is not used. This means it will revert to using a GJK based cast, which is sensitive to numerical error and single precision floating point limits. Sufficiently large objects will hit numerical issues and behavior will suffer.

Triangles have a special case raycast, and the triangles are probably also individually smaller than the box is so even if they were using a GJK based method, it would still probably work fine.

In v0.15.0 and above, the box special cast raycast is enabled, so you shouldn't notice the problem anymore. However, it is recommended that you keep objects' dimensions within a safe range (0.5 to 10 units) even though common objects have special cases, since some collision pairs do not have such special cases. It's possible to safely leave the soft range, but the further you go, the more likely you are to see numerical issues.