BulletSim: update DLLs and SOs to they have no dependencies on newer
glibc (2.14) since that is not yet in some Linux distributions. Add unmanaged API calls and code for creating single convex hull shapes.user_profiles
parent
522ab85045
commit
e324f6f3f0
|
@ -268,6 +268,25 @@ public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShap
|
||||||
BSPhysicsShapeType.SHAPE_HULL);
|
BSPhysicsShapeType.SHAPE_HULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override BulletShape BuildConvexHullShapeFromMesh(BulletWorld world, BulletShape meshShape)
|
||||||
|
{
|
||||||
|
BulletWorldUnman worldu = world as BulletWorldUnman;
|
||||||
|
BulletShapeUnman shapeu = meshShape as BulletShapeUnman;
|
||||||
|
return new BulletShapeUnman(
|
||||||
|
BSAPICPP.BuildConvexHullShapeFromMesh2(worldu.ptr, shapeu.ptr),
|
||||||
|
BSPhysicsShapeType.SHAPE_CONVEXHULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override BulletShape CreateConvexHullShape(BulletWorld world,
|
||||||
|
int indicesCount, int[] indices,
|
||||||
|
int verticesCount, float[] vertices)
|
||||||
|
{
|
||||||
|
BulletWorldUnman worldu = world as BulletWorldUnman;
|
||||||
|
return new BulletShapeUnman(
|
||||||
|
BSAPICPP.CreateConvexHullShape2(worldu.ptr, indicesCount, indices, verticesCount, vertices),
|
||||||
|
BSPhysicsShapeType.SHAPE_CONVEXHULL);
|
||||||
|
}
|
||||||
|
|
||||||
public override BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData)
|
public override BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData)
|
||||||
{
|
{
|
||||||
BulletWorldUnman worldu = world as BulletWorldUnman;
|
BulletWorldUnman worldu = world as BulletWorldUnman;
|
||||||
|
@ -1413,6 +1432,14 @@ public static extern IntPtr CreateHullShape2(IntPtr world,
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape, HACDParams parms);
|
public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape, HACDParams parms);
|
||||||
|
|
||||||
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
|
public static extern IntPtr BuildConvexHullShapeFromMesh2(IntPtr world, IntPtr meshShape);
|
||||||
|
|
||||||
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
|
public static extern IntPtr CreateConvexHullShape2(IntPtr world,
|
||||||
|
int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices,
|
||||||
|
int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices );
|
||||||
|
|
||||||
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
|
||||||
public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData);
|
public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData);
|
||||||
|
|
||||||
|
|
|
@ -1778,6 +1778,16 @@ private sealed class BulletConstraintXNA : BulletConstraint
|
||||||
/* TODO */ return null;
|
/* TODO */ return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override BulletShape BuildConvexHullShapeFromMesh(BulletWorld world, BulletShape meshShape)
|
||||||
|
{
|
||||||
|
/* TODO */ return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override BulletShape CreateConvexHullShape(BulletWorld pWorld, int pIndicesCount, int[] indices, int pVerticesCount, float[] verticesAsFloats)
|
||||||
|
{
|
||||||
|
/* TODO */ return null;
|
||||||
|
}
|
||||||
|
|
||||||
public override BulletShape CreateMeshShape(BulletWorld pWorld, int pIndicesCount, int[] indices, int pVerticesCount, float[] verticesAsFloats)
|
public override BulletShape CreateMeshShape(BulletWorld pWorld, int pIndicesCount, int[] indices, int pVerticesCount, float[] verticesAsFloats)
|
||||||
{
|
{
|
||||||
//DumpRaw(indices,verticesAsFloats,pIndicesCount,pVerticesCount);
|
//DumpRaw(indices,verticesAsFloats,pIndicesCount,pVerticesCount);
|
||||||
|
|
|
@ -70,6 +70,7 @@ public enum BSPhysicsShapeType
|
||||||
SHAPE_COMPOUND = 22,
|
SHAPE_COMPOUND = 22,
|
||||||
SHAPE_HEIGHTMAP = 23,
|
SHAPE_HEIGHTMAP = 23,
|
||||||
SHAPE_AVATAR = 24,
|
SHAPE_AVATAR = 24,
|
||||||
|
SHAPE_CONVEXHULL= 25,
|
||||||
};
|
};
|
||||||
|
|
||||||
// The native shapes have predefined shape hash keys
|
// The native shapes have predefined shape hash keys
|
||||||
|
@ -325,6 +326,12 @@ public abstract BulletShape CreateHullShape(BulletWorld world,
|
||||||
|
|
||||||
public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape, HACDParams parms);
|
public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape, HACDParams parms);
|
||||||
|
|
||||||
|
public abstract BulletShape BuildConvexHullShapeFromMesh(BulletWorld world, BulletShape meshShape);
|
||||||
|
|
||||||
|
public abstract BulletShape CreateConvexHullShape(BulletWorld world,
|
||||||
|
int indicesCount, int[] indices,
|
||||||
|
int verticesCount, float[] vertices );
|
||||||
|
|
||||||
public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData);
|
public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData);
|
||||||
|
|
||||||
public abstract bool IsNativeShape(BulletShape shape);
|
public abstract bool IsNativeShape(BulletShape shape);
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue