NaN on Collisions

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
jsuffolk
Posts: 6
Joined: Fri Dec 02, 2011 4:54 am

NaN on Collisions

Post by jsuffolk »

Relatively new to BEPUphysics, trying to replace our game's homegrown physics engine with one that's a bit more robust. Everything works great until a collision; immediately after a collision all vectors (position, velocity) of the entity become NaN. I'm just using simple spherical entities with set finite mass, position, velocity, angular damping, using BEPUphysics 1.0.

Am I missing something? what could cause this?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: NaN on Collisions

Post by Norbo »

Could you reproduce the issue in a BEPUphysicsDemo for me to look at, or if the setup is small enough, post up the relevant code?

Off the top of my head, here's a few possibilities:
1) While the values for various entity properties/dimensions are finite, they are extremely large. If the object is a million units away from the origin, or thousands of units across, something may be having trouble. These type of failures are typically fairly 'random' in that they appear at different times, though they generally are quite reproducible.

2) Some external changes are setting the position, orientation, linear or angular velocity, or linear or angular momentum to invalid values. A common cause is unprotected normalizations.

3) If there's a mesh, it's possible that a degenerate triangle could cause a problem. As far as I'm aware, the collision system should be able to gracefully handle completely degenerate triangles without crashing, but there's always a chance I missed something.
Post Reply