Here is one of the many stack traces I get (sometimes it's ForceUpdater)
Code: Select all
System.NotFiniteNumberException was unhandled
HResult=-2146233048
Message=Invalid value.
Source=BEPUphysics
OffendingNumber=0.0
StackTrace:
at BEPUphysics.MathExtensions.MathChecker.Validate(Vector3 v)
at BEPUphysics.Entities.Entity.ApplyLinearImpulse(Vector3& impulse)
at BEPUphysics.Constraints.Collision.ContactPenetrationConstraint.ExclusiveUpdate()
at BEPUphysics.Constraints.SolverGroups.SolverGroup.ExclusiveUpdateUpdateable(EntitySolverUpdateable item)
at BEPUphysics.Constraints.Collision.NonConvexContactManifoldConstraint.ExclusiveUpdate()
at BEPUphysics.SolverSystems.Solver.UnsafePrestep(SolverUpdateable updateable)
at BEPUphysics.SolverSystems.Solver.UpdateSingleThreaded()
at BEPUphysics.MultithreadedProcessingStage.Update()
at BEPUphysics.Space.DoTimeStep()
at BEPUphysics.Space.Update(Single dt)
Poorly generated terrain mesh? Objects with low mass? Objects with high mass? Objects that are too fast? Objects that are too fast and that have low mass?
I suspect it could be the terrain, since my terrain mesh can be considered "complex":

As you can see, the game is basically like minecraft except surface blocks can have a heightmap of sorts to allow smooth terrain.
Blocks that do not have heightmaps are traditional in the sense that each of their faces has two triangles.
The render artifact from the debug drawer in that image also worries me a bit.
Heightmapped blocks have a more complex triangle construction:

I was able to catch one of these NaN errors:

The circled boxes were floating in mid-air, presumably because they had NaN values.
For some reason, once the other boxes disappeared (I had them disappear after 10 seconds), the NaN values would "revert" to real values and the last box would start moving again.
Strange...any ideas?