Small issue with Kinematic CompoundBody ctor
Posted: Wed May 01, 2013 7:22 pm
I was providing a list of zero mass shapes to a CompoundBody ctor and the ComputeCenter failed validation because of the zero mass total of all shapes caused a divide by zero. Note that I am using the CompoundBody ctor that doesn't take mass, which the XML docs say is the way to create a kinematic CompoundBody.
I worked around it by providing dummy weights for each CompoundShapeEntry in the bodies list but I just thought I should point this out since it doesn't seem to be intended behavior. Then again, I could just be using it wrong. Anyway, it seemed worth mentioning.
Thanks
Code: Select all
SMW.exe!BEPUphysics.MathExtensions.MathChecker.Validate(Microsoft.Xna.Framework.Vector3 v) Line 47 C#
SMW.exe!BEPUphysics.CollisionShapes.CompoundShape.ComputeCenter(System.Collections.Generic.IList<BEPUphysics.CollisionShapes.CompoundShapeEntry> childData) Line 271 + 0x17 bytes C#
SMW.exe!BEPUphysics.CollisionShapes.CompoundShape.CompoundShape(System.Collections.Generic.IList<BEPUphysics.CollisionShapes.CompoundShapeEntry> shapes, out Microsoft.Xna.Framework.Vector3 center) Line 171 + 0x11 bytes C#
> SMW.exe!BEPUphysics.Entities.Prefabs.CompoundBody.CompoundBody(System.Collections.Generic.IList<BEPUphysics.CollisionShapes.CompoundShapeEntry> bodies) Line 37 + 0x1c bytes C#
Thanks