BulletSim: change nonimal physics frame rate to 55 to give same numbers as ODE.

Change character scaling to represent size of capsule (diameter rather than radius)
Modify create capsule call to pass radius and height.
Eliminate errors when calculating shape inertia (should have some type checking).
This commit is contained in:
Robert Adams
2012-10-17 08:30:10 -07:00
parent fc33afddd3
commit e87a179c89
6 changed files with 57 additions and 52 deletions

View File

@@ -417,7 +417,10 @@ public class BSShapeCollection : IDisposable
if (shapeType == ShapeData.PhysicsShapeType.SHAPE_AVATAR)
{
newShape = new BulletShape(BulletSimAPI.BuildCapsuleShape2(PhysicsScene.World.ptr, shapeData), shapeType);
// The radius is scaled by 1/2 because we scale by the diameter.
newShape = new BulletShape(
BulletSimAPI.BuildCapsuleShape2(PhysicsScene.World.ptr, 0.5f, 1.0f, shapeData.Scale),
shapeType);
newShape.shapeKey = (System.UInt64)shapeKey;
newShape.isNativeShape = true;
}
@@ -428,7 +431,7 @@ public class BSShapeCollection : IDisposable
newShape.isNativeShape = true;
}
// Don't need to do a 'ReferenceShape()' here because native shapes are not tracked.
// Don't need to do a 'ReferenceShape()' here because native shapes are not shared.
// DetailLog("{0},BSShapeCollection.AddNativeShapeToPrim,create,newshape={1}", shapeData.ID, newShape);
prim.BSShape = newShape;