public static BulletShape CreatePhysicalNativeShape(BSScene physicsScene, BSPhysObject prim,
            BSPhysicsShapeType shapeType, FixedShapeKey shapeKey)
        {
            BulletShape newShape;

            ShapeData nativeShapeData = new ShapeData();
            nativeShapeData.Type = shapeType;
            nativeShapeData.ID = prim.LocalID;
            nativeShapeData.Scale = prim.Scale;
            nativeShapeData.Size = prim.Scale;
            nativeShapeData.MeshKey = (ulong)shapeKey;
            nativeShapeData.HullKey = (ulong)shapeKey;

            if (shapeType == BSPhysicsShapeType.SHAPE_CAPSULE)
            {
                newShape = physicsScene.PE.BuildCapsuleShape(physicsScene.World, 1f, 1f, prim.Scale);
                physicsScene.DetailLog("{0},BSShapeNative,capsule,scale={1}", prim.LocalID, prim.Scale);
            }
            else
            {
                newShape = physicsScene.PE.BuildNativeShape(physicsScene.World, nativeShapeData);
            }
            if (!newShape.HasPhysicalShape)
            {
                physicsScene.Logger.ErrorFormat("{0} BuildPhysicalNativeShape failed. ID={1}, shape={2}",
                    LogHeader, prim.LocalID, shapeType);
            }
            newShape.shapeType = shapeType;
            newShape.isNativeShape = true;
            newShape.shapeKey = (UInt64) shapeKey;
            return newShape;
        }
 public override BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData)
 {
     BulletWorldUnman worldu = world as BulletWorldUnman;
     return new BulletShapeUnman(BSAPICPP.BuildNativeShape2(worldu.ptr, shapeData), shapeData.Type);
 }
Example #3
0
 public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData);
 public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData);