I'm trying to get familiar enough with JigLibX to plug it into my existing game, currently using Fabio Policarpo's box collider with no physics.
For learning purposes, I have a bee with a collision skin with a single sphere primitive flying around inside a triangle mesh skin made from a low-poly version of my environment. The environment is a series of connected rooms. I control the bee's translation with a single controller using body impulse. I wasn't able to get close enough rotation control using a controller so I set the bee body's orientation directly. From user input, I create a rotation vector, use that to create a quaternion and then a a rotation matrix for the amount the rotation needs to change. I multiply my stored current rotation by the new matrix and set the bee body's rotation to the result.
I let the physics system do collision detection and response. I'm using CollisionSystemSAP (but get the same results with the brute system).
Here's what happens: The bee is hovering in the middle of a room. The player pushes the control to move forward and down. The bee moves forward and down to the floor; when it hits the floor it stops downward motion (even though the down control is still pressed) but continues forward. This is perfect—just right. But when it hits the wall while still touching the floor with the controls unchanged, collision detection fails. The bee sinks through the floor. The same problem occurs if the bee first flies into the wall and then down to the floor. It goes right through. As soon as the bee collision skin makes a second (or more, in an inside corner) contact with the triangle mesh skin, collisions no longer work right.
I've tried to chase down what is causing this but have struck out so far. From my rudimentary understanding it seems that the collision system does take multiple contacts like these into account. Still, it's not working for me.
Can someone suggest a cause or solution? Or point me to where I can look for the problem? Thanks in advance for any help.