Slipping under a triangle

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Shevy
Posts: 8
Joined: Sat Feb 05, 2011 6:56 am

Slipping under a triangle

Post by Shevy »

So I am running into a problem where I am slipping past a triangle and just sitting there.

This is a character controller which was built off of your simpleCharacterController.
To paint a picture with words if I fall fast enough I will lodge a small part of my capsule underneath the triangle.
Also if you come at a hard edge head on you can slip inbetween that triangle at the same length as falling down fast enough.
A 90 degree angle works the best and with some agile fingers it is quite possible to repeat over and over again.

The capsule positionUpdate is set to continous and the staticMesh sideness is switched to counterclockwise as well as its improved boundary behavior set to true.

So I have run out of variables to change in your engine and have even tried the newest fork build hoping something may have been fixed but no luck.

Any help would be wonderful, before I start casting rays and hacking my way to random results :P

()__ <- this simple ascii drawing shows what I feel when I come at a hard edge, almost as though there is a small opening because there is literally no resistance when done perfectly.
. |
Shevy
Posts: 8
Joined: Sat Feb 05, 2011 6:56 am

Re: Slipping under a triangle

Post by Shevy »

Never mind after stepping back away from the code for a couple of hours I figured it out. The problem was the rayOrigin for the collisionPairCollector was just too perfect or a little over the players feet, aka the capsule's bottom, so it caused a rare case to happen when you collide with a horizontal platform head on with the ray under the triangle or on and the capsule over the triangle causing the the ray to never hit the triangle, so by the codes logic you can not stand despite the capsule hanging over the triangle.
So i just pulled it a tad bit up into the body which took out the chance of the ray ever going under a triangle because of it being stuck in the capsule a bit more.
Post Reply