NullReferenceException from InternalNode.TryToInsert()
Posted: Fri Dec 30, 2016 1:34 am
Every so often, randomly with various objects, I get a NullReferenceException from BEPUphysics.BroadPhaseSystems.Hierarchies.InternalNode.TryToInsert(). Happens with code as simple as below:
This is not the only object that gives the error. Happens randomly with pretty much any object every so often.
System.NullReferenceException: Object reference not set to an instance of an object.
at BEPUphysics.BroadPhaseSystems.Hierarchies.InternalNode.TryToInsert(LeafNode node, Node& treeNode) in D:\Documents\Visual Studio 2015\Projects\TankFootballServer\TankFootballServer\BEPUphysics\BroadPhaseSystems\Hierarchies\DynamicHierarchyNode.cs:line 199
at BEPUphysics.BroadPhaseSystems.Hierarchies.DynamicHierarchy.Add(BroadPhaseEntry entry) in D:\Documents\Visual Studio 2015\Projects\TankFootballServer\TankFootballServer\BEPUphysics\BroadPhaseSystems\Hierarchies\DynamicHierarchy.cs:line 251
at BEPUphysics.Space.Add(ISpaceObject spaceObject) in D:\Documents\Visual Studio 2015\Projects\TankFootballServer\TankFootballServer\BEPUphysics\Space.cs:line 282
Code: Select all
Entity Football = new Capsule(new Vector3(0, Offset, 0), 0.095f, 0.026f, 1);
Football.CollisionInformation.CollisionRules.Group = Group;
Football.Gravity = new Vector3(0, -9.81f, 0);
space.Add(Football);
System.NullReferenceException: Object reference not set to an instance of an object.
at BEPUphysics.BroadPhaseSystems.Hierarchies.InternalNode.TryToInsert(LeafNode node, Node& treeNode) in D:\Documents\Visual Studio 2015\Projects\TankFootballServer\TankFootballServer\BEPUphysics\BroadPhaseSystems\Hierarchies\DynamicHierarchyNode.cs:line 199
at BEPUphysics.BroadPhaseSystems.Hierarchies.DynamicHierarchy.Add(BroadPhaseEntry entry) in D:\Documents\Visual Studio 2015\Projects\TankFootballServer\TankFootballServer\BEPUphysics\BroadPhaseSystems\Hierarchies\DynamicHierarchy.cs:line 251
at BEPUphysics.Space.Add(ISpaceObject spaceObject) in D:\Documents\Visual Studio 2015\Projects\TankFootballServer\TankFootballServer\BEPUphysics\Space.cs:line 282