This commit is contained in:
AndresTraks 2017-07-09 18:37:24 +03:00
Родитель 5c66a92ae9
Коммит 0ff0281b64
49 изменённых файлов: 1524 добавлений и 1603 удалений

Просмотреть файл

@ -11,7 +11,7 @@ namespace BulletSharp
public AxisSweep3(Vector3 worldAabbMin, Vector3 worldAabbMax, ushort maxHandles = 16384,
OverlappingPairCache pairCache = null, bool disableRaycastAccelerator = false)
: base(btAxisSweep3_new(ref worldAabbMin, ref worldAabbMax, maxHandles,
(pairCache != null) ? pairCache._native : IntPtr.Zero, disableRaycastAccelerator))
(pairCache != null) ? pairCache.Native : IntPtr.Zero, disableRaycastAccelerator))
{
_overlappingPairCache = pairCache ?? new HashedOverlappingPairCache(
btBroadphaseInterface_getOverlappingPairCache(Native), true);
@ -80,7 +80,7 @@ namespace BulletSharp
get => _overlappingPairUserCallback;
set
{
btAxisSweep3_setOverlappingPairUserCallback(Native, (value != null) ? value._native : IntPtr.Zero);
btAxisSweep3_setOverlappingPairUserCallback(Native, (value != null) ? value.Native : IntPtr.Zero);
_overlappingPairUserCallback = value;
}
}
@ -93,7 +93,7 @@ namespace BulletSharp
public AxisSweep3_32Bit(Vector3 worldAabbMin, Vector3 worldAabbMax, uint maxHandles = 1500000,
OverlappingPairCache pairCache = null, bool disableRaycastAccelerator = false)
: base(bt32BitAxisSweep3_new(ref worldAabbMin, ref worldAabbMax, maxHandles,
(pairCache != null) ? pairCache._native : IntPtr.Zero, disableRaycastAccelerator))
(pairCache != null) ? pairCache.Native : IntPtr.Zero, disableRaycastAccelerator))
{
_overlappingPairCache = (pairCache != null) ? pairCache : new HashedOverlappingPairCache(
btBroadphaseInterface_getOverlappingPairCache(Native), true);
@ -158,7 +158,7 @@ namespace BulletSharp
get => _overlappingPairUserCallback;
set
{
bt32BitAxisSweep3_setOverlappingPairUserCallback(Native, (value != null) ? value._native : IntPtr.Zero);
bt32BitAxisSweep3_setOverlappingPairUserCallback(Native, (value != null) ? value.Native : IntPtr.Zero);
_overlappingPairUserCallback = value;
}
}

Просмотреть файл

@ -37,7 +37,7 @@ namespace BulletSharp
public Box2DBox2DCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap)
: base(btBox2dBox2dCollisionAlgorithm_new2(mf._native, ci.Native, body0Wrap.Native,
: base(btBox2dBox2dCollisionAlgorithm_new2(mf.Native, ci.Native, body0Wrap.Native,
body1Wrap.Native))
{
}

Просмотреть файл

@ -37,7 +37,7 @@ namespace BulletSharp
public BoxBoxCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap)
: base(btBoxBoxCollisionAlgorithm_new2(mf._native, ci.Native, body0Wrap.Native,
: base(btBoxBoxCollisionAlgorithm_new2(mf.Native, ci.Native, body0Wrap.Native,
body1Wrap.Native))
{
}

Просмотреть файл

@ -19,7 +19,7 @@ namespace BulletSharp
get => _box1;
set
{
btBoxBoxDetector_setBox1(_native, value.Native);
btBoxBoxDetector_setBox1(Native, value.Native);
_box1 = value;
}
}
@ -29,7 +29,7 @@ namespace BulletSharp
get => _box2;
set
{
btBoxBoxDetector_setBox2(_native, value.Native);
btBoxBoxDetector_setBox2(Native, value.Native);
_box2 = value;
}
}

Просмотреть файл

@ -16,7 +16,7 @@ namespace BulletSharp
public BvhTriangleMeshShape(StridingMeshInterface meshInterface, bool useQuantizedAabbCompression,
bool buildBvh = true)
: base(btBvhTriangleMeshShape_new(meshInterface._native, useQuantizedAabbCompression,
: base(btBvhTriangleMeshShape_new(meshInterface.Native, useQuantizedAabbCompression,
buildBvh))
{
_meshInterface = meshInterface;
@ -24,7 +24,7 @@ namespace BulletSharp
public BvhTriangleMeshShape(StridingMeshInterface meshInterface, bool useQuantizedAabbCompression,
Vector3 bvhAabbMin, Vector3 bvhAabbMax, bool buildBvh = true)
: base(btBvhTriangleMeshShape_new2(meshInterface._native, useQuantizedAabbCompression,
: base(btBvhTriangleMeshShape_new2(meshInterface.Native, useQuantizedAabbCompression,
ref bvhAabbMin, ref bvhAabbMax, buildBvh))
{
_meshInterface = meshInterface;
@ -49,14 +49,14 @@ namespace BulletSharp
public void PerformConvexcast(TriangleCallback callback, Vector3 boxSource,
Vector3 boxTarget, Vector3 boxMin, Vector3 boxMax)
{
btBvhTriangleMeshShape_performConvexcast(Native, callback._native, ref boxSource,
btBvhTriangleMeshShape_performConvexcast(Native, callback.Native, ref boxSource,
ref boxTarget, ref boxMin, ref boxMax);
}
public void PerformRaycast(TriangleCallback callback, Vector3 raySource,
Vector3 rayTarget)
{
btBvhTriangleMeshShape_performRaycast(Native, callback._native, ref raySource,
btBvhTriangleMeshShape_performRaycast(Native, callback.Native, ref raySource,
ref rayTarget);
}
@ -124,7 +124,7 @@ namespace BulletSharp
}
set
{
btBvhTriangleMeshShape_setTriangleInfoMap(Native, (value != null) ? value._native : IntPtr.Zero);
btBvhTriangleMeshShape_setTriangleInfoMap(Native, (value != null) ? value.Native : IntPtr.Zero);
_triangleInfoMap = value;
}
}

Просмотреть файл

@ -37,7 +37,7 @@ namespace BulletSharp
get => _manifold;
set
{
btCollisionAlgorithmConstructionInfo_setManifold(Native, (value != null) ? value._native : IntPtr.Zero);
btCollisionAlgorithmConstructionInfo_setManifold(Native, (value != null) ? value.Native : IntPtr.Zero);
_manifold = value;
}
}

Просмотреть файл

@ -24,7 +24,7 @@ namespace BulletSharp
public void ProcessAllTriangles(TriangleCallback callback, Vector3 aabbMin,
Vector3 aabbMax)
{
btConcaveShape_processAllTriangles(Native, callback._native, ref aabbMin,
btConcaveShape_processAllTriangles(Native, callback.Native, ref aabbMin,
ref aabbMax);
}
}

Просмотреть файл

@ -7,7 +7,7 @@ namespace BulletSharp
public ContinuousConvexCollision(ConvexShape shapeA, ConvexShape shapeB,
VoronoiSimplexSolver simplexSolver, ConvexPenetrationDepthSolver penetrationDepthSolver)
: base(btContinuousConvexCollision_new(shapeA.Native, shapeB.Native,
simplexSolver._native, penetrationDepthSolver.Native))
simplexSolver.Native, penetrationDepthSolver.Native))
{
}

Просмотреть файл

@ -16,7 +16,7 @@ namespace BulletSharp
}
public CreateFunc(VoronoiSimplexSolver simplexSolver, ConvexPenetrationDepthSolver pdSolver)
: base(btConvex2dConvex2dAlgorithm_CreateFunc_new(simplexSolver._native,
: base(btConvex2dConvex2dAlgorithm_CreateFunc_new(simplexSolver.Native,
pdSolver.Native), false)
{
_pdSolver = pdSolver;
@ -57,7 +57,7 @@ namespace BulletSharp
get => _simplexSolver;
set
{
btConvex2dConvex2dAlgorithm_CreateFunc_setSimplexSolver(Native, value._native);
btConvex2dConvex2dAlgorithm_CreateFunc_setSimplexSolver(Native, value.Native);
_simplexSolver = value;
}
}
@ -71,8 +71,8 @@ namespace BulletSharp
public Convex2DConvex2DAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, VoronoiSimplexSolver simplexSolver,
ConvexPenetrationDepthSolver pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold)
: base(btConvex2dConvex2dAlgorithm_new(mf._native, ci.Native, body0Wrap.Native,
body1Wrap.Native, simplexSolver._native, pdSolver.Native, numPerturbationIterations,
: base(btConvex2dConvex2dAlgorithm_new(mf.Native, ci.Native, body0Wrap.Native,
body1Wrap.Native, simplexSolver.Native, pdSolver.Native, numPerturbationIterations,
minimumPointsPerturbationThreshold))
{
}

Просмотреть файл

@ -12,7 +12,7 @@ namespace BulletSharp
public ConvexTriangleCallback(Dispatcher dispatcher, CollisionObjectWrapper body0Wrap,
CollisionObjectWrapper body1Wrap, bool isSwapped)
: base(btConvexTriangleCallback_new(dispatcher._native, body0Wrap.Native,
: base(btConvexTriangleCallback_new(dispatcher.Native, body0Wrap.Native,
body1Wrap.Native, isSwapped))
{
}

Просмотреть файл

@ -58,8 +58,8 @@ namespace BulletSharp
public ConvexConvexAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, VoronoiSimplexSolver simplexSolver,
ConvexPenetrationDepthSolver pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold)
: base(btConvexConvexAlgorithm_new(mf._native, ci.Native, body0Wrap.Native,
body1Wrap.Native, simplexSolver._native, pdSolver.Native, numPerturbationIterations,
: base(btConvexConvexAlgorithm_new(mf.Native, ci.Native, body0Wrap.Native,
body1Wrap.Native, simplexSolver.Native, pdSolver.Native, numPerturbationIterations,
minimumPointsPerturbationThreshold))
{
}

Просмотреть файл

@ -17,7 +17,7 @@ namespace BulletSharp
ConvexShape convexB, Matrix transA, Matrix transB, out Vector3 v, out Vector3 pa,
out Vector3 pb, IDebugDraw debugDraw)
{
return btConvexPenetrationDepthSolver_calcPenDepth(Native, simplexSolver._native,
return btConvexPenetrationDepthSolver_calcPenDepth(Native, simplexSolver.Native,
convexA.Native, convexB.Native, ref transA, ref transB, out v, out pa,
out pb, DebugDraw.GetUnmanaged(debugDraw));
}

Просмотреть файл

@ -46,7 +46,7 @@ namespace BulletSharp
public ConvexPlaneCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, bool isSwapped,
int numPerturbationIterations, int minimumPointsPerturbationThreshold)
: base(btConvexPlaneCollisionAlgorithm_new(mf._native, ci.Native, body0Wrap.Native,
: base(btConvexPlaneCollisionAlgorithm_new(mf.Native, ci.Native, body0Wrap.Native,
body1Wrap.Native, isSwapped, numPerturbationIterations, minimumPointsPerturbationThreshold))
{
}

Просмотреть файл

@ -6,26 +6,26 @@ namespace BulletSharp
{
public class Face : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
internal Face(IntPtr native)
{
_native = native;
Native = native;
}
public Face()
{
_native = btFace_new();
Native = btFace_new();
}
/*
public AlignedIntArray Indices
{
get { return new AlignedIntArray(btFace_getIndices(_native)); }
get { return new AlignedIntArray(btFace_getIndices(Native)); }
}
public ScalarArray Plane
{
get { return new ScalarArray(btFace_getPlane(_native)); }
get { return new ScalarArray(btFace_getPlane(Native)); }
}
*/
public void Dispose()
@ -36,10 +36,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btFace_delete(_native);
_native = IntPtr.Zero;
btFace_delete(Native);
Native = IntPtr.Zero;
}
}
@ -51,7 +51,7 @@ namespace BulletSharp
public class ConvexPolyhedron : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
//AlignedFaceArray _faces;
AlignedVector3Array _uniqueEdges;
@ -59,36 +59,36 @@ namespace BulletSharp
internal ConvexPolyhedron(IntPtr native)
{
_native = native;
Native = native;
}
public ConvexPolyhedron()
{
_native = btConvexPolyhedron_new();
Native = btConvexPolyhedron_new();
}
public void Initialize()
{
btConvexPolyhedron_initialize(_native);
btConvexPolyhedron_initialize(Native);
}
public void ProjectRef(ref Matrix trans, ref Vector3 dir, out float minProj, out float maxProj,
out Vector3 witnesPtMin, out Vector3 witnesPtMax)
{
btConvexPolyhedron_project(_native, ref trans, ref dir, out minProj,
btConvexPolyhedron_project(Native, ref trans, ref dir, out minProj,
out maxProj, out witnesPtMin, out witnesPtMax);
}
public void Project(Matrix trans, Vector3 dir, out float minProj, out float maxProj,
out Vector3 witnesPtMin, out Vector3 witnesPtMax)
{
btConvexPolyhedron_project(_native, ref trans, ref dir, out minProj,
btConvexPolyhedron_project(Native, ref trans, ref dir, out minProj,
out maxProj, out witnesPtMin, out witnesPtMax);
}
public bool TestContainment()
{
return btConvexPolyhedron_testContainment(_native);
return btConvexPolyhedron_testContainment(Native);
}
public Vector3 Extents
@ -96,15 +96,15 @@ namespace BulletSharp
get
{
Vector3 value;
btConvexPolyhedron_getExtents(_native, out value);
btConvexPolyhedron_getExtents(Native, out value);
return value;
}
set => btConvexPolyhedron_setExtents(_native, ref value);
set => btConvexPolyhedron_setExtents(Native, ref value);
}
/*
public AlignedFaceArray Faces
{
get { return btConvexPolyhedron_getFaces(_native); }
get { return btConvexPolyhedron_getFaces(Native); }
}
*/
public Vector3 LocalCenter
@ -112,10 +112,10 @@ namespace BulletSharp
get
{
Vector3 value;
btConvexPolyhedron_getLocalCenter(_native, out value);
btConvexPolyhedron_getLocalCenter(Native, out value);
return value;
}
set => btConvexPolyhedron_setLocalCenter(_native, ref value);
set => btConvexPolyhedron_setLocalCenter(Native, ref value);
}
public Vector3 C
@ -123,10 +123,10 @@ namespace BulletSharp
get
{
Vector3 value;
btConvexPolyhedron_getMC(_native, out value);
btConvexPolyhedron_getMC(Native, out value);
return value;
}
set => btConvexPolyhedron_setMC(_native, ref value);
set => btConvexPolyhedron_setMC(Native, ref value);
}
public Vector3 E
@ -134,16 +134,16 @@ namespace BulletSharp
get
{
Vector3 value;
btConvexPolyhedron_getME(_native, out value);
btConvexPolyhedron_getME(Native, out value);
return value;
}
set => btConvexPolyhedron_setME(_native, ref value);
set => btConvexPolyhedron_setME(Native, ref value);
}
public float Radius
{
get => btConvexPolyhedron_getRadius(_native);
set => btConvexPolyhedron_setRadius(_native, value);
get => btConvexPolyhedron_getRadius(Native);
set => btConvexPolyhedron_setRadius(Native, value);
}
public AlignedVector3Array UniqueEdges
@ -152,7 +152,7 @@ namespace BulletSharp
{
if (_uniqueEdges == null)
{
_uniqueEdges = new AlignedVector3Array(btConvexPolyhedron_getUniqueEdges(_native));
_uniqueEdges = new AlignedVector3Array(btConvexPolyhedron_getUniqueEdges(Native));
}
return _uniqueEdges;
}
@ -164,7 +164,7 @@ namespace BulletSharp
{
if (_vertices == null)
{
_vertices = new AlignedVector3Array(btConvexPolyhedron_getVertices(_native));
_vertices = new AlignedVector3Array(btConvexPolyhedron_getVertices(Native));
}
return _vertices;
}
@ -178,10 +178,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btConvexPolyhedron_delete(_native);
_native = IntPtr.Zero;
btConvexPolyhedron_delete(Native);
Native = IntPtr.Zero;
}
}

Просмотреть файл

@ -14,7 +14,7 @@ namespace BulletSharp
}
public ConvexTriangleMeshShape(StridingMeshInterface meshInterface, bool calcAabb = true)
: base(btConvexTriangleMeshShape_new(meshInterface._native, calcAabb))
: base(btConvexTriangleMeshShape_new(meshInterface.Native, calcAabb))
{
_meshInterface = meshInterface;
}

Просмотреть файл

@ -146,7 +146,7 @@ namespace BulletSharp
public DbvtNodePtrArray Childs
{
get { return btDbvtNode_getChilds(_native); }
get { return btDbvtNode_getChilds(Native); }
}
*/
public IntPtr Data

Просмотреть файл

@ -21,7 +21,7 @@ namespace BulletSharp
set => btDbvtProxy_setLeaf(Native, (value != null) ? value.Native : IntPtr.Zero);
}
//public DbvtProxyPtrArray Links => btDbvtProxy_getLinks(_native);
//public DbvtProxyPtrArray Links => btDbvtProxy_getLinks(Native);
public int Stage
{
@ -33,7 +33,7 @@ namespace BulletSharp
public class DbvtBroadphase : BroadphaseInterface
{
public DbvtBroadphase(OverlappingPairCache pairCache = null)
: base(btDbvtBroadphase_new((pairCache != null) ? pairCache._native : IntPtr.Zero))
: base(btDbvtBroadphase_new((pairCache != null) ? pairCache.Native : IntPtr.Zero))
{
_overlappingPairCache = (pairCache != null) ? pairCache : new HashedOverlappingPairCache(
btBroadphaseInterface_getOverlappingPairCache(Native), true);
@ -138,7 +138,7 @@ namespace BulletSharp
set
{
_overlappingPairCache = value;
btDbvtBroadphase_setPaircache(Native, value._native);
btDbvtBroadphase_setPaircache(Native, value.Native);
}
}
@ -160,17 +160,17 @@ namespace BulletSharp
set => btDbvtBroadphase_setReleasepaircache(Native, value);
}
//public DbvtArray Sets => btDbvtBroadphase_getSets(_native);
//public DbvtArray Sets => btDbvtBroadphase_getSets(Native);
public int StageCurrent
public int StageCurrent
{
get => btDbvtBroadphase_getStageCurrent(Native);
set => btDbvtBroadphase_setStageCurrent(Native, value);
}
//public DbvtProxyPtrArray StageRoots => btDbvtBroadphase_getStageRoots(_native);
//public DbvtProxyPtrArray StageRoots => btDbvtBroadphase_getStageRoots(Native);
public uint UpdatesCall
public uint UpdatesCall
{
get => btDbvtBroadphase_getUpdates_call(Native);
set => btDbvtBroadphase_setUpdates_call(Native, value);

Просмотреть файл

@ -113,17 +113,17 @@ namespace BulletSharp
}
}
internal IntPtr _native;
internal IntPtr Native;
internal DiscreteCollisionDetectorInterface(IntPtr native)
{
_native = native;
Native = native;
}
public void GetClosestPoints(ClosestPointInput input, Result output, IDebugDraw debugDraw,
bool swapResults = false)
{
btDiscreteCollisionDetectorInterface_getClosestPoints(_native, input.Native,
btDiscreteCollisionDetectorInterface_getClosestPoints(Native, input.Native,
output.Native, DebugDraw.GetUnmanaged(debugDraw), swapResults);
}
@ -135,10 +135,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btDiscreteCollisionDetectorInterface_delete(_native);
_native = IntPtr.Zero;
btDiscreteCollisionDetectorInterface_delete(Native);
Native = IntPtr.Zero;
}
}

Просмотреть файл

@ -117,13 +117,13 @@ namespace BulletSharp
public void ClearManifold(PersistentManifold manifold)
{
btDispatcher_clearManifold(Native, manifold._native);
btDispatcher_clearManifold(Native, manifold.Native);
}
public void DispatchAllCollisionPairs(OverlappingPairCache pairCache, DispatcherInfo dispatchInfo,
Dispatcher dispatcher)
{
btDispatcher_dispatchAllCollisionPairs(Native, pairCache._native, dispatchInfo.Native,
btDispatcher_dispatchAllCollisionPairs(Native, pairCache.Native, dispatchInfo.Native,
dispatcher.Native);
}
@ -131,7 +131,7 @@ namespace BulletSharp
CollisionObjectWrapper body1Wrap, PersistentManifold sharedManifold,
DispatcherQueryType queryType)
{
return new CollisionAlgorithm(btDispatcher_findAlgorithm(Native, body0Wrap.Native, body1Wrap.Native, sharedManifold._native, queryType));
return new CollisionAlgorithm(btDispatcher_findAlgorithm(Native, body0Wrap.Native, body1Wrap.Native, sharedManifold.Native, queryType));
}
public void FreeCollisionAlgorithm(IntPtr ptr)
@ -161,7 +161,7 @@ namespace BulletSharp
public void ReleaseManifold(PersistentManifold manifold)
{
btDispatcher_releaseManifold(Native, manifold._native);
btDispatcher_releaseManifold(Native, manifold.Native);
}
/*
public PersistentManifold InternalManifoldPointer

Просмотреть файл

@ -76,14 +76,14 @@ namespace BulletSharp
public void ProcessAllTrianglesRayRef(TriangleCallback callback, ref Vector3 rayFrom,
ref Vector3 rayTo)
{
btGImpactShapeInterface_processAllTrianglesRay(Native, callback._native,
btGImpactShapeInterface_processAllTrianglesRay(Native, callback.Native,
ref rayFrom, ref rayTo);
}
public void ProcessAllTrianglesRay(TriangleCallback callback, Vector3 rayFrom,
Vector3 rayTo)
{
btGImpactShapeInterface_processAllTrianglesRay(Native, callback._native,
btGImpactShapeInterface_processAllTrianglesRay(Native, callback.Native,
ref rayFrom, ref rayTo);
}
@ -205,7 +205,7 @@ namespace BulletSharp
}
public TrimeshPrimitiveManager(StridingMeshInterface meshInterface, int part)
: base(btGImpactMeshShapePart_TrimeshPrimitiveManager_new(meshInterface._native,
: base(btGImpactMeshShapePart_TrimeshPrimitiveManager_new(meshInterface.Native,
part))
{
_meshInterface = meshInterface;
@ -284,7 +284,7 @@ namespace BulletSharp
get => _meshInterface;
set
{
btGImpactMeshShapePart_TrimeshPrimitiveManager_setMeshInterface(Native, value._native);
btGImpactMeshShapePart_TrimeshPrimitiveManager_setMeshInterface(Native, value.Native);
_meshInterface = value;
}
}
@ -354,7 +354,7 @@ namespace BulletSharp
}
public GImpactMeshShapePart(StridingMeshInterface meshInterface, int part)
: base(btGImpactMeshShapePart_new2(meshInterface._native, part))
: base(btGImpactMeshShapePart_new2(meshInterface.Native, part))
{
}
@ -401,7 +401,7 @@ namespace BulletSharp
}
public GImpactMeshShape(StridingMeshInterface meshInterface)
: base(btGImpactMeshShape_new(meshInterface._native))
: base(btGImpactMeshShape_new(meshInterface.Native))
{
_meshInterface = meshInterface;
}

Просмотреть файл

@ -117,20 +117,20 @@ namespace BulletSharp
public override BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(_native, proxy0.Native,
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(Native, proxy0.Native,
proxy1.Native));
}
public override IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1, Dispatcher dispatcher)
{
return btOverlappingPairCallback_removeOverlappingPair(_native, proxy0.Native,
return btOverlappingPairCallback_removeOverlappingPair(Native, proxy0.Native,
proxy1.Native, dispatcher.Native);
}
public override void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0,
Dispatcher dispatcher)
{
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(_native, proxy0.Native,
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(Native, proxy0.Native,
dispatcher.Native);
}
}

Просмотреть файл

@ -5,7 +5,7 @@ namespace BulletSharp
public class GjkConvexCast : ConvexCast
{
public GjkConvexCast(ConvexShape convexA, ConvexShape convexB, VoronoiSimplexSolver simplexSolver)
: base(btGjkConvexCast_new(convexA.Native, convexB.Native, simplexSolver._native))
: base(btGjkConvexCast_new(convexA.Native, convexB.Native, simplexSolver.Native))
{
}
}

Просмотреть файл

@ -13,7 +13,7 @@ namespace BulletSharp
public GjkPairDetector(ConvexShape objectA, ConvexShape objectB, VoronoiSimplexSolver simplexSolver,
ConvexPenetrationDepthSolver penetrationDepthSolver)
: base(btGjkPairDetector_new(objectA.Native, objectB.Native, simplexSolver._native,
: base(btGjkPairDetector_new(objectA.Native, objectB.Native, simplexSolver.Native,
(penetrationDepthSolver != null) ? penetrationDepthSolver.Native : IntPtr.Zero))
{
}
@ -22,35 +22,35 @@ namespace BulletSharp
int shapeTypeB, float marginA, float marginB, VoronoiSimplexSolver simplexSolver,
ConvexPenetrationDepthSolver penetrationDepthSolver)
: base(btGjkPairDetector_new2(objectA.Native, objectB.Native, shapeTypeA,
shapeTypeB, marginA, marginB, simplexSolver._native, (penetrationDepthSolver != null) ? penetrationDepthSolver.Native : IntPtr.Zero))
shapeTypeB, marginA, marginB, simplexSolver.Native, (penetrationDepthSolver != null) ? penetrationDepthSolver.Native : IntPtr.Zero))
{
}
public void GetClosestPointsNonVirtual(ClosestPointInput input, Result output,
IDebugDraw debugDraw)
{
btGjkPairDetector_getClosestPointsNonVirtual(_native, input.Native,
btGjkPairDetector_getClosestPointsNonVirtual(Native, input.Native,
output.Native, DebugDraw.GetUnmanaged(debugDraw));
}
public void SetIgnoreMargin(bool ignoreMargin)
{
btGjkPairDetector_setIgnoreMargin(_native, ignoreMargin);
btGjkPairDetector_setIgnoreMargin(Native, ignoreMargin);
}
public void SetMinkowskiA(ConvexShape minkA)
{
btGjkPairDetector_setMinkowskiA(_native, minkA.Native);
btGjkPairDetector_setMinkowskiA(Native, minkA.Native);
}
public void SetMinkowskiB(ConvexShape minkB)
{
btGjkPairDetector_setMinkowskiB(_native, minkB.Native);
btGjkPairDetector_setMinkowskiB(Native, minkB.Native);
}
public void SetPenetrationDepthSolver(ConvexPenetrationDepthSolver penetrationDepthSolver)
{
btGjkPairDetector_setPenetrationDepthSolver(_native, penetrationDepthSolver.Native);
btGjkPairDetector_setPenetrationDepthSolver(Native, penetrationDepthSolver.Native);
}
public Vector3 CachedSeparatingAxis
@ -58,42 +58,42 @@ namespace BulletSharp
get
{
Vector3 value;
btGjkPairDetector_getCachedSeparatingAxis(_native, out value);
btGjkPairDetector_getCachedSeparatingAxis(Native, out value);
return value;
}
set => btGjkPairDetector_setCachedSeparatingAxis(_native, ref value);
set => btGjkPairDetector_setCachedSeparatingAxis(Native, ref value);
}
public float CachedSeparatingDistance => btGjkPairDetector_getCachedSeparatingDistance(_native);
public float CachedSeparatingDistance => btGjkPairDetector_getCachedSeparatingDistance(Native);
public int CatchDegeneracies
{
get => btGjkPairDetector_getCatchDegeneracies(_native);
set => btGjkPairDetector_setCatchDegeneracies(_native, value);
get => btGjkPairDetector_getCatchDegeneracies(Native);
set => btGjkPairDetector_setCatchDegeneracies(Native, value);
}
public int CurIter
{
get => btGjkPairDetector_getCurIter(_native);
set => btGjkPairDetector_setCurIter(_native, value);
get => btGjkPairDetector_getCurIter(Native);
set => btGjkPairDetector_setCurIter(Native, value);
}
public int DegenerateSimplex
{
get => btGjkPairDetector_getDegenerateSimplex(_native);
set => btGjkPairDetector_setDegenerateSimplex(_native, value);
get => btGjkPairDetector_getDegenerateSimplex(Native);
set => btGjkPairDetector_setDegenerateSimplex(Native, value);
}
public int FixContactNormalDirection
{
get => btGjkPairDetector_getFixContactNormalDirection(_native);
set => btGjkPairDetector_setFixContactNormalDirection(_native, value);
get => btGjkPairDetector_getFixContactNormalDirection(Native);
set => btGjkPairDetector_setFixContactNormalDirection(Native, value);
}
public int LastUsedMethod
{
get => btGjkPairDetector_getLastUsedMethod(_native);
set => btGjkPairDetector_setLastUsedMethod(_native, value);
get => btGjkPairDetector_getLastUsedMethod(Native);
set => btGjkPairDetector_setLastUsedMethod(Native, value);
}
}
}

Просмотреть файл

@ -81,7 +81,7 @@ namespace BulletSharp
public PersistentManifold PersistentManifold
{
get => new PersistentManifold(btManifoldResult_getPersistentManifold(Native), true);
set => btManifoldResult_setPersistentManifold(Native, value._native);
set => btManifoldResult_setPersistentManifold(Native, value.Native);
}
}
}

Просмотреть файл

@ -7,7 +7,7 @@ namespace BulletSharp
{
public MultimaterialTriangleMeshShape(StridingMeshInterface meshInterface,
bool useQuantizedAabbCompression, bool buildBvh = true)
: base(btMultimaterialTriangleMeshShape_new(meshInterface._native, useQuantizedAabbCompression,
: base(btMultimaterialTriangleMeshShape_new(meshInterface.Native, useQuantizedAabbCompression,
buildBvh))
{
_meshInterface = meshInterface;
@ -16,7 +16,7 @@ namespace BulletSharp
public MultimaterialTriangleMeshShape(StridingMeshInterface meshInterface,
bool useQuantizedAabbCompression, Vector3 bvhAabbMin, Vector3 bvhAabbMax,
bool buildBvh = true)
: base(btMultimaterialTriangleMeshShape_new2(meshInterface._native, useQuantizedAabbCompression,
: base(btMultimaterialTriangleMeshShape_new2(meshInterface.Native, useQuantizedAabbCompression,
ref bvhAabbMin, ref bvhAabbMax, buildBvh))
{
_meshInterface = meshInterface;
@ -24,7 +24,7 @@ namespace BulletSharp
/*
public BulletMaterial GetMaterialProperties(int partID, int triIndex)
{
return btMultimaterialTriangleMeshShape_getMaterialProperties(_native,
return btMultimaterialTriangleMeshShape_getMaterialProperties(Native,
partID, triIndex);
}
*/

Просмотреть файл

@ -1,7 +1,6 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
@ -20,7 +19,7 @@ namespace BulletSharp
public void Build(StridingMeshInterface triangles, bool useQuantizedAabbCompression,
Vector3 bvhAabbMin, Vector3 bvhAabbMax)
{
btOptimizedBvh_build(_native, triangles._native, useQuantizedAabbCompression,
btOptimizedBvh_build(_native, triangles.Native, useQuantizedAabbCompression,
ref bvhAabbMin, ref bvhAabbMax);
}
@ -33,13 +32,13 @@ namespace BulletSharp
public void Refit(StridingMeshInterface triangles, Vector3 aabbMin, Vector3 aabbMax)
{
btOptimizedBvh_refit(_native, triangles._native, ref aabbMin, ref aabbMax);
btOptimizedBvh_refit(_native, triangles.Native, ref aabbMin, ref aabbMax);
}
public void RefitPartial(StridingMeshInterface triangles, Vector3 aabbMin,
Vector3 aabbMax)
{
btOptimizedBvh_refitPartial(_native, triangles._native, ref aabbMin,
btOptimizedBvh_refitPartial(_native, triangles.Native, ref aabbMin,
ref aabbMax);
}
@ -53,24 +52,8 @@ namespace BulletSharp
public void UpdateBvhNodes(StridingMeshInterface meshInterface, int firstNode,
int endNode, int index)
{
btOptimizedBvh_updateBvhNodes(_native, meshInterface._native, firstNode,
btOptimizedBvh_updateBvhNodes(_native, meshInterface.Native, firstNode,
endNode, index);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btOptimizedBvh_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvh_build(IntPtr obj, IntPtr triangles, bool useQuantizedAabbCompression, [In] ref Vector3 bvhAabbMin, [In] ref Vector3 bvhAabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btOptimizedBvh_deSerializeInPlace(IntPtr i_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvh_refit(IntPtr obj, IntPtr triangles, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvh_refitPartial(IntPtr obj, IntPtr triangles, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btOptimizedBvh_serializeInPlace(IntPtr obj, IntPtr o_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvh_updateBvhNodes(IntPtr obj, IntPtr meshInterface, int firstNode, int endNode, int index);
}
}

Просмотреть файл

@ -1,16 +1,17 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public abstract class OverlapCallback : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
public bool ProcessOverlap(BroadphasePair pair)
{
return btOverlapCallback_processOverlap(_native, pair.Native);
return btOverlapCallback_processOverlap(Native, pair.Native);
}
public void Dispose()
@ -21,10 +22,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btOverlapCallback_delete(_native);
_native = IntPtr.Zero;
btOverlapCallback_delete(Native);
Native = IntPtr.Zero;
}
}
@ -32,39 +33,33 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btOverlapCallback_processOverlap(IntPtr obj, IntPtr pair);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlapCallback_delete(IntPtr obj);
}
public abstract class OverlapFilterCallback : IDisposable
{
[UnmanagedFunctionPointer(Native.Conv), SuppressUnmanagedCodeSecurity]
private delegate bool NeedBroadphaseCollisionUnmanagedDelegate(IntPtr proxy0, IntPtr proxy1);
[UnmanagedFunctionPointer(BulletSharp.Native.Conv), SuppressUnmanagedCodeSecurity]
private delegate bool NeedBroadphaseCollisionUnmanagedDelegate(IntPtr proxy0, IntPtr proxy1);
internal IntPtr _native;
private NeedBroadphaseCollisionUnmanagedDelegate _needBroadphaseCollision;
internal IntPtr Native;
private NeedBroadphaseCollisionUnmanagedDelegate _needBroadphaseCollision;
internal OverlapFilterCallback(IntPtr native)
{
_native = native;
Native = native;
}
public OverlapFilterCallback()
{
_needBroadphaseCollision = NeedBroadphaseCollisionUnmanaged;
_native = btOverlapFilterCallbackWrapper_new(Marshal.GetFunctionPointerForDelegate(_needBroadphaseCollision));
}
public OverlapFilterCallback()
{
_needBroadphaseCollision = NeedBroadphaseCollisionUnmanaged;
Native = btOverlapFilterCallbackWrapper_new(Marshal.GetFunctionPointerForDelegate(_needBroadphaseCollision));
}
private bool NeedBroadphaseCollisionUnmanaged(IntPtr proxy0, IntPtr proxy1)
{
return NeedBroadphaseCollision(BroadphaseProxy.GetManaged(proxy0), BroadphaseProxy.GetManaged(proxy1));
}
private bool NeedBroadphaseCollisionUnmanaged(IntPtr proxy0, IntPtr proxy1)
{
return NeedBroadphaseCollision(BroadphaseProxy.GetManaged(proxy0), BroadphaseProxy.GetManaged(proxy1));
}
public abstract bool NeedBroadphaseCollision(BroadphaseProxy proxy0, BroadphaseProxy proxy1);
public abstract bool NeedBroadphaseCollision(BroadphaseProxy proxy0, BroadphaseProxy proxy1);
public void Dispose()
{
@ -74,10 +69,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btOverlapFilterCallback_delete(_native);
_native = IntPtr.Zero;
btOverlapFilterCallback_delete(Native);
Native = IntPtr.Zero;
}
}
@ -85,21 +80,12 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btOverlapFilterCallback_needBroadphaseCollision(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlapFilterCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btOverlapFilterCallbackWrapper_new(IntPtr needBroadphaseCollision);
}
}
public abstract class OverlappingPairCache : OverlappingPairCallback
{
private OverlappingPairCallback _ghostPairCallback;
private AlignedBroadphasePairArray _overlappingPairArray;
private OverlappingPairCallback _ghostPairCallback;
private AlignedBroadphasePairArray _overlappingPairArray;
internal OverlappingPairCache(IntPtr native, bool preventDelete)
: base(native, preventDelete)
@ -108,92 +94,62 @@ namespace BulletSharp
public void CleanOverlappingPair(BroadphasePair pair, Dispatcher dispatcher)
{
btOverlappingPairCache_cleanOverlappingPair(_native, pair.Native, dispatcher.Native);
btOverlappingPairCache_cleanOverlappingPair(Native, pair.Native, dispatcher.Native);
}
public void CleanProxyFromPairs(BroadphaseProxy proxy, Dispatcher dispatcher)
{
btOverlappingPairCache_cleanProxyFromPairs(_native, proxy.Native, dispatcher.Native);
btOverlappingPairCache_cleanProxyFromPairs(Native, proxy.Native, dispatcher.Native);
}
public BroadphasePair FindPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCache_findPair(_native, proxy0.Native, proxy1.Native));
return new BroadphasePair(btOverlappingPairCache_findPair(Native, proxy0.Native, proxy1.Native));
}
/*
/*
public void ProcessAllOverlappingPairs(OverlapCallback __unnamed0, Dispatcher dispatcher)
{
btOverlappingPairCache_processAllOverlappingPairs(_native, __unnamed0._native,
dispatcher._native);
btOverlappingPairCache_processAllOverlappingPairs(Native, __unnamed0.Native,
dispatcher.Native);
}
*/
*/
public void SetInternalGhostPairCallback(OverlappingPairCallback ghostPairCallback)
{
_ghostPairCallback = ghostPairCallback;
btOverlappingPairCache_setInternalGhostPairCallback(_native, ghostPairCallback._native);
_ghostPairCallback = ghostPairCallback;
btOverlappingPairCache_setInternalGhostPairCallback(Native, ghostPairCallback.Native);
}
public void SetOverlapFilterCallback(OverlapFilterCallback callback)
{
btOverlappingPairCache_setOverlapFilterCallback(_native, callback._native);
btOverlappingPairCache_setOverlapFilterCallback(Native, callback.Native);
}
public void SortOverlappingPairs(Dispatcher dispatcher)
{
btOverlappingPairCache_sortOverlappingPairs(_native, dispatcher.Native);
btOverlappingPairCache_sortOverlappingPairs(Native, dispatcher.Native);
}
public bool HasDeferredRemoval
{
get { return btOverlappingPairCache_hasDeferredRemoval(_native); }
}
public bool HasDeferredRemoval => btOverlappingPairCache_hasDeferredRemoval(Native);
public int NumOverlappingPairs
{
get { return btOverlappingPairCache_getNumOverlappingPairs(_native); }
}
public int NumOverlappingPairs => btOverlappingPairCache_getNumOverlappingPairs(Native);
public AlignedBroadphasePairArray OverlappingPairArray
{
get
{
IntPtr pairArrayPtr = btOverlappingPairCache_getOverlappingPairArray(_native);
if (_overlappingPairArray == null || _overlappingPairArray._native != pairArrayPtr)
{
_overlappingPairArray = new AlignedBroadphasePairArray(pairArrayPtr);
}
return _overlappingPairArray;
}
get
{
IntPtr pairArrayPtr = btOverlappingPairCache_getOverlappingPairArray(Native);
if (_overlappingPairArray == null || _overlappingPairArray._native != pairArrayPtr)
{
_overlappingPairArray = new AlignedBroadphasePairArray(pairArrayPtr);
}
return _overlappingPairArray;
}
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlappingPairCache_cleanOverlappingPair(IntPtr obj, IntPtr pair, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlappingPairCache_cleanProxyFromPairs(IntPtr obj, IntPtr proxy, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btOverlappingPairCache_findPair(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btOverlappingPairCache_getNumOverlappingPairs(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btOverlappingPairCache_getOverlappingPairArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btOverlappingPairCache_getOverlappingPairArrayPtr(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btOverlappingPairCache_hasDeferredRemoval(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlappingPairCache_processAllOverlappingPairs(IntPtr obj, IntPtr __unnamed0, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlappingPairCache_setInternalGhostPairCallback(IntPtr obj, IntPtr ghostPairCallback);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlappingPairCache_setOverlapFilterCallback(IntPtr obj, IntPtr callback);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlappingPairCache_sortOverlappingPairs(IntPtr obj, IntPtr dispatcher);
}
public class HashedOverlappingPairCache : OverlappingPairCache
{
private OverlapFilterCallback _overlapFilterCallback;
private OverlapFilterCallback _overlapFilterCallback;
internal HashedOverlappingPairCache(IntPtr native, bool preventDelete)
: base(native, preventDelete)
@ -205,108 +161,89 @@ namespace BulletSharp
{
}
public override BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(_native, proxy0.Native,
proxy1.Native));
}
public override BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(Native, proxy0.Native,
proxy1.Native));
}
public bool NeedsBroadphaseCollision(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return btHashedOverlappingPairCache_needsBroadphaseCollision(_native,
return btHashedOverlappingPairCache_needsBroadphaseCollision(Native,
proxy0.Native, proxy1.Native);
}
public override IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1,
Dispatcher dispatcher)
{
return btOverlappingPairCallback_removeOverlappingPair(_native, proxy0.Native,
proxy1.Native, dispatcher.Native);
}
public override void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0,
Dispatcher dispatcher)
{
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(_native,
proxy0.Native, dispatcher.Native);
}
public int Count
public override IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1,
Dispatcher dispatcher)
{
get { return btHashedOverlappingPairCache_GetCount(_native); }
return btOverlappingPairCallback_removeOverlappingPair(Native, proxy0.Native,
proxy1.Native, dispatcher.Native);
}
public override void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0,
Dispatcher dispatcher)
{
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(Native,
proxy0.Native, dispatcher.Native);
}
public int Count => btHashedOverlappingPairCache_GetCount(Native);
public OverlapFilterCallback OverlapFilterCallback
{
get { return _overlapFilterCallback; }
set
{
_overlapFilterCallback = value;
SetOverlapFilterCallback(value);
}
get => _overlapFilterCallback;
set
{
_overlapFilterCallback = value;
SetOverlapFilterCallback(value);
}
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btHashedOverlappingPairCache_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btHashedOverlappingPairCache_GetCount(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btHashedOverlappingPairCache_needsBroadphaseCollision(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
}
public class SortedOverlappingPairCache : OverlappingPairCache
{
private OverlapFilterCallback _overlapFilterCallback;
private OverlapFilterCallback _overlapFilterCallback;
public SortedOverlappingPairCache()
: base(btSortedOverlappingPairCache_new(), false)
{
}
public override BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(_native, proxy0.Native,
proxy1.Native));
}
public override BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(Native, proxy0.Native,
proxy1.Native));
}
public bool NeedsBroadphaseCollision(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return btSortedOverlappingPairCache_needsBroadphaseCollision(_native,
return btSortedOverlappingPairCache_needsBroadphaseCollision(Native,
proxy0.Native, proxy1.Native);
}
public override IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1,
Dispatcher dispatcher)
{
return btOverlappingPairCallback_removeOverlappingPair(_native, proxy0.Native,
proxy1.Native, dispatcher.Native);
}
public override IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1,
Dispatcher dispatcher)
{
return btOverlappingPairCallback_removeOverlappingPair(Native, proxy0.Native,
proxy1.Native, dispatcher.Native);
}
public override void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0,
Dispatcher dispatcher)
{
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(_native,
proxy0.Native, dispatcher.Native);
}
public override void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0,
Dispatcher dispatcher)
{
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(Native,
proxy0.Native, dispatcher.Native);
}
public OverlapFilterCallback OverlapFilterCallback
{
get { return _overlapFilterCallback; }
set
{
_overlapFilterCallback = value;
SetOverlapFilterCallback(value);
}
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btSortedOverlappingPairCache_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btSortedOverlappingPairCache_getOverlapFilterCallback(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btSortedOverlappingPairCache_needsBroadphaseCollision(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
public OverlapFilterCallback OverlapFilterCallback
{
get => _overlapFilterCallback;
set
{
_overlapFilterCallback = value;
SetOverlapFilterCallback(value);
}
}
}
public class NullPairCache : OverlappingPairCache
@ -316,27 +253,24 @@ namespace BulletSharp
{
}
public override BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(_native, proxy0.Native,
proxy1.Native));
}
public override BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1)
{
return new BroadphasePair(btOverlappingPairCallback_addOverlappingPair(Native, proxy0.Native,
proxy1.Native));
}
public override IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1,
Dispatcher dispatcher)
{
return btOverlappingPairCallback_removeOverlappingPair(_native, proxy0.Native,
proxy1.Native, dispatcher.Native);
}
public override IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1,
Dispatcher dispatcher)
{
return btOverlappingPairCallback_removeOverlappingPair(Native, proxy0.Native,
proxy1.Native, dispatcher.Native);
}
public override void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0,
Dispatcher dispatcher)
{
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(_native, proxy0.Native,
dispatcher.Native);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btNullPairCache_new();
public override void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0,
Dispatcher dispatcher)
{
btOverlappingPairCallback_removeOverlappingPairsContainingProxy(Native, proxy0.Native,
dispatcher.Native);
}
}
}

Просмотреть файл

@ -1,28 +1,27 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public abstract class OverlappingPairCallback : IDisposable
{
internal IntPtr _native;
private readonly bool _preventDelete;
internal IntPtr Native;
private readonly bool _preventDelete;
internal OverlappingPairCallback(IntPtr native, bool preventDelete = false)
{
_native = native;
_preventDelete = preventDelete;
Native = native;
_preventDelete = preventDelete;
}
/*
protected OverlappingPairCallback()
{
_native = btOverlappingPairCallbackWrapper_new();
}
*/
public abstract BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1);
public abstract IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1, Dispatcher dispatcher);
public abstract void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0, Dispatcher dispatcher);
/*
protected OverlappingPairCallback()
{
Native = btOverlappingPairCallbackWrapper_new();
}
*/
public abstract BroadphasePair AddOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1);
public abstract IntPtr RemoveOverlappingPair(BroadphaseProxy proxy0, BroadphaseProxy proxy1, Dispatcher dispatcher);
public abstract void RemoveOverlappingPairsContainingProxy(BroadphaseProxy proxy0, Dispatcher dispatcher);
public void Dispose()
{
@ -32,13 +31,13 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
if (!_preventDelete)
{
btOverlappingPairCallback_delete(_native);
}
_native = IntPtr.Zero;
if (!_preventDelete)
{
btOverlappingPairCallback_delete(Native);
}
Native = IntPtr.Zero;
}
}
@ -46,14 +45,5 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
internal static extern IntPtr btOverlappingPairCallback_addOverlappingPair(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
internal static extern IntPtr btOverlappingPairCallback_removeOverlappingPair(IntPtr obj, IntPtr proxy0, IntPtr proxy1, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
internal static extern void btOverlappingPairCallback_removeOverlappingPairsContainingProxy(IntPtr obj, IntPtr proxy0, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOverlappingPairCallback_delete(IntPtr obj);
}
}

Просмотреть файл

@ -2,203 +2,198 @@ using System;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public delegate void ContactDestroyedEventHandler(Object userPersistantData);
public delegate void ContactProcessedEventHandler(ManifoldPoint cp, CollisionObject body0, CollisionObject body1);
public delegate void ContactDestroyedEventHandler(Object userPersistantData);
public delegate void ContactProcessedEventHandler(ManifoldPoint cp, CollisionObject body0, CollisionObject body1);
public class PersistentManifold : IDisposable //: TypedObject
{
internal IntPtr _native;
private bool _preventDelete;
internal IntPtr Native;
private bool _preventDelete;
static ContactDestroyedEventHandler _contactDestroyed;
static ContactProcessedEventHandler _contactProcessed;
static ContactDestroyedUnmanagedDelegate _contactDestroyedUnmanaged;
static ContactProcessedUnmanagedDelegate _contactProcessedUnmanaged;
static IntPtr _contactDestroyedUnmanagedPtr;
static IntPtr _contactProcessedUnmanagedPtr;
private static ContactDestroyedEventHandler _contactDestroyed;
private static ContactProcessedEventHandler _contactProcessed;
private static ContactDestroyedUnmanagedDelegate _contactDestroyedUnmanaged;
private static ContactProcessedUnmanagedDelegate _contactProcessedUnmanaged;
private static IntPtr _contactDestroyedUnmanagedPtr;
private static IntPtr _contactProcessedUnmanagedPtr;
[UnmanagedFunctionPointer(Native.Conv), SuppressUnmanagedCodeSecurity]
private delegate bool ContactDestroyedUnmanagedDelegate(IntPtr userPersistantData);
[UnmanagedFunctionPointer(Native.Conv), SuppressUnmanagedCodeSecurity]
private delegate bool ContactProcessedUnmanagedDelegate(IntPtr cp, IntPtr body0, IntPtr body1);
[UnmanagedFunctionPointer(BulletSharp.Native.Conv), SuppressUnmanagedCodeSecurity]
private delegate bool ContactDestroyedUnmanagedDelegate(IntPtr userPersistantData);
[UnmanagedFunctionPointer(BulletSharp.Native.Conv), SuppressUnmanagedCodeSecurity]
private delegate bool ContactProcessedUnmanagedDelegate(IntPtr cp, IntPtr body0, IntPtr body1);
static bool ContactDestroyedUnmanaged(IntPtr userPersistentData)
{
_contactDestroyed.Invoke(GCHandle.FromIntPtr(userPersistentData).Target);
return false;
}
private static bool ContactDestroyedUnmanaged(IntPtr userPersistentData)
{
_contactDestroyed.Invoke(GCHandle.FromIntPtr(userPersistentData).Target);
return false;
}
static bool ContactProcessedUnmanaged(IntPtr cp, IntPtr body0, IntPtr body1)
{
_contactProcessed.Invoke(new ManifoldPoint(cp, true), CollisionObject.GetManaged(body0), CollisionObject.GetManaged(body1));
return false;
}
private static bool ContactProcessedUnmanaged(IntPtr cp, IntPtr body0, IntPtr body1)
{
_contactProcessed.Invoke(new ManifoldPoint(cp, true), CollisionObject.GetManaged(body0), CollisionObject.GetManaged(body1));
return false;
}
public static event ContactDestroyedEventHandler ContactDestroyed
{
add
{
if (_contactDestroyedUnmanaged == null)
{
_contactDestroyedUnmanaged = new ContactDestroyedUnmanagedDelegate(ContactDestroyedUnmanaged);
_contactDestroyedUnmanagedPtr = Marshal.GetFunctionPointerForDelegate(_contactDestroyedUnmanaged);
}
setGContactDestroyedCallback(_contactDestroyedUnmanagedPtr);
_contactDestroyed += value;
}
remove
{
_contactDestroyed -= value;
if (_contactDestroyed == null)
{
setGContactDestroyedCallback(IntPtr.Zero);
}
}
}
public static event ContactDestroyedEventHandler ContactDestroyed
{
add
{
if (_contactDestroyedUnmanaged == null)
{
_contactDestroyedUnmanaged = new ContactDestroyedUnmanagedDelegate(ContactDestroyedUnmanaged);
_contactDestroyedUnmanagedPtr = Marshal.GetFunctionPointerForDelegate(_contactDestroyedUnmanaged);
}
setGContactDestroyedCallback(_contactDestroyedUnmanagedPtr);
_contactDestroyed += value;
}
remove
{
_contactDestroyed -= value;
if (_contactDestroyed == null)
{
setGContactDestroyedCallback(IntPtr.Zero);
}
}
}
public static event ContactProcessedEventHandler ContactProcessed
{
add
{
if (_contactProcessedUnmanaged == null)
{
_contactProcessedUnmanaged = new ContactProcessedUnmanagedDelegate(ContactProcessedUnmanaged);
_contactProcessedUnmanagedPtr = Marshal.GetFunctionPointerForDelegate(_contactProcessedUnmanaged);
}
setGContactProcessedCallback(_contactProcessedUnmanagedPtr);
_contactProcessed += value;
}
remove
{
_contactProcessed -= value;
if (_contactProcessed == null)
{
setGContactProcessedCallback(IntPtr.Zero);
}
}
}
public static event ContactProcessedEventHandler ContactProcessed
{
add
{
if (_contactProcessedUnmanaged == null)
{
_contactProcessedUnmanaged = new ContactProcessedUnmanagedDelegate(ContactProcessedUnmanaged);
_contactProcessedUnmanagedPtr = Marshal.GetFunctionPointerForDelegate(_contactProcessedUnmanaged);
}
setGContactProcessedCallback(_contactProcessedUnmanagedPtr);
_contactProcessed += value;
}
remove
{
_contactProcessed -= value;
if (_contactProcessed == null)
{
setGContactProcessedCallback(IntPtr.Zero);
}
}
}
internal PersistentManifold(IntPtr native, bool preventDelete)
{
_native = native;
_preventDelete = preventDelete;
Native = native;
_preventDelete = preventDelete;
}
public PersistentManifold()
{
_native = btPersistentManifold_new();
Native = btPersistentManifold_new();
}
public PersistentManifold(CollisionObject body0, CollisionObject body1, int __unnamed2,
float contactBreakingThreshold, float contactProcessingThreshold)
{
_native = btPersistentManifold_new2(body0.Native, body1.Native, __unnamed2,
contactBreakingThreshold, contactProcessingThreshold);
Native = btPersistentManifold_new2(body0.Native, body1.Native, __unnamed2,
contactBreakingThreshold, contactProcessingThreshold);
}
public int AddManifoldPoint(ManifoldPoint newPoint, bool isPredictive = false)
{
return btPersistentManifold_addManifoldPoint(_native, newPoint.Native,
return btPersistentManifold_addManifoldPoint(Native, newPoint.Native,
isPredictive);
}
public void ClearManifold()
{
btPersistentManifold_clearManifold(_native);
btPersistentManifold_clearManifold(Native);
}
public void ClearUserCache(ManifoldPoint pt)
{
btPersistentManifold_clearUserCache(_native, pt.Native);
btPersistentManifold_clearUserCache(Native, pt.Native);
}
public int GetCacheEntry(ManifoldPoint newPoint)
{
return btPersistentManifold_getCacheEntry(_native, newPoint.Native);
return btPersistentManifold_getCacheEntry(Native, newPoint.Native);
}
public ManifoldPoint GetContactPoint(int index)
{
return new ManifoldPoint(btPersistentManifold_getContactPoint(_native, index), true);
return new ManifoldPoint(btPersistentManifold_getContactPoint(Native, index), true);
}
public void RefreshContactPointsRef(ref Matrix trA, ref Matrix trB)
{
btPersistentManifold_refreshContactPoints(_native, ref trA, ref trB);
}
public void RefreshContactPointsRef(ref Matrix trA, ref Matrix trB)
{
btPersistentManifold_refreshContactPoints(Native, ref trA, ref trB);
}
public void RefreshContactPoints(Matrix trA, Matrix trB)
{
btPersistentManifold_refreshContactPoints(_native, ref trA, ref trB);
btPersistentManifold_refreshContactPoints(Native, ref trA, ref trB);
}
public void RemoveContactPoint(int index)
{
btPersistentManifold_removeContactPoint(_native, index);
btPersistentManifold_removeContactPoint(Native, index);
}
public void ReplaceContactPoint(ManifoldPoint newPoint, int insertIndex)
{
btPersistentManifold_replaceContactPoint(_native, newPoint.Native, insertIndex);
btPersistentManifold_replaceContactPoint(Native, newPoint.Native, insertIndex);
}
public void SetBodies(CollisionObject body0, CollisionObject body1)
{
btPersistentManifold_setBodies(_native, body0.Native, body1.Native);
btPersistentManifold_setBodies(Native, body0.Native, body1.Native);
}
public bool ValidContactDistance(ManifoldPoint pt)
{
return btPersistentManifold_validContactDistance(_native, pt.Native);
return btPersistentManifold_validContactDistance(Native, pt.Native);
}
public CollisionObject Body0
{
get { return CollisionObject.GetManaged(btPersistentManifold_getBody0(_native)); }
}
public CollisionObject Body0 => CollisionObject.GetManaged(btPersistentManifold_getBody0(Native));
public CollisionObject Body1
{
get { return CollisionObject.GetManaged(btPersistentManifold_getBody1(_native)); }
}
public CollisionObject Body1 => CollisionObject.GetManaged(btPersistentManifold_getBody1(Native));
public int CompanionIdA
{
get { return btPersistentManifold_getCompanionIdA(_native); }
set { btPersistentManifold_setCompanionIdA(_native, value); }
get => btPersistentManifold_getCompanionIdA(Native);
set => btPersistentManifold_setCompanionIdA(Native, value);
}
public int CompanionIdB
{
get { return btPersistentManifold_getCompanionIdB(_native); }
set { btPersistentManifold_setCompanionIdB(_native, value); }
get => btPersistentManifold_getCompanionIdB(Native);
set => btPersistentManifold_setCompanionIdB(Native, value);
}
public float ContactBreakingThreshold
{
get { return btPersistentManifold_getContactBreakingThreshold(_native); }
set { btPersistentManifold_setContactBreakingThreshold(_native, value); }
get => btPersistentManifold_getContactBreakingThreshold(Native);
set => btPersistentManifold_setContactBreakingThreshold(Native, value);
}
public float ContactProcessingThreshold
{
get { return btPersistentManifold_getContactProcessingThreshold(_native); }
set { btPersistentManifold_setContactProcessingThreshold(_native, value); }
get => btPersistentManifold_getContactProcessingThreshold(Native);
set => btPersistentManifold_setContactProcessingThreshold(Native, value);
}
public int Index1A
{
get { return btPersistentManifold_getIndex1a(_native); }
set { btPersistentManifold_setIndex1a(_native, value); }
get => btPersistentManifold_getIndex1a(Native);
set => btPersistentManifold_setIndex1a(Native, value);
}
public int NumContacts
{
get { return btPersistentManifold_getNumContacts(_native); }
set { btPersistentManifold_setNumContacts(_native, value); }
get => btPersistentManifold_getNumContacts(Native);
set => btPersistentManifold_setNumContacts(Native, value);
}
public void Dispose()
@ -209,13 +204,13 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
if (!_preventDelete)
{
btPersistentManifold_delete(_native);
}
_native = IntPtr.Zero;
if (!_preventDelete)
{
btPersistentManifold_delete(Native);
}
Native = IntPtr.Zero;
}
}
@ -223,69 +218,5 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btPersistentManifold_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btPersistentManifold_new2(IntPtr body0, IntPtr body1, int __unnamed2, float contactBreakingThreshold, float contactProcessingThreshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btPersistentManifold_addManifoldPoint(IntPtr obj, IntPtr newPoint, bool isPredictive);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_clearManifold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_clearUserCache(IntPtr obj, IntPtr pt);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btPersistentManifold_getBody0(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btPersistentManifold_getBody1(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btPersistentManifold_getCacheEntry(IntPtr obj, IntPtr newPoint);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btPersistentManifold_getCompanionIdA(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btPersistentManifold_getCompanionIdB(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btPersistentManifold_getContactBreakingThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btPersistentManifold_getContactPoint(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btPersistentManifold_getContactProcessingThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btPersistentManifold_getIndex1a(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btPersistentManifold_getNumContacts(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_refreshContactPoints(IntPtr obj, [In] ref Matrix trA, [In] ref Matrix trB);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_removeContactPoint(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_replaceContactPoint(IntPtr obj, IntPtr newPoint, int insertIndex);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_setBodies(IntPtr obj, IntPtr body0, IntPtr body1);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_setCompanionIdA(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_setCompanionIdB(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_setContactBreakingThreshold(IntPtr obj, float contactBreakingThreshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_setContactProcessingThreshold(IntPtr obj, float contactProcessingThreshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_setIndex1a(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_setNumContacts(IntPtr obj, int cachedPoints);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btPersistentManifold_validContactDistance(IntPtr obj, IntPtr pt);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btPersistentManifold_delete(IntPtr obj);
//[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
//static extern IntPtr getGContactDestroyedCallback();
//[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
//static extern IntPtr getGContactProcessedCallback();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void setGContactDestroyedCallback(IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void setGContactProcessedCallback(IntPtr value);
}
}

Просмотреть файл

@ -2,6 +2,7 @@ using System;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
@ -19,27 +20,18 @@ namespace BulletSharp
_native = btQuantizedBvhNode_new();
}
public int EscapeIndex
{
get { return btQuantizedBvhNode_getEscapeIndex(_native); }
}
public int EscapeIndex => btQuantizedBvhNode_getEscapeIndex(_native);
public int EscapeIndexOrTriangleIndex
{
get { return btQuantizedBvhNode_getEscapeIndexOrTriangleIndex(_native); }
set { btQuantizedBvhNode_setEscapeIndexOrTriangleIndex(_native, value); }
get => btQuantizedBvhNode_getEscapeIndexOrTriangleIndex(_native);
set => btQuantizedBvhNode_setEscapeIndexOrTriangleIndex(_native, value);
}
public bool IsLeafNode
{
get { return btQuantizedBvhNode_isLeafNode(_native); }
}
public bool IsLeafNode => btQuantizedBvhNode_isLeafNode(_native);
public int PartId
{
get { return btQuantizedBvhNode_getPartId(_native); }
}
/*
public int PartId => btQuantizedBvhNode_getPartId(_native);
/*
public UShortArray QuantizedAabbMax
{
get { return btQuantizedBvhNode_getQuantizedAabbMax(_native); }
@ -49,11 +41,8 @@ namespace BulletSharp
{
get { return btQuantizedBvhNode_getQuantizedAabbMin(_native); }
}
*/
public int TriangleIndex
{
get { return btQuantizedBvhNode_getTriangleIndex(_native); }
}
*/
public int TriangleIndex => btQuantizedBvhNode_getTriangleIndex(_native);
public void Dispose()
{
@ -74,28 +63,6 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvhNode_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btQuantizedBvhNode_getEscapeIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btQuantizedBvhNode_getEscapeIndexOrTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btQuantizedBvhNode_getPartId(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvhNode_getQuantizedAabbMax(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvhNode_getQuantizedAabbMin(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btQuantizedBvhNode_getTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btQuantizedBvhNode_isLeafNode(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvhNode_setEscapeIndexOrTriangleIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvhNode_delete(IntPtr obj);
}
public class OptimizedBvhNode : IDisposable
@ -120,7 +87,7 @@ namespace BulletSharp
btOptimizedBvhNode_getAabbMaxOrg(_native, out value);
return value;
}
set { btOptimizedBvhNode_setAabbMaxOrg(_native, ref value); }
set => btOptimizedBvhNode_setAabbMaxOrg(_native, ref value);
}
public Vector3 AabbMinOrg
@ -131,25 +98,25 @@ namespace BulletSharp
btOptimizedBvhNode_getAabbMinOrg(_native, out value);
return value;
}
set { btOptimizedBvhNode_setAabbMinOrg(_native, ref value); }
set => btOptimizedBvhNode_setAabbMinOrg(_native, ref value);
}
public int EscapeIndex
{
get { return btOptimizedBvhNode_getEscapeIndex(_native); }
set { btOptimizedBvhNode_setEscapeIndex(_native, value); }
get => btOptimizedBvhNode_getEscapeIndex(_native);
set => btOptimizedBvhNode_setEscapeIndex(_native, value);
}
public int SubPart
{
get { return btOptimizedBvhNode_getSubPart(_native); }
set { btOptimizedBvhNode_setSubPart(_native, value); }
get => btOptimizedBvhNode_getSubPart(_native);
set => btOptimizedBvhNode_setSubPart(_native, value);
}
public int TriangleIndex
{
get { return btOptimizedBvhNode_getTriangleIndex(_native); }
set { btOptimizedBvhNode_setTriangleIndex(_native, value); }
get => btOptimizedBvhNode_getTriangleIndex(_native);
set => btOptimizedBvhNode_setTriangleIndex(_native, value);
}
public void Dispose()
@ -171,31 +138,6 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btOptimizedBvhNode_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_getAabbMaxOrg(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_getAabbMinOrg(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btOptimizedBvhNode_getEscapeIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btOptimizedBvhNode_getSubPart(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btOptimizedBvhNode_getTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_setAabbMaxOrg(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_setAabbMinOrg(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_setEscapeIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_setSubPart(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_setTriangleIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btOptimizedBvhNode_delete(IntPtr obj);
}
public abstract class NodeOverlapCallback : IDisposable
@ -231,16 +173,11 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btNodeOverlapCallback_processNode(IntPtr obj, int subPart, int triangleIndex);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btNodeOverlapCallback_delete(IntPtr obj);
}
public class QuantizedBvh : IDisposable
{
public enum TraversalMode
public enum TraversalMode
{
Stackless,
StacklessCacheFriendly,
@ -276,16 +213,16 @@ namespace BulletSharp
return btQuantizedBvh_calculateSerializeBufferSizeNew(_native);
}
public void DeSerializeDouble(IntPtr quantizedBvhDoubleData)
public void DeSerializeDouble(IntPtr quantizedBvhDoubleData)
{
btQuantizedBvh_deSerializeDouble(_native, quantizedBvhDoubleData);
}
public void DeSerializeFloat(IntPtr quantizedBvhFloatData)
public void DeSerializeFloat(IntPtr quantizedBvhFloatData)
{
btQuantizedBvh_deSerializeFloat(_native, quantizedBvhFloatData);
}
/*
/*
public static QuantizedBvh DeSerializeInPlace(IntPtr alignedDataBuffer, uint dataBufferSize,
bool swapEndian)
{
@ -302,7 +239,7 @@ namespace BulletSharp
{
btQuantizedBvh_quantizeWithClamp(_native, out._native, ref point2, isMax);
}
*/
*/
public void ReportAabbOverlappingNodex(NodeOverlapCallback nodeCallback,
Vector3 aabbMin, Vector3 aabbMax)
{
@ -346,24 +283,18 @@ namespace BulletSharp
{
btQuantizedBvh_setTraversalMode(_native, traversalMode);
}
/*
/*
public Vector3 UnQuantize(unsigned short vecIn)
{
Vector3 value;
btQuantizedBvh_unQuantize(_native, vecIn._native, out value);
return value;
}
*/
public static uint AlignmentSerializationPadding
{
get { return btQuantizedBvh_getAlignmentSerializationPadding(); }
}
*/
public static uint AlignmentSerializationPadding => btQuantizedBvh_getAlignmentSerializationPadding();
public bool IsQuantized
{
get { return btQuantizedBvh_isQuantized(_native); }
}
/*
public bool IsQuantized => btQuantizedBvh_isQuantized(_native);
/*
public QuantizedNodeArray LeafNodeArray
{
get { return btQuantizedBvh_getLeafNodeArray(_native); }
@ -378,7 +309,7 @@ namespace BulletSharp
{
get { return btQuantizedBvh_getSubtreeInfoArray(_native); }
}
*/
*/
public void Dispose()
{
Dispose(true);
@ -401,73 +332,24 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvh_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_buildInternal(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern uint btQuantizedBvh_calculateSerializeBufferSize(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btQuantizedBvh_calculateSerializeBufferSizeNew(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_deSerializeDouble(IntPtr obj, IntPtr quantizedBvhDoubleData);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_deSerializeFloat(IntPtr obj, IntPtr quantizedBvhFloatData);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvh_deSerializeInPlace(IntPtr i_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern uint btQuantizedBvh_getAlignmentSerializationPadding();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvh_getLeafNodeArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvh_getQuantizedNodeArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvh_getSubtreeInfoArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btQuantizedBvh_isQuantized(IntPtr obj);
//[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
//static extern void btQuantizedBvh_quantize(IntPtr obj, IntPtr out, [In] ref Vector3 point, int isMax);
//[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
//static extern void btQuantizedBvh_quantizeWithClamp(IntPtr obj, IntPtr out, [In] ref Vector3 point2, int isMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_reportAabbOverlappingNodex(IntPtr obj, IntPtr nodeCallback, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_reportBoxCastOverlappingNodex(IntPtr obj, IntPtr nodeCallback, [In] ref Vector3 raySource, [In] ref Vector3 rayTarget, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_reportRayOverlappingNodex(IntPtr obj, IntPtr nodeCallback, [In] ref Vector3 raySource, [In] ref Vector3 rayTarget);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btQuantizedBvh_serialize(IntPtr obj, IntPtr o_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btQuantizedBvh_serialize2(IntPtr obj, IntPtr dataBuffer, IntPtr serializer);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_setQuantizationValues(IntPtr obj, [In] ref Vector3 bvhAabbMin, [In] ref Vector3 bvhAabbMax, float quantizationMargin);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_setTraversalMode(IntPtr obj, TraversalMode traversalMode);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_unQuantize(IntPtr obj, IntPtr vecIn, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btQuantizedBvh_delete(IntPtr obj);
}
[StructLayout(LayoutKind.Sequential)]
internal struct QuantizedBvhFloatData
{
public Vector3FloatData BvhAabbMin;
public Vector3FloatData BvhAabbMax;
public Vector3FloatData BvhQuantization;
public int CurNodeIndex;
public int UseQuantization;
public int NumContiguousLeafNodes;
public int NumQuantizedContiguousNodes;
public IntPtr ContiguousNodesPtr;
public IntPtr QuantizedContiguousNodesPtr;
public IntPtr SubTreeInfoPtr;
public int TraversalMode;
public int NumSubtreeHeaders;
[StructLayout(LayoutKind.Sequential)]
internal struct QuantizedBvhFloatData
{
public Vector3FloatData BvhAabbMin;
public Vector3FloatData BvhAabbMax;
public Vector3FloatData BvhQuantization;
public int CurNodeIndex;
public int UseQuantization;
public int NumContiguousLeafNodes;
public int NumQuantizedContiguousNodes;
public IntPtr ContiguousNodesPtr;
public IntPtr QuantizedContiguousNodesPtr;
public IntPtr SubTreeInfoPtr;
public int TraversalMode;
public int NumSubtreeHeaders;
public static int Offset(string fieldName) { return Marshal.OffsetOf(typeof(QuantizedBvhFloatData), fieldName).ToInt32(); }
}
public static int Offset(string fieldName) { return Marshal.OffsetOf(typeof(QuantizedBvhFloatData), fieldName).ToInt32(); }
}
}

Просмотреть файл

@ -5,7 +5,7 @@ namespace BulletSharp
{
public class ShapeHull : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
private ConvexShape _shape;
private UIntArray _indices;
@ -13,16 +13,16 @@ namespace BulletSharp
public ShapeHull(ConvexShape shape)
{
_native = btShapeHull_new(shape.Native);
Native = btShapeHull_new(shape.Native);
_shape = shape;
}
public bool BuildHull(float margin)
{
return btShapeHull_buildHull(_native, margin);
return btShapeHull_buildHull(Native, margin);
}
public IntPtr IndexPointer => btShapeHull_getIndexPointer(_native);
public IntPtr IndexPointer => btShapeHull_getIndexPointer(Native);
public UIntArray Indices
{
@ -36,13 +36,13 @@ namespace BulletSharp
}
}
public int NumIndices => btShapeHull_numIndices(_native);
public int NumIndices => btShapeHull_numIndices(Native);
public int NumTriangles => btShapeHull_numTriangles(_native);
public int NumTriangles => btShapeHull_numTriangles(Native);
public int NumVertices => btShapeHull_numVertices(_native);
public int NumVertices => btShapeHull_numVertices(Native);
public IntPtr VertexPointer => btShapeHull_getVertexPointer(_native);
public IntPtr VertexPointer => btShapeHull_getVertexPointer(Native);
public Vector3Array Vertices
{
@ -64,10 +64,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btShapeHull_delete(_native);
_native = IntPtr.Zero;
btShapeHull_delete(Native);
Native = IntPtr.Zero;
}
}

Просмотреть файл

@ -1,6 +1,5 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
@ -8,20 +7,20 @@ namespace BulletSharp
{
public abstract class IslandCallback : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
internal IslandCallback(IntPtr native)
{
_native = native;
Native = native;
}
/*
/*
public void ProcessIsland(CollisionObject bodies, int numBodies, PersistentManifold manifolds,
int numManifolds, int islandId)
{
btSimulationIslandManager_IslandCallback_processIsland(_native, bodies._native,
numBodies, manifolds._native, numManifolds, islandId);
btSimulationIslandManager_IslandCallback_processIsland(Native, bodies.Native,
numBodies, manifolds.Native, numManifolds, islandId);
}
*/
*/
public void Dispose()
{
Dispose(true);
@ -30,10 +29,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btSimulationIslandManager_IslandCallback_delete(_native);
_native = IntPtr.Zero;
btSimulationIslandManager_IslandCallback_delete(Native);
Native = IntPtr.Zero;
}
}
@ -41,70 +40,62 @@ namespace BulletSharp
{
Dispose(false);
}
//[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
//static extern void btSimulationIslandManager_IslandCallback_processIsland(IntPtr obj, IntPtr bodies, int numBodies, IntPtr manifolds, int numManifolds, int islandId);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_IslandCallback_delete(IntPtr obj);
}
internal IntPtr _native;
internal IntPtr Native;
bool _preventDelete;
internal SimulationIslandManager(IntPtr native, bool preventDelete)
{
_native = native;
Native = native;
_preventDelete = preventDelete;
}
public SimulationIslandManager()
{
_native = btSimulationIslandManager_new();
Native = btSimulationIslandManager_new();
}
public void BuildAndProcessIslands(Dispatcher dispatcher, CollisionWorld collisionWorld,
IslandCallback callback)
{
btSimulationIslandManager_buildAndProcessIslands(_native, dispatcher.Native,
collisionWorld.Native, callback._native);
btSimulationIslandManager_buildAndProcessIslands(Native, dispatcher.Native,
collisionWorld.Native, callback.Native);
}
public void BuildIslands(Dispatcher dispatcher, CollisionWorld colWorld)
{
btSimulationIslandManager_buildIslands(_native, dispatcher.Native, colWorld.Native);
btSimulationIslandManager_buildIslands(Native, dispatcher.Native, colWorld.Native);
}
public void FindUnions(Dispatcher dispatcher, CollisionWorld colWorld)
{
btSimulationIslandManager_findUnions(_native, dispatcher.Native, colWorld.Native);
btSimulationIslandManager_findUnions(Native, dispatcher.Native, colWorld.Native);
}
public void InitUnionFind(int n)
{
btSimulationIslandManager_initUnionFind(_native, n);
btSimulationIslandManager_initUnionFind(Native, n);
}
public void StoreIslandActivationState(CollisionWorld world)
{
btSimulationIslandManager_storeIslandActivationState(_native, world.Native);
btSimulationIslandManager_storeIslandActivationState(Native, world.Native);
}
public void UpdateActivationState(CollisionWorld colWorld, Dispatcher dispatcher)
{
btSimulationIslandManager_updateActivationState(_native, colWorld.Native,
btSimulationIslandManager_updateActivationState(Native, colWorld.Native,
dispatcher.Native);
}
public bool SplitIslands
{
get { return btSimulationIslandManager_getSplitIslands(_native); }
set { btSimulationIslandManager_setSplitIslands(_native, value); }
get => btSimulationIslandManager_getSplitIslands(Native);
set => btSimulationIslandManager_setSplitIslands(Native, value);
}
public UnionFind UnionFind
{
get { return new UnionFind(btSimulationIslandManager_getUnionFind(_native)); }
}
public UnionFind UnionFind => new UnionFind(btSimulationIslandManager_getUnionFind(Native));
public void Dispose()
{
@ -114,13 +105,13 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
if (!_preventDelete)
{
btSimulationIslandManager_delete(_native);
btSimulationIslandManager_delete(Native);
}
_native = IntPtr.Zero;
Native = IntPtr.Zero;
}
}
@ -128,29 +119,5 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btSimulationIslandManager_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_buildAndProcessIslands(IntPtr obj, IntPtr dispatcher, IntPtr collisionWorld, IntPtr callback);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_buildIslands(IntPtr obj, IntPtr dispatcher, IntPtr colWorld);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_findUnions(IntPtr obj, IntPtr dispatcher, IntPtr colWorld);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btSimulationIslandManager_getSplitIslands(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btSimulationIslandManager_getUnionFind(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_initUnionFind(IntPtr obj, int n);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_setSplitIslands(IntPtr obj, bool doSplitIslands);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_storeIslandActivationState(IntPtr obj, IntPtr world);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_updateActivationState(IntPtr obj, IntPtr colWorld, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSimulationIslandManager_delete(IntPtr obj);
}
}

Просмотреть файл

@ -32,7 +32,7 @@ namespace BulletSharp
public SphereBoxCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, bool isSwapped)
: base(btSphereBoxCollisionAlgorithm_new(mf._native, ci.Native, body0Wrap.Native,
: base(btSphereBoxCollisionAlgorithm_new(mf.Native, ci.Native, body0Wrap.Native,
body1Wrap.Native, isSwapped))
{
}

Просмотреть файл

@ -31,7 +31,7 @@ namespace BulletSharp
public SphereSphereCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper col0Wrap, CollisionObjectWrapper col1Wrap)
: base(btSphereSphereCollisionAlgorithm_new(mf._native, ci.Native, col0Wrap.Native,
: base(btSphereSphereCollisionAlgorithm_new(mf.Native, ci.Native, col0Wrap.Native,
col1Wrap.Native))
{
}

Просмотреть файл

@ -31,7 +31,7 @@ namespace BulletSharp
public SphereTriangleCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap, bool swapped)
: base(btSphereTriangleCollisionAlgorithm_new(mf._native, ci.Native,
: base(btSphereTriangleCollisionAlgorithm_new(mf.Native, ci.Native,
body0Wrap.Native, body1Wrap.Native, swapped))
{
}

Просмотреть файл

@ -1,60 +1,60 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using System.IO;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public class StridingMeshInterface : IDisposable // abstract
public class StridingMeshInterface : IDisposable // abstract
{
internal IntPtr _native;
internal IntPtr Native;
internal StridingMeshInterface(IntPtr native)
{
_native = native;
Native = native;
}
public unsafe UnmanagedMemoryStream GetIndexStream(int subpart = 0)
{
IntPtr vertexBase, indexBase;
int numVerts, numFaces;
PhyScalarType vertsType, indicesType;
int vertexStride, indexStride;
btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(_native, out vertexBase, out numVerts, out vertsType, out vertexStride, out indexBase, out indexStride, out numFaces, out indicesType, subpart);
public unsafe UnmanagedMemoryStream GetIndexStream(int subpart = 0)
{
IntPtr vertexBase, indexBase;
int numVerts, numFaces;
PhyScalarType vertsType, indicesType;
int vertexStride, indexStride;
btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(Native, out vertexBase, out numVerts, out vertsType, out vertexStride, out indexBase, out indexStride, out numFaces, out indicesType, subpart);
int length = numFaces * indexStride;
return new UnmanagedMemoryStream((byte*)indexBase.ToPointer(), length, length, FileAccess.ReadWrite);
}
int length = numFaces * indexStride;
return new UnmanagedMemoryStream((byte*)indexBase.ToPointer(), length, length, FileAccess.ReadWrite);
}
public unsafe UnmanagedMemoryStream GetVertexStream(int subpart = 0)
{
IntPtr vertexBase, indexBase;
int numVerts, numFaces;
PhyScalarType vertsType, indicesType;
int vertexStride, indexStride;
btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(_native, out vertexBase, out numVerts, out vertsType, out vertexStride, out indexBase, out indexStride, out numFaces, out indicesType, subpart);
public unsafe UnmanagedMemoryStream GetVertexStream(int subpart = 0)
{
IntPtr vertexBase, indexBase;
int numVerts, numFaces;
PhyScalarType vertsType, indicesType;
int vertexStride, indexStride;
btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(Native, out vertexBase, out numVerts, out vertsType, out vertexStride, out indexBase, out indexStride, out numFaces, out indicesType, subpart);
int length = numVerts * vertexStride;
return new UnmanagedMemoryStream((byte*)vertexBase.ToPointer(), length, length, FileAccess.ReadWrite);
}
int length = numVerts * vertexStride;
return new UnmanagedMemoryStream((byte*)vertexBase.ToPointer(), length, length, FileAccess.ReadWrite);
}
public void CalculateAabbBruteForce(out Vector3 aabbMin, out Vector3 aabbMax)
{
btStridingMeshInterface_calculateAabbBruteForce(_native, out aabbMin,
btStridingMeshInterface_calculateAabbBruteForce(Native, out aabbMin,
out aabbMax);
}
public int CalculateSerializeBufferSize()
{
return btStridingMeshInterface_calculateSerializeBufferSize(_native);
return btStridingMeshInterface_calculateSerializeBufferSize(Native);
}
public void GetLockedReadOnlyVertexIndexBase(out IntPtr vertexBase, out int numVerts,
out PhyScalarType type, out int vertexStride, out IntPtr indexbase, out int indexStride,
out int numFaces, out PhyScalarType indicesType, int subpart = 0)
{
btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(_native, out vertexBase,
btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(Native, out vertexBase,
out numVerts, out type, out vertexStride, out indexbase, out indexStride,
out numFaces, out indicesType, subpart);
}
@ -63,78 +63,72 @@ namespace BulletSharp
out PhyScalarType type, out int vertexStride, out IntPtr indexbase, out int indexStride,
out int numFaces, out PhyScalarType indicesType, int subpart = 0)
{
btStridingMeshInterface_getLockedVertexIndexBase(_native, out vertexBase,
btStridingMeshInterface_getLockedVertexIndexBase(Native, out vertexBase,
out numVerts, out type, out vertexStride, out indexbase, out indexStride,
out numFaces, out indicesType, subpart);
}
public void GetPremadeAabb(out Vector3 aabbMin, out Vector3 aabbMax)
{
btStridingMeshInterface_getPremadeAabb(_native, out aabbMin, out aabbMax);
btStridingMeshInterface_getPremadeAabb(Native, out aabbMin, out aabbMax);
}
public void InternalProcessAllTriangles(InternalTriangleIndexCallback callback,
Vector3 aabbMin, Vector3 aabbMax)
{
btStridingMeshInterface_InternalProcessAllTriangles(_native, callback._native,
btStridingMeshInterface_InternalProcessAllTriangles(Native, callback._native,
ref aabbMin, ref aabbMax);
}
public void PreallocateIndices(int numIndices)
{
btStridingMeshInterface_preallocateIndices(_native, numIndices);
btStridingMeshInterface_preallocateIndices(Native, numIndices);
}
public void PreallocateVertices(int numVerts)
{
btStridingMeshInterface_preallocateVertices(_native, numVerts);
btStridingMeshInterface_preallocateVertices(Native, numVerts);
}
public string Serialize(IntPtr dataBuffer, Serializer serializer)
{
return Marshal.PtrToStringAnsi(btStridingMeshInterface_serialize(_native, dataBuffer, serializer._native));
return Marshal.PtrToStringAnsi(btStridingMeshInterface_serialize(Native, dataBuffer, serializer._native));
}
public void SetPremadeAabb(ref Vector3 aabbMin, ref Vector3 aabbMax)
{
btStridingMeshInterface_setPremadeAabb(_native, ref aabbMin, ref aabbMax);
}
public void SetPremadeAabb(ref Vector3 aabbMin, ref Vector3 aabbMax)
{
btStridingMeshInterface_setPremadeAabb(Native, ref aabbMin, ref aabbMax);
}
public void SetPremadeAabb(Vector3 aabbMin, Vector3 aabbMax)
{
btStridingMeshInterface_setPremadeAabb(_native, ref aabbMin, ref aabbMax);
btStridingMeshInterface_setPremadeAabb(Native, ref aabbMin, ref aabbMax);
}
public void UnLockReadOnlyVertexBase(int subpart)
{
btStridingMeshInterface_unLockReadOnlyVertexBase(_native, subpart);
btStridingMeshInterface_unLockReadOnlyVertexBase(Native, subpart);
}
public void UnLockVertexBase(int subpart)
{
btStridingMeshInterface_unLockVertexBase(_native, subpart);
btStridingMeshInterface_unLockVertexBase(Native, subpart);
}
public bool HasPremadeAabb
{
get { return btStridingMeshInterface_hasPremadeAabb(_native); }
}
public bool HasPremadeAabb => btStridingMeshInterface_hasPremadeAabb(Native);
public int NumSubParts
{
get { return btStridingMeshInterface_getNumSubParts(_native); }
}
public int NumSubParts => btStridingMeshInterface_getNumSubParts(Native);
public Vector3 Scaling
{
get
{
Vector3 value;
btStridingMeshInterface_getScaling(_native, out value);
btStridingMeshInterface_getScaling(Native, out value);
return value;
}
set { btStridingMeshInterface_setScaling(_native, ref value); }
}
set => btStridingMeshInterface_setScaling(Native, ref value);
}
public void Dispose()
{
@ -144,10 +138,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btStridingMeshInterface_delete(_native);
_native = IntPtr.Zero;
btStridingMeshInterface_delete(Native);
Native = IntPtr.Zero;
}
}
@ -155,67 +149,31 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_calculateAabbBruteForce(IntPtr obj, out Vector3 aabbMin, out Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btStridingMeshInterface_calculateSerializeBufferSize(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(IntPtr obj, out IntPtr vertexbase, out int numverts, out PhyScalarType type, out int vertexStride, out IntPtr indexbase, out int indexstride, out int numfaces, out PhyScalarType indicestype, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_getLockedVertexIndexBase(IntPtr obj, out IntPtr vertexbase, out int numverts, out PhyScalarType type, out int vertexStride, out IntPtr indexbase, out int indexstride, out int numfaces, out PhyScalarType indicestype, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btStridingMeshInterface_getNumSubParts(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_getPremadeAabb(IntPtr obj, out Vector3 aabbMin, out Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_getScaling(IntPtr obj, out Vector3 scaling);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btStridingMeshInterface_hasPremadeAabb(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_InternalProcessAllTriangles(IntPtr obj, IntPtr callback, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_preallocateIndices(IntPtr obj, int numindices);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_preallocateVertices(IntPtr obj, int numverts);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btStridingMeshInterface_serialize(IntPtr obj, IntPtr dataBuffer, IntPtr serializer);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_setPremadeAabb(IntPtr obj, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_setScaling(IntPtr obj, [In] ref Vector3 scaling);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_unLockReadOnlyVertexBase(IntPtr obj, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_unLockVertexBase(IntPtr obj, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btStridingMeshInterface_delete(IntPtr obj);
}
[StructLayout(LayoutKind.Sequential)]
internal struct MeshPartData
{
public IntPtr Vertices3F;
public IntPtr Vertices3D;
public IntPtr Indices32;
public IntPtr Indices16;
public IntPtr Indices8;
public IntPtr Indices16_2;
public int NumTriangles;
public int NumVertices;
[StructLayout(LayoutKind.Sequential)]
internal struct MeshPartData
{
public IntPtr Vertices3F;
public IntPtr Vertices3D;
public IntPtr Indices32;
public IntPtr Indices16;
public IntPtr Indices8;
public IntPtr Indices16_2;
public int NumTriangles;
public int NumVertices;
public static int Offset(string fieldName) { return Marshal.OffsetOf(typeof(MeshPartData), fieldName).ToInt32(); }
}
public static int Offset(string fieldName) { return Marshal.OffsetOf(typeof(MeshPartData), fieldName).ToInt32(); }
}
[StructLayout(LayoutKind.Sequential)]
internal struct StridingMeshInterfaceData
{
public IntPtr MeshPartsPtr;
public Vector3FloatData Scaling;
public int NumMeshParts;
public int Padding;
[StructLayout(LayoutKind.Sequential)]
internal struct StridingMeshInterfaceData
{
public IntPtr MeshPartsPtr;
public Vector3FloatData Scaling;
public int NumMeshParts;
public int Padding;
public static int Offset(string fieldName) { return Marshal.OffsetOf(typeof(StridingMeshInterfaceData), fieldName).ToInt32(); }
}
public static int Offset(string fieldName) { return Marshal.OffsetOf(typeof(StridingMeshInterfaceData), fieldName).ToInt32(); }
}
}

Просмотреть файл

@ -2,35 +2,36 @@ using System;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public class Triangle : IDisposable
{
internal IntPtr _native;
private bool _preventDelete;
internal IntPtr Native;
private bool _preventDelete;
internal Triangle(IntPtr native, bool preventDelete)
{
_native = native;
_preventDelete = preventDelete;
Native = native;
_preventDelete = preventDelete;
}
public Triangle()
{
_native = btTriangle_new();
Native = btTriangle_new();
}
public int PartId
{
get { return btTriangle_getPartId(_native); }
set { btTriangle_setPartId(_native, value); }
get => btTriangle_getPartId(Native);
set => btTriangle_setPartId(Native, value);
}
public int TriangleIndex
{
get { return btTriangle_getTriangleIndex(_native); }
set { btTriangle_setTriangleIndex(_native, value); }
get => btTriangle_getTriangleIndex(Native);
set => btTriangle_setTriangleIndex(Native, value);
}
public Vector3 Vertex0
@ -38,10 +39,10 @@ namespace BulletSharp
get
{
Vector3 value;
btTriangle_getVertex0(_native, out value);
btTriangle_getVertex0(Native, out value);
return value;
}
set { btTriangle_setVertex0(_native, ref value); }
set => btTriangle_setVertex0(Native, ref value);
}
public Vector3 Vertex1
@ -49,10 +50,10 @@ namespace BulletSharp
get
{
Vector3 value;
btTriangle_getVertex1(_native, out value);
btTriangle_getVertex1(Native, out value);
return value;
}
set { btTriangle_setVertex1(_native, ref value); }
set => btTriangle_setVertex1(Native, ref value);
}
public Vector3 Vertex2
@ -60,10 +61,10 @@ namespace BulletSharp
get
{
Vector3 value;
btTriangle_getVertex2(_native, out value);
btTriangle_getVertex2(Native, out value);
return value;
}
set { btTriangle_setVertex2(_native, ref value); }
set => btTriangle_setVertex2(Native, ref value);
}
public void Dispose()
@ -74,13 +75,13 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
if (!_preventDelete)
{
btTriangle_delete(_native);
}
_native = IntPtr.Zero;
if (!_preventDelete)
{
btTriangle_delete(Native);
}
Native = IntPtr.Zero;
}
}
@ -88,72 +89,35 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangle_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btTriangle_getPartId(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btTriangle_getTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_getVertex0(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_getVertex1(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_getVertex2(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_setPartId(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_setTriangleIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_setVertex0(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_setVertex1(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_setVertex2(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangle_delete(IntPtr obj);
}
public class TriangleBuffer : TriangleCallback
{
/*
/*
public TriangleBuffer()
: base(btTriangleBuffer_new())
{
}
*/
public TriangleBuffer()
{
}
*/
public TriangleBuffer()
{
}
public void ClearBuffer()
{
btTriangleBuffer_clearBuffer(_native);
btTriangleBuffer_clearBuffer(Native);
}
public Triangle GetTriangle(int index)
{
return new Triangle(btTriangleBuffer_getTriangle(_native, index), true);
return new Triangle(btTriangleBuffer_getTriangle(Native, index), true);
}
public override void ProcessTriangle(ref Vector3 vector0, ref Vector3 vector1, ref Vector3 vector2, int partId, int triangleIndex)
{
throw new NotImplementedException();
}
public int NumTriangles
public override void ProcessTriangle(ref Vector3 vector0, ref Vector3 vector1, ref Vector3 vector2, int partId, int triangleIndex)
{
get { return btTriangleBuffer_getNumTriangles(_native); }
throw new NotImplementedException();
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleBuffer_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleBuffer_clearBuffer(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btTriangleBuffer_getNumTriangles(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleBuffer_getTriangle(IntPtr obj, int index);
public int NumTriangles => btTriangleBuffer_getNumTriangles(Native);
}
}

Просмотреть файл

@ -2,37 +2,38 @@ using System;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public abstract class TriangleCallback : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
[UnmanagedFunctionPointer(Native.Conv), SuppressUnmanagedCodeSecurity]
delegate void ProcessTriangleDelegate(IntPtr triangle, int partId, int triangleIndex);
[UnmanagedFunctionPointer(BulletSharp.Native.Conv), SuppressUnmanagedCodeSecurity]
private delegate void ProcessTriangleDelegate(IntPtr triangle, int partId, int triangleIndex);
ProcessTriangleDelegate _processTriangle;
private ProcessTriangleDelegate _processTriangle;
public TriangleCallback()
{
_processTriangle = new ProcessTriangleDelegate(ProcessTriangleUnmanaged);
public TriangleCallback()
{
_processTriangle = new ProcessTriangleDelegate(ProcessTriangleUnmanaged);
_native = btTriangleCallbackWrapper_new(
Marshal.GetFunctionPointerForDelegate(_processTriangle));
}
Native = btTriangleCallbackWrapper_new(
Marshal.GetFunctionPointerForDelegate(_processTriangle));
}
private void ProcessTriangleUnmanaged(IntPtr triangle, int partId, int triangleIndex)
{
float[] triangleData = new float[11];
Marshal.Copy(triangle, triangleData, 0, 11);
Vector3 p0 = new Vector3(triangleData[0], triangleData[1], triangleData[2]);
Vector3 p1 = new Vector3(triangleData[4], triangleData[5], triangleData[6]);
Vector3 p2 = new Vector3(triangleData[8], triangleData[9], triangleData[10]);
ProcessTriangle(ref p0, ref p1, ref p2, partId, triangleIndex);
}
private void ProcessTriangleUnmanaged(IntPtr triangle, int partId, int triangleIndex)
{
float[] triangleData = new float[11];
Marshal.Copy(triangle, triangleData, 0, 11);
Vector3 p0 = new Vector3(triangleData[0], triangleData[1], triangleData[2]);
Vector3 p1 = new Vector3(triangleData[4], triangleData[5], triangleData[6]);
Vector3 p2 = new Vector3(triangleData[8], triangleData[9], triangleData[10]);
ProcessTriangle(ref p0, ref p1, ref p2, partId, triangleIndex);
}
public abstract void ProcessTriangle(ref Vector3 point0, ref Vector3 point1, ref Vector3 point2, int partId, int triangleIndex);
public abstract void ProcessTriangle(ref Vector3 point0, ref Vector3 point1, ref Vector3 point2, int partId, int triangleIndex);
public void Dispose()
{
@ -42,10 +43,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btTriangleCallback_delete(_native);
_native = IntPtr.Zero;
btTriangleCallback_delete(Native);
Native = IntPtr.Zero;
}
}
@ -53,41 +54,36 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleCallbackWrapper_new(IntPtr internalProcessTriangleIndexCallback);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleCallback_delete(IntPtr obj);
}
public abstract class InternalTriangleIndexCallback : IDisposable
{
internal IntPtr _native;
[UnmanagedFunctionPointer(Native.Conv), SuppressUnmanagedCodeSecurity]
delegate void InternalProcessTriangleIndexDelegate(IntPtr triangle, int partId, int triangleIndex);
[UnmanagedFunctionPointer(Native.Conv), SuppressUnmanagedCodeSecurity]
delegate void InternalProcessTriangleIndexDelegate(IntPtr triangle, int partId, int triangleIndex);
InternalProcessTriangleIndexDelegate _internalProcessTriangleIndex;
InternalProcessTriangleIndexDelegate _internalProcessTriangleIndex;
internal InternalTriangleIndexCallback()
{
_internalProcessTriangleIndex = new InternalProcessTriangleIndexDelegate(InternalProcessTriangleIndexUnmanaged);
_internalProcessTriangleIndex = new InternalProcessTriangleIndexDelegate(InternalProcessTriangleIndexUnmanaged);
_native = btInternalTriangleIndexCallbackWrapper_new(
Marshal.GetFunctionPointerForDelegate(_internalProcessTriangleIndex));
_native = btInternalTriangleIndexCallbackWrapper_new(
Marshal.GetFunctionPointerForDelegate(_internalProcessTriangleIndex));
}
private void InternalProcessTriangleIndexUnmanaged(IntPtr triangle, int partId, int triangleIndex)
{
float[] triangleData = new float[11];
Marshal.Copy(triangle, triangleData, 0, 11);
Vector3 p0 = new Vector3(triangleData[0], triangleData[1], triangleData[2]);
Vector3 p1 = new Vector3(triangleData[4], triangleData[5], triangleData[6]);
Vector3 p2 = new Vector3(triangleData[8], triangleData[9], triangleData[10]);
InternalProcessTriangleIndex(ref p0, ref p1, ref p2, partId, triangleIndex);
}
private void InternalProcessTriangleIndexUnmanaged(IntPtr triangle, int partId, int triangleIndex)
{
float[] triangleData = new float[11];
Marshal.Copy(triangle, triangleData, 0, 11);
Vector3 p0 = new Vector3(triangleData[0], triangleData[1], triangleData[2]);
Vector3 p1 = new Vector3(triangleData[4], triangleData[5], triangleData[6]);
Vector3 p2 = new Vector3(triangleData[8], triangleData[9], triangleData[10]);
InternalProcessTriangleIndex(ref p0, ref p1, ref p2, partId, triangleIndex);
}
public abstract void InternalProcessTriangleIndex(ref Vector3 point0, ref Vector3 point1, ref Vector3 point2, int partId, int triangleIndex);
public abstract void InternalProcessTriangleIndex(ref Vector3 point0, ref Vector3 point1, ref Vector3 point2, int partId, int triangleIndex);
public void Dispose()
{
@ -108,10 +104,5 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btInternalTriangleIndexCallbackWrapper_new(IntPtr internalProcessTriangleIndexCallback);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btInternalTriangleIndexCallback_delete(IntPtr obj);
}
}

Просмотреть файл

@ -2,8 +2,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
@ -21,7 +21,7 @@ namespace BulletSharp
public IndexedMesh()
{
Native = UnsafeNativeMethods.btIndexedMesh_new();
Native = btIndexedMesh_new();
}
public void Allocate(int numTriangles, int numVertices, int triangleIndexStride = sizeof(int) * 3, int vertexStride = sizeof(float) * 3)
@ -77,7 +77,7 @@ namespace BulletSharp
public unsafe UnmanagedMemoryStream GetVertexStream()
{
int length = NumVertices * VertexStride;
return new UnmanagedMemoryStream((byte*)UnsafeNativeMethods.btIndexedMesh_getVertexBase(Native).ToPointer(), length, length, FileAccess.ReadWrite);
return new UnmanagedMemoryStream((byte*)btIndexedMesh_getVertexBase(Native).ToPointer(), length, length, FileAccess.ReadWrite);
}
public void SetData(ICollection<int> triangles, ICollection<float> vertices)
@ -122,50 +122,50 @@ namespace BulletSharp
public PhyScalarType IndexType
{
get { return UnsafeNativeMethods.btIndexedMesh_getIndexType(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setIndexType(Native, value); }
get => btIndexedMesh_getIndexType(Native);
set => btIndexedMesh_setIndexType(Native, value);
}
public int NumTriangles
{
get { return UnsafeNativeMethods.btIndexedMesh_getNumTriangles(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setNumTriangles(Native, value); }
get => btIndexedMesh_getNumTriangles(Native);
set => btIndexedMesh_setNumTriangles(Native, value);
}
public int NumVertices
{
get { return UnsafeNativeMethods.btIndexedMesh_getNumVertices(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setNumVertices(Native, value); }
get => btIndexedMesh_getNumVertices(Native);
set => btIndexedMesh_setNumVertices(Native, value);
}
public IntPtr TriangleIndexBase
{
get { return UnsafeNativeMethods.btIndexedMesh_getTriangleIndexBase(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setTriangleIndexBase(Native, value); }
get => btIndexedMesh_getTriangleIndexBase(Native);
set => btIndexedMesh_setTriangleIndexBase(Native, value);
}
public int TriangleIndexStride
{
get { return UnsafeNativeMethods.btIndexedMesh_getTriangleIndexStride(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setTriangleIndexStride(Native, value); }
get => btIndexedMesh_getTriangleIndexStride(Native);
set => btIndexedMesh_setTriangleIndexStride(Native, value);
}
public IntPtr VertexBase
{
get { return UnsafeNativeMethods.btIndexedMesh_getVertexBase(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setVertexBase(Native, value); }
get => btIndexedMesh_getVertexBase(Native);
set => btIndexedMesh_setVertexBase(Native, value);
}
public int VertexStride
{
get { return UnsafeNativeMethods.btIndexedMesh_getVertexStride(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setVertexStride(Native, value); }
get => btIndexedMesh_getVertexStride(Native);
set => btIndexedMesh_setVertexStride(Native, value);
}
public PhyScalarType VertexType
{
get { return UnsafeNativeMethods.btIndexedMesh_getVertexType(Native); }
set { UnsafeNativeMethods.btIndexedMesh_setVertexType(Native, value); }
get => btIndexedMesh_getVertexType(Native);
set => btIndexedMesh_setVertexType(Native, value);
}
public void Dispose()
@ -181,7 +181,7 @@ namespace BulletSharp
Free();
if (!_preventDelete)
{
UnsafeNativeMethods.btIndexedMesh_delete(Native);
btIndexedMesh_delete(Native);
}
Native = IntPtr.Zero;
}
@ -235,7 +235,7 @@ namespace BulletSharp
public void AddIndexedMesh(IndexedMesh mesh, PhyScalarType indexType = PhyScalarType.Int32)
{
_meshes.Add(mesh);
btTriangleIndexVertexArray_addIndexedMesh(_native, mesh.Native, indexType);
btTriangleIndexVertexArray_addIndexedMesh(Native, mesh.Native, indexType);
}
public AlignedIndexedMeshArray IndexedMeshArray
@ -245,7 +245,7 @@ namespace BulletSharp
// TODO: link _indexedMeshArray to _meshes
if (_indexedMeshArray == null)
{
_indexedMeshArray = new AlignedIndexedMeshArray(btTriangleIndexVertexArray_getIndexedMeshArray(_native));
_indexedMeshArray = new AlignedIndexedMeshArray(btTriangleIndexVertexArray_getIndexedMeshArray(Native));
}
return _indexedMeshArray;
}
@ -263,14 +263,5 @@ namespace BulletSharp
}
base.Dispose(disposing);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleIndexVertexArray_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleIndexVertexArray_new2(int numTriangles, IntPtr triangleIndexBase, int triangleIndexStride, int numVertices, IntPtr vertexBase, int vertexStride);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleIndexVertexArray_addIndexedMesh(IntPtr obj, IntPtr mesh, PhyScalarType indexType);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleIndexVertexArray_getIndexedMeshArray(IntPtr obj);
}
}

Просмотреть файл

@ -1,64 +1,63 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public class MaterialProperties : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
public MaterialProperties()
{
_native = btMaterialProperties_new();
Native = btMaterialProperties_new();
}
public IntPtr MaterialBase
{
get { return btMaterialProperties_getMaterialBase(_native); }
set { btMaterialProperties_setMaterialBase(_native, value); }
get => btMaterialProperties_getMaterialBase(Native);
set => btMaterialProperties_setMaterialBase(Native, value);
}
public int MaterialStride
{
get { return btMaterialProperties_getMaterialStride(_native); }
set { btMaterialProperties_setMaterialStride(_native, value); }
get => btMaterialProperties_getMaterialStride(Native);
set => btMaterialProperties_setMaterialStride(Native, value);
}
public PhyScalarType MaterialType
{
get { return btMaterialProperties_getMaterialType(_native); }
set { btMaterialProperties_setMaterialType(_native, value); }
get => btMaterialProperties_getMaterialType(Native);
set => btMaterialProperties_setMaterialType(Native, value);
}
public int NumMaterials
{
get { return btMaterialProperties_getNumMaterials(_native); }
set { btMaterialProperties_setNumMaterials(_native, value); }
get => btMaterialProperties_getNumMaterials(Native);
set => btMaterialProperties_setNumMaterials(Native, value);
}
public int NumTriangles
{
get { return btMaterialProperties_getNumTriangles(_native); }
set { btMaterialProperties_setNumTriangles(_native, value); }
get => btMaterialProperties_getNumTriangles(Native);
set => btMaterialProperties_setNumTriangles(Native, value);
}
public IntPtr TriangleMaterialsBase
{
get { return btMaterialProperties_getTriangleMaterialsBase(_native); }
set { btMaterialProperties_setTriangleMaterialsBase(_native, value); }
get => btMaterialProperties_getTriangleMaterialsBase(Native);
set => btMaterialProperties_setTriangleMaterialsBase(Native, value);
}
public int TriangleMaterialStride
{
get { return btMaterialProperties_getTriangleMaterialStride(_native); }
set { btMaterialProperties_setTriangleMaterialStride(_native, value); }
get => btMaterialProperties_getTriangleMaterialStride(Native);
set => btMaterialProperties_setTriangleMaterialStride(Native, value);
}
public PhyScalarType TriangleType
{
get { return btMaterialProperties_getTriangleType(_native); }
set { btMaterialProperties_setTriangleType(_native, value); }
get => btMaterialProperties_getTriangleType(Native);
set => btMaterialProperties_setTriangleType(Native, value);
}
public void Dispose()
@ -69,10 +68,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btMaterialProperties_delete(_native);
_native = IntPtr.Zero;
btMaterialProperties_delete(Native);
Native = IntPtr.Zero;
}
}
@ -80,43 +79,6 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btMaterialProperties_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btMaterialProperties_getMaterialBase(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btMaterialProperties_getMaterialStride(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern PhyScalarType btMaterialProperties_getMaterialType(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btMaterialProperties_getNumMaterials(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btMaterialProperties_getNumTriangles(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btMaterialProperties_getTriangleMaterialsBase(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btMaterialProperties_getTriangleMaterialStride(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern PhyScalarType btMaterialProperties_getTriangleType(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setMaterialBase(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setMaterialStride(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setMaterialType(IntPtr obj, PhyScalarType value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setNumMaterials(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setNumTriangles(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setTriangleMaterialsBase(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setTriangleMaterialStride(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_setTriangleType(IntPtr obj, PhyScalarType value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btMaterialProperties_delete(IntPtr obj);
}
public class TriangleIndexVertexMaterialArray : TriangleIndexVertexArray
@ -132,8 +94,8 @@ namespace BulletSharp
}
public TriangleIndexVertexMaterialArray(int numTriangles, IntPtr triangleIndexBase,
int triangleIndexStride, int numVertices, IntPtr vertexBase, int vertexStride,
int numMaterials, IntPtr materialBase, int materialStride, IntPtr triangleMaterialsBase,
int triangleIndexStride, int numVertices, IntPtr vertexBase, int vertexStride,
int numMaterials, IntPtr materialBase, int materialStride, IntPtr triangleMaterialsBase,
int materialIndexStride)
: base(btTriangleIndexVertexMaterialArray_new2(numTriangles, triangleIndexBase,
triangleIndexStride, numVertices, vertexBase, vertexStride,
@ -144,7 +106,7 @@ namespace BulletSharp
public void AddMaterialProperties(MaterialProperties mat, PhyScalarType triangleType = PhyScalarType.Int32)
{
btTriangleIndexVertexMaterialArray_addMaterialProperties(_native, mat._native,
btTriangleIndexVertexMaterialArray_addMaterialProperties(Native, mat.Native,
triangleType);
}
@ -153,7 +115,7 @@ namespace BulletSharp
out int numTriangles, out int triangleMaterialStride, out PhyScalarType triangleType,
int subpart = 0)
{
btTriangleIndexVertexMaterialArray_getLockedMaterialBase(_native, out materialBase,
btTriangleIndexVertexMaterialArray_getLockedMaterialBase(Native, out materialBase,
out numMaterials, out materialType, out materialStride, out triangleMaterialBase,
out numTriangles, out triangleMaterialStride, out triangleType, subpart);
}
@ -163,21 +125,10 @@ namespace BulletSharp
out int numTriangles, out int triangleMaterialStride, out PhyScalarType triangleType,
int subpart = 0)
{
btTriangleIndexVertexMaterialArray_getLockedReadOnlyMaterialBase(_native,
btTriangleIndexVertexMaterialArray_getLockedReadOnlyMaterialBase(Native,
out materialBase, out numMaterials, out materialType, out materialStride,
out triangleMaterialBase, out numTriangles, out triangleMaterialStride,
out triangleType, subpart);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleIndexVertexMaterialArray_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleIndexVertexMaterialArray_new2(int numTriangles, IntPtr triangleIndexBase, int triangleIndexStride, int numVertices, IntPtr vertexBase, int vertexStride, int numMaterials, IntPtr materialBase, int materialStride, IntPtr triangleMaterialsBase, int materialIndexStride);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleIndexVertexMaterialArray_addMaterialProperties(IntPtr obj, IntPtr mat, PhyScalarType triangleType);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleIndexVertexMaterialArray_getLockedMaterialBase(IntPtr obj, out IntPtr materialBase, out int numMaterials, out PhyScalarType materialType, out int materialStride, out IntPtr triangleMaterialBase, out int numTriangles, out int triangleMaterialStride, out PhyScalarType triangleType, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleIndexVertexMaterialArray_getLockedReadOnlyMaterialBase(IntPtr obj, out IntPtr materialBase, out int numMaterials, out PhyScalarType materialType, out int materialStride, out IntPtr triangleMaterialBase, out int numTriangles, out int triangleMaterialStride, out PhyScalarType triangleType, int subpart);
}
}

Просмотреть файл

@ -1,6 +1,6 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
@ -20,26 +20,26 @@ namespace BulletSharp
public float EdgeV0V1Angle
{
get { return btTriangleInfo_getEdgeV0V1Angle(_native); }
set { btTriangleInfo_setEdgeV0V1Angle(_native, value); }
get => btTriangleInfo_getEdgeV0V1Angle(_native);
set => btTriangleInfo_setEdgeV0V1Angle(_native, value);
}
public float EdgeV1V2Angle
{
get { return btTriangleInfo_getEdgeV1V2Angle(_native); }
set { btTriangleInfo_setEdgeV1V2Angle(_native, value); }
get => btTriangleInfo_getEdgeV1V2Angle(_native);
set => btTriangleInfo_setEdgeV1V2Angle(_native, value);
}
public float EdgeV2V0Angle
{
get { return btTriangleInfo_getEdgeV2V0Angle(_native); }
set { btTriangleInfo_setEdgeV2V0Angle(_native, value); }
get => btTriangleInfo_getEdgeV2V0Angle(_native);
set => btTriangleInfo_setEdgeV2V0Angle(_native, value);
}
public int Flags
{
get { return btTriangleInfo_getFlags(_native); }
set { btTriangleInfo_setFlags(_native, value); }
get => btTriangleInfo_getFlags(_native);
set => btTriangleInfo_setFlags(_native, value);
}
public void Dispose()
@ -61,94 +61,73 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleInfo_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfo_getEdgeV0V1Angle(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfo_getEdgeV1V2Angle(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfo_getEdgeV2V0Angle(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btTriangleInfo_getFlags(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfo_setEdgeV0V1Angle(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfo_setEdgeV1V2Angle(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfo_setEdgeV2V0Angle(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfo_setFlags(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfo_delete(IntPtr obj);
}
public class TriangleInfoMap : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
bool _preventDelete;
internal TriangleInfoMap(IntPtr native, bool preventDelete)
{
_native = native;
Native = native;
_preventDelete = preventDelete;
}
public TriangleInfoMap()
{
_native = btTriangleInfoMap_new();
Native = btTriangleInfoMap_new();
}
public int CalculateSerializeBufferSize()
{
return btTriangleInfoMap_calculateSerializeBufferSize(_native);
return btTriangleInfoMap_calculateSerializeBufferSize(Native);
}
/*
/*
public void DeSerialize(TriangleInfoMapData data)
{
btTriangleInfoMap_deSerialize(_native, data._native);
btTriangleInfoMap_deSerialize(Native, data._native);
}
*/
*/
public string Serialize(IntPtr dataBuffer, Serializer serializer)
{
return Marshal.PtrToStringAnsi(btTriangleInfoMap_serialize(_native, dataBuffer, serializer._native));
return Marshal.PtrToStringAnsi(btTriangleInfoMap_serialize(Native, dataBuffer, serializer._native));
}
public float ConvexEpsilon
{
get { return btTriangleInfoMap_getConvexEpsilon(_native); }
set { btTriangleInfoMap_setConvexEpsilon(_native, value); }
get => btTriangleInfoMap_getConvexEpsilon(Native);
set => btTriangleInfoMap_setConvexEpsilon(Native, value);
}
public float EdgeDistanceThreshold
{
get { return btTriangleInfoMap_getEdgeDistanceThreshold(_native); }
set { btTriangleInfoMap_setEdgeDistanceThreshold(_native, value); }
get => btTriangleInfoMap_getEdgeDistanceThreshold(Native);
set => btTriangleInfoMap_setEdgeDistanceThreshold(Native, value);
}
public float EqualVertexThreshold
{
get { return btTriangleInfoMap_getEqualVertexThreshold(_native); }
set { btTriangleInfoMap_setEqualVertexThreshold(_native, value); }
get => btTriangleInfoMap_getEqualVertexThreshold(Native);
set => btTriangleInfoMap_setEqualVertexThreshold(Native, value);
}
public float MaxEdgeAngleThreshold
{
get { return btTriangleInfoMap_getMaxEdgeAngleThreshold(_native); }
set { btTriangleInfoMap_setMaxEdgeAngleThreshold(_native, value); }
get => btTriangleInfoMap_getMaxEdgeAngleThreshold(Native);
set => btTriangleInfoMap_setMaxEdgeAngleThreshold(Native, value);
}
public float PlanarEpsilon
{
get { return btTriangleInfoMap_getPlanarEpsilon(_native); }
set { btTriangleInfoMap_setPlanarEpsilon(_native, value); }
get => btTriangleInfoMap_getPlanarEpsilon(Native);
set => btTriangleInfoMap_setPlanarEpsilon(Native, value);
}
public float ZeroAreaThreshold
{
get { return btTriangleInfoMap_getZeroAreaThreshold(_native); }
set { btTriangleInfoMap_setZeroAreaThreshold(_native, value); }
get => btTriangleInfoMap_getZeroAreaThreshold(Native);
set => btTriangleInfoMap_setZeroAreaThreshold(Native, value);
}
public void Dispose()
@ -159,13 +138,13 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
if (!_preventDelete)
{
btTriangleInfoMap_delete(_native);
btTriangleInfoMap_delete(Native);
}
_native = IntPtr.Zero;
Native = IntPtr.Zero;
}
}
@ -173,40 +152,5 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleInfoMap_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btTriangleInfoMap_calculateSerializeBufferSize(IntPtr obj);
//[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
//static extern void btTriangleInfoMap_deSerialize(IntPtr obj, IntPtr data);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfoMap_getConvexEpsilon(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfoMap_getEdgeDistanceThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfoMap_getEqualVertexThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfoMap_getMaxEdgeAngleThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfoMap_getPlanarEpsilon(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleInfoMap_getZeroAreaThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleInfoMap_serialize(IntPtr obj, IntPtr dataBuffer, IntPtr serializer);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfoMap_setConvexEpsilon(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfoMap_setEdgeDistanceThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfoMap_setEqualVertexThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfoMap_setMaxEdgeAngleThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfoMap_setPlanarEpsilon(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfoMap_setZeroAreaThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleInfoMap_delete(IntPtr obj);
}
}

Просмотреть файл

@ -1,7 +1,6 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
@ -19,80 +18,48 @@ namespace BulletSharp
public void AddIndex(int index)
{
btTriangleMesh_addIndex(_native, index);
btTriangleMesh_addIndex(Native, index);
}
public void AddTriangleRef(ref Vector3 vertex0, ref Vector3 vertex1, ref Vector3 vertex2,
bool removeDuplicateVertices = false)
{
btTriangleMesh_addTriangle(_native, ref vertex0, ref vertex1, ref vertex2,
removeDuplicateVertices);
}
public void AddTriangleRef(ref Vector3 vertex0, ref Vector3 vertex1, ref Vector3 vertex2,
bool removeDuplicateVertices = false)
{
btTriangleMesh_addTriangle(Native, ref vertex0, ref vertex1, ref vertex2,
removeDuplicateVertices);
}
public void AddTriangle(Vector3 vertex0, Vector3 vertex1, Vector3 vertex2,
bool removeDuplicateVertices = false)
{
btTriangleMesh_addTriangle(_native, ref vertex0, ref vertex1, ref vertex2,
btTriangleMesh_addTriangle(Native, ref vertex0, ref vertex1, ref vertex2,
removeDuplicateVertices);
}
public void AddTriangleIndices(int index1, int index2, int index3)
{
btTriangleMesh_addTriangleIndices(_native, index1, index2, index3);
btTriangleMesh_addTriangleIndices(Native, index1, index2, index3);
}
public int FindOrAddVertexRef(Vector3 vertex, bool removeDuplicateVertices)
{
return btTriangleMesh_findOrAddVertex(_native, ref vertex, removeDuplicateVertices);
}
public int FindOrAddVertexRef(Vector3 vertex, bool removeDuplicateVertices)
{
return btTriangleMesh_findOrAddVertex(Native, ref vertex, removeDuplicateVertices);
}
public int FindOrAddVertex(Vector3 vertex, bool removeDuplicateVertices)
{
return btTriangleMesh_findOrAddVertex(_native, ref vertex, removeDuplicateVertices);
return btTriangleMesh_findOrAddVertex(Native, ref vertex, removeDuplicateVertices);
}
public int NumTriangles
{
get { return btTriangleMesh_getNumTriangles(_native); }
}
public int NumTriangles => btTriangleMesh_getNumTriangles(Native);
public bool Use32BitIndices
{
get { return btTriangleMesh_getUse32bitIndices(_native); }
}
public bool Use32BitIndices => btTriangleMesh_getUse32bitIndices(Native);
public bool Use4ComponentVertices
{
get { return btTriangleMesh_getUse4componentVertices(_native); }
}
public bool Use4ComponentVertices => btTriangleMesh_getUse4componentVertices(Native);
public float WeldingThreshold
{
get { return btTriangleMesh_getWeldingThreshold(_native); }
set { btTriangleMesh_setWeldingThreshold(_native, value); }
get => btTriangleMesh_getWeldingThreshold(Native);
set => btTriangleMesh_setWeldingThreshold(Native, value);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btTriangleMesh_new(bool use32bitIndices, bool use4componentVertices);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleMesh_addIndex(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleMesh_addTriangle(IntPtr obj, [In] ref Vector3 vertex0, [In] ref Vector3 vertex1, [In] ref Vector3 vertex2, bool removeDuplicateVertices);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleMesh_addTriangleIndices(IntPtr obj, int index1, int index2, int index3);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btTriangleMesh_findOrAddVertex(IntPtr obj, [In] ref Vector3 vertex, bool removeDuplicateVertices);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btTriangleMesh_getNumTriangles(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btTriangleMesh_getUse32bitIndices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btTriangleMesh_getUse4componentVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btTriangleMesh_getWeldingThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btTriangleMesh_setWeldingThreshold(IntPtr obj, float value);
}
}

Просмотреть файл

@ -1,33 +1,32 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public class Element : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
internal Element(IntPtr native)
{
_native = native;
Native = native;
}
public Element()
{
_native = btElement_new();
Native = btElement_new();
}
public int Id
{
get { return btElement_getId(_native); }
set { btElement_setId(_native, value); }
get => btElement_getId(Native);
set => btElement_setId(Native, value);
}
public int Sz
{
get { return btElement_getSz(_native); }
set { btElement_setSz(_native, value); }
get => btElement_getSz(Native);
set => btElement_setSz(Native, value);
}
public void Dispose()
@ -38,10 +37,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btElement_delete(_native);
_native = IntPtr.Zero;
btElement_delete(Native);
Native = IntPtr.Zero;
}
}
@ -49,84 +48,68 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btElement_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btElement_getId(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btElement_getSz(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btElement_setId(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btElement_setSz(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btElement_delete(IntPtr obj);
}
public class UnionFind : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
internal UnionFind(IntPtr native)
{
_native = native;
Native = native;
}
public UnionFind()
{
_native = btUnionFind_new();
Native = btUnionFind_new();
}
public void Allocate(int n)
{
btUnionFind_allocate(_native, n);
btUnionFind_allocate(Native, n);
}
public int Find(int p, int q)
{
return btUnionFind_find(_native, p, q);
return btUnionFind_find(Native, p, q);
}
public int Find(int x)
{
return btUnionFind_find2(_native, x);
return btUnionFind_find2(Native, x);
}
public void Free()
{
btUnionFind_Free(_native);
btUnionFind_Free(Native);
}
public Element GetElement(int index)
{
return new Element(btUnionFind_getElement(_native, index));
return new Element(btUnionFind_getElement(Native, index));
}
public bool IsRoot(int x)
{
return btUnionFind_isRoot(_native, x);
return btUnionFind_isRoot(Native, x);
}
public void Reset(int n)
{
btUnionFind_reset(_native, n);
btUnionFind_reset(Native, n);
}
public void SortIslands()
{
btUnionFind_sortIslands(_native);
btUnionFind_sortIslands(Native);
}
public void Unite(int p, int q)
{
btUnionFind_unite(_native, p, q);
btUnionFind_unite(Native, p, q);
}
public int NumElements
{
get { return btUnionFind_getNumElements(_native); }
}
public int NumElements => btUnionFind_getNumElements(Native);
public void Dispose()
{
@ -136,10 +119,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btUnionFind_delete(_native);
_native = IntPtr.Zero;
btUnionFind_delete(Native);
Native = IntPtr.Zero;
}
}
@ -147,31 +130,5 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btUnionFind_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUnionFind_allocate(IntPtr obj, int N);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btUnionFind_find(IntPtr obj, int p, int q);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btUnionFind_find2(IntPtr obj, int x);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUnionFind_Free(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btUnionFind_getElement(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btUnionFind_getNumElements(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUnionFind_isRoot(IntPtr obj, int x);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUnionFind_reset(IntPtr obj, int N);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUnionFind_sortIslands(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUnionFind_unite(IntPtr obj, int p, int q);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUnionFind_delete(IntPtr obj);
}
}

Просмотреть файл

@ -1,192 +1,145 @@
using System;
using System.Runtime.InteropServices;
using System.Security;
using BulletSharp.Math;
using static BulletSharp.UnsafeNativeMethods;
namespace BulletSharp
{
public class UsageBitfield
{
internal IntPtr _native;
internal IntPtr Native;
internal UsageBitfield(IntPtr native)
{
_native = native;
Native = native;
}
public void Reset()
{
btUsageBitfield_reset(_native);
btUsageBitfield_reset(Native);
}
public bool Unused1
{
get { return btUsageBitfield_getUnused1(_native); }
set { btUsageBitfield_setUnused1(_native, value); }
get => btUsageBitfield_getUnused1(Native);
set => btUsageBitfield_setUnused1(Native, value);
}
public bool Unused2
public bool Unused2
{
get { return btUsageBitfield_getUnused2(_native); }
set { btUsageBitfield_setUnused2(_native, value); }
get => btUsageBitfield_getUnused2(Native);
set => btUsageBitfield_setUnused2(Native, value);
}
public bool Unused3
public bool Unused3
{
get { return btUsageBitfield_getUnused3(_native); }
set { btUsageBitfield_setUnused3(_native, value); }
get => btUsageBitfield_getUnused3(Native);
set => btUsageBitfield_setUnused3(Native, value);
}
public bool Unused4
public bool Unused4
{
get { return btUsageBitfield_getUnused4(_native); }
set { btUsageBitfield_setUnused4(_native, value); }
get => btUsageBitfield_getUnused4(Native);
set => btUsageBitfield_setUnused4(Native, value);
}
public bool UsedVertexA
public bool UsedVertexA
{
get { return btUsageBitfield_getUsedVertexA(_native); }
set { btUsageBitfield_setUsedVertexA(_native, value); }
get => btUsageBitfield_getUsedVertexA(Native);
set => btUsageBitfield_setUsedVertexA(Native, value);
}
public bool UsedVertexB
public bool UsedVertexB
{
get { return btUsageBitfield_getUsedVertexB(_native); }
set { btUsageBitfield_setUsedVertexB(_native, value); }
get => btUsageBitfield_getUsedVertexB(Native);
set => btUsageBitfield_setUsedVertexB(Native, value);
}
public bool UsedVertexC
public bool UsedVertexC
{
get { return btUsageBitfield_getUsedVertexC(_native); }
set { btUsageBitfield_setUsedVertexC(_native, value); }
get => btUsageBitfield_getUsedVertexC(Native);
set => btUsageBitfield_setUsedVertexC(Native, value);
}
public bool UsedVertexD
public bool UsedVertexD
{
get { return btUsageBitfield_getUsedVertexD(_native); }
set { btUsageBitfield_setUsedVertexD(_native, value); }
get => btUsageBitfield_getUsedVertexD(Native);
set => btUsageBitfield_setUsedVertexD(Native, value);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUnused1(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUnused2(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUnused3(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUnused4(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUsedVertexA(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUsedVertexB(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUsedVertexC(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btUsageBitfield_getUsedVertexD(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_reset(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUnused1(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUnused2(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUnused3(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUnused4(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUsedVertexA(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUsedVertexB(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUsedVertexC(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btUsageBitfield_setUsedVertexD(IntPtr obj, bool value);
}
public class SubSimplexClosestResult : IDisposable
{
internal IntPtr _native;
internal IntPtr Native;
internal SubSimplexClosestResult(IntPtr native)
{
_native = native;
Native = native;
}
public SubSimplexClosestResult()
{
_native = btSubSimplexClosestResult_new();
Native = btSubSimplexClosestResult_new();
}
public void Reset()
{
btSubSimplexClosestResult_reset(_native);
btSubSimplexClosestResult_reset(Native);
}
public void SetBarycentricCoordinates()
{
btSubSimplexClosestResult_setBarycentricCoordinates(_native);
btSubSimplexClosestResult_setBarycentricCoordinates(Native);
}
public void SetBarycentricCoordinates(float a)
{
btSubSimplexClosestResult_setBarycentricCoordinates2(_native, a);
btSubSimplexClosestResult_setBarycentricCoordinates2(Native, a);
}
public void SetBarycentricCoordinates(float a, float b)
{
btSubSimplexClosestResult_setBarycentricCoordinates3(_native, a, b);
btSubSimplexClosestResult_setBarycentricCoordinates3(Native, a, b);
}
public void SetBarycentricCoordinates(float a, float b, float c)
{
btSubSimplexClosestResult_setBarycentricCoordinates4(_native, a, b, c);
btSubSimplexClosestResult_setBarycentricCoordinates4(Native, a, b, c);
}
public void SetBarycentricCoordinates(float a, float b, float c, float d)
{
btSubSimplexClosestResult_setBarycentricCoordinates5(_native, a, b, c,
btSubSimplexClosestResult_setBarycentricCoordinates5(Native, a, b, c,
d);
}
/*
/*
public FloatArray BarycentricCoords
{
get { return btSubSimplexClosestResult_getBarycentricCoords(_native); }
get { return btSubSimplexClosestResult_getBarycentricCoords(Native); }
}
*/
*/
public Vector3 ClosestPointOnSimplex
{
get
{
Vector3 value;
btSubSimplexClosestResult_getClosestPointOnSimplex(_native, out value);
btSubSimplexClosestResult_getClosestPointOnSimplex(Native, out value);
return value;
}
set { btSubSimplexClosestResult_setClosestPointOnSimplex(_native, ref value); }
set => btSubSimplexClosestResult_setClosestPointOnSimplex(Native, ref value);
}
public bool Degenerate
{
get { return btSubSimplexClosestResult_getDegenerate(_native); }
set { btSubSimplexClosestResult_setDegenerate(_native, value); }
get => btSubSimplexClosestResult_getDegenerate(Native);
set => btSubSimplexClosestResult_setDegenerate(Native, value);
}
public bool IsValid
{
get { return btSubSimplexClosestResult_isValid(_native); }
}
public bool IsValid => btSubSimplexClosestResult_isValid(Native);
public UsageBitfield UsedVertices
{
get { return new UsageBitfield(btSubSimplexClosestResult_getUsedVertices(_native)); }
set { btSubSimplexClosestResult_setUsedVertices(_native, value._native); }
get => new UsageBitfield(btSubSimplexClosestResult_getUsedVertices(Native));
set => btSubSimplexClosestResult_setUsedVertices(Native, value.Native);
}
public void Dispose()
@ -197,10 +150,10 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
btSubSimplexClosestResult_delete(_native);
_native = IntPtr.Zero;
btSubSimplexClosestResult_delete(Native);
Native = IntPtr.Zero;
}
}
@ -208,169 +161,133 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btSubSimplexClosestResult_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btSubSimplexClosestResult_getBarycentricCoords(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_getClosestPointOnSimplex(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btSubSimplexClosestResult_getDegenerate(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btSubSimplexClosestResult_getUsedVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btSubSimplexClosestResult_isValid(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_reset(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setBarycentricCoordinates(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setBarycentricCoordinates2(IntPtr obj, float a);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setBarycentricCoordinates3(IntPtr obj, float a, float b);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setBarycentricCoordinates4(IntPtr obj, float a, float b, float c);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setBarycentricCoordinates5(IntPtr obj, float a, float b, float c, float d);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setClosestPointOnSimplex(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setDegenerate(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_setUsedVertices(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btSubSimplexClosestResult_delete(IntPtr obj);
}
public class VoronoiSimplexSolver : IDisposable
{
internal IntPtr _native;
private bool _preventDelete;
internal IntPtr Native;
private bool _preventDelete;
internal VoronoiSimplexSolver(IntPtr native, bool preventDelete)
internal VoronoiSimplexSolver(IntPtr native, bool preventDelete)
{
_native = native;
_preventDelete = preventDelete;
Native = native;
_preventDelete = preventDelete;
}
public VoronoiSimplexSolver()
{
_native = btVoronoiSimplexSolver_new();
Native = btVoronoiSimplexSolver_new();
}
public void AddVertexRef(ref Vector3 w, ref Vector3 p, ref Vector3 q)
{
btVoronoiSimplexSolver_addVertex(_native, ref w, ref p, ref q);
}
public void AddVertexRef(ref Vector3 w, ref Vector3 p, ref Vector3 q)
{
btVoronoiSimplexSolver_addVertex(Native, ref w, ref p, ref q);
}
public void AddVertex(Vector3 w, Vector3 p, Vector3 q)
{
btVoronoiSimplexSolver_addVertex(_native, ref w, ref p, ref q);
btVoronoiSimplexSolver_addVertex(Native, ref w, ref p, ref q);
}
public void BackupClosest(out Vector3 v)
{
btVoronoiSimplexSolver_backup_closest(_native, out v);
btVoronoiSimplexSolver_backup_closest(Native, out v);
}
public bool Closest(out Vector3 v)
{
return btVoronoiSimplexSolver_closest(_native, out v);
return btVoronoiSimplexSolver_closest(Native, out v);
}
public bool ClosestPtPointTetrahedronRef(ref Vector3 p, ref Vector3 a, ref Vector3 b, ref Vector3 c,
ref Vector3 d, SubSimplexClosestResult finalResult)
{
return btVoronoiSimplexSolver_closestPtPointTetrahedron(_native, ref p,
ref a, ref b, ref c, ref d, finalResult._native);
}
public bool ClosestPtPointTetrahedronRef(ref Vector3 p, ref Vector3 a, ref Vector3 b, ref Vector3 c,
ref Vector3 d, SubSimplexClosestResult finalResult)
{
return btVoronoiSimplexSolver_closestPtPointTetrahedron(Native, ref p,
ref a, ref b, ref c, ref d, finalResult.Native);
}
public bool ClosestPtPointTetrahedron(Vector3 p, Vector3 a, Vector3 b, Vector3 c,
Vector3 d, SubSimplexClosestResult finalResult)
{
return btVoronoiSimplexSolver_closestPtPointTetrahedron(_native, ref p,
ref a, ref b, ref c, ref d, finalResult._native);
return btVoronoiSimplexSolver_closestPtPointTetrahedron(Native, ref p,
ref a, ref b, ref c, ref d, finalResult.Native);
}
public bool ClosestPtPointTriangleRef(ref Vector3 p, ref Vector3 a, ref Vector3 b, ref Vector3 c,
SubSimplexClosestResult result)
{
return btVoronoiSimplexSolver_closestPtPointTriangle(_native, ref p,
ref a, ref b, ref c, result._native);
}
public bool ClosestPtPointTriangleRef(ref Vector3 p, ref Vector3 a, ref Vector3 b, ref Vector3 c,
SubSimplexClosestResult result)
{
return btVoronoiSimplexSolver_closestPtPointTriangle(Native, ref p,
ref a, ref b, ref c, result.Native);
}
public bool ClosestPtPointTriangle(Vector3 p, Vector3 a, Vector3 b, Vector3 c,
SubSimplexClosestResult result)
{
return btVoronoiSimplexSolver_closestPtPointTriangle(_native, ref p,
ref a, ref b, ref c, result._native);
return btVoronoiSimplexSolver_closestPtPointTriangle(Native, ref p,
ref a, ref b, ref c, result.Native);
}
public void ComputePoints(out Vector3 p1, out Vector3 p2)
{
btVoronoiSimplexSolver_compute_points(_native, out p1, out p2);
btVoronoiSimplexSolver_compute_points(Native, out p1, out p2);
}
public bool EmptySimplex()
{
return btVoronoiSimplexSolver_emptySimplex(_native);
return btVoronoiSimplexSolver_emptySimplex(Native);
}
public bool FullSimplex()
{
return btVoronoiSimplexSolver_fullSimplex(_native);
return btVoronoiSimplexSolver_fullSimplex(Native);
}
/*
public int GetSimplex(Vector3[] pBuf, Vector3[] qBuf, Vector3[] yBuf)
/*
public int GetSimplex(Vector3[] pBuf, Vector3[] qBuf, Vector3[] yBuf)
{
return btVoronoiSimplexSolver_getSimplex(_native, pBuf, qBuf,
return btVoronoiSimplexSolver_getSimplex(Native, pBuf, qBuf,
yBuf);
}
*/
*/
public bool InSimplex(Vector3 w)
{
return btVoronoiSimplexSolver_inSimplex(_native, ref w);
return btVoronoiSimplexSolver_inSimplex(Native, ref w);
}
public float MaxVertex()
{
return btVoronoiSimplexSolver_maxVertex(_native);
return btVoronoiSimplexSolver_maxVertex(Native);
}
public int PointOutsideOfPlane(Vector3 p, Vector3 a, Vector3 b, Vector3 c,
Vector3 d)
{
return btVoronoiSimplexSolver_pointOutsideOfPlane(_native, ref p, ref a,
return btVoronoiSimplexSolver_pointOutsideOfPlane(Native, ref p, ref a,
ref b, ref c, ref d);
}
public void ReduceVertices(UsageBitfield usedVerts)
{
btVoronoiSimplexSolver_reduceVertices(_native, usedVerts._native);
btVoronoiSimplexSolver_reduceVertices(Native, usedVerts.Native);
}
public void RemoveVertex(int index)
{
btVoronoiSimplexSolver_removeVertex(_native, index);
btVoronoiSimplexSolver_removeVertex(Native, index);
}
public void Reset()
{
btVoronoiSimplexSolver_reset(_native);
btVoronoiSimplexSolver_reset(Native);
}
public bool UpdateClosestVectorAndPoints()
{
return btVoronoiSimplexSolver_updateClosestVectorAndPoints(_native);
return btVoronoiSimplexSolver_updateClosestVectorAndPoints(Native);
}
public SubSimplexClosestResult CachedBC
{
get { return new SubSimplexClosestResult(btVoronoiSimplexSolver_getCachedBC(_native)); }
set { btVoronoiSimplexSolver_setCachedBC(_native, value._native); }
get => new SubSimplexClosestResult(btVoronoiSimplexSolver_getCachedBC(Native)); set => btVoronoiSimplexSolver_setCachedBC(Native, value.Native);
}
public Vector3 CachedP1
@ -378,10 +295,10 @@ namespace BulletSharp
get
{
Vector3 value;
btVoronoiSimplexSolver_getCachedP1(_native, out value);
btVoronoiSimplexSolver_getCachedP1(Native, out value);
return value;
}
set { btVoronoiSimplexSolver_setCachedP1(_native, ref value); }
set => btVoronoiSimplexSolver_setCachedP1(Native, ref value);
}
public Vector3 CachedP2
@ -389,10 +306,10 @@ namespace BulletSharp
get
{
Vector3 value;
btVoronoiSimplexSolver_getCachedP2(_native, out value);
btVoronoiSimplexSolver_getCachedP2(Native, out value);
return value;
}
set { btVoronoiSimplexSolver_setCachedP2(_native, ref value); }
set => btVoronoiSimplexSolver_setCachedP2(Native, ref value);
}
public Vector3 CachedV
@ -400,22 +317,20 @@ namespace BulletSharp
get
{
Vector3 value;
btVoronoiSimplexSolver_getCachedV(_native, out value);
btVoronoiSimplexSolver_getCachedV(Native, out value);
return value;
}
set { btVoronoiSimplexSolver_setCachedV(_native, ref value); }
set => btVoronoiSimplexSolver_setCachedV(Native, ref value);
}
public bool CachedValidClosest
{
get { return btVoronoiSimplexSolver_getCachedValidClosest(_native); }
set { btVoronoiSimplexSolver_setCachedValidClosest(_native, value); }
get => btVoronoiSimplexSolver_getCachedValidClosest(Native); set => btVoronoiSimplexSolver_setCachedValidClosest(Native, value);
}
public float EqualVertexThreshold
{
get { return btVoronoiSimplexSolver_getEqualVertexThreshold(_native); }
set { btVoronoiSimplexSolver_setEqualVertexThreshold(_native, value); }
get => btVoronoiSimplexSolver_getEqualVertexThreshold(Native); set => btVoronoiSimplexSolver_setEqualVertexThreshold(Native, value);
}
public Vector3 LastW
@ -423,39 +338,37 @@ namespace BulletSharp
get
{
Vector3 value;
btVoronoiSimplexSolver_getLastW(_native, out value);
btVoronoiSimplexSolver_getLastW(Native, out value);
return value;
}
set { btVoronoiSimplexSolver_setLastW(_native, ref value); }
set => btVoronoiSimplexSolver_setLastW(Native, ref value);
}
public bool NeedsUpdate
{
get { return btVoronoiSimplexSolver_getNeedsUpdate(_native); }
set { btVoronoiSimplexSolver_setNeedsUpdate(_native, value); }
get => btVoronoiSimplexSolver_getNeedsUpdate(Native); set => btVoronoiSimplexSolver_setNeedsUpdate(Native, value);
}
public int NumVertices
{
get { return btVoronoiSimplexSolver_getNumVertices(_native); }
set { btVoronoiSimplexSolver_setNumVertices(_native, value); }
get => btVoronoiSimplexSolver_getNumVertices(Native); set => btVoronoiSimplexSolver_setNumVertices(Native, value);
}
/*
/*
public Vector3[] SimplexPointsP
{
get { return btVoronoiSimplexSolver_getSimplexPointsP(_native); }
get { return btVoronoiSimplexSolver_getSimplexPointsP(Native); }
}
public Vector3[] SimplexPointsQ
{
get { return btVoronoiSimplexSolver_getSimplexPointsQ(_native); }
get { return btVoronoiSimplexSolver_getSimplexPointsQ(Native); }
}
public Vector3[] SimplexVectorW
{
get { return btVoronoiSimplexSolver_getSimplexVectorW(_native); }
get { return btVoronoiSimplexSolver_getSimplexVectorW(Native); }
}
*/
*/
public void Dispose()
{
Dispose(true);
@ -464,13 +377,13 @@ namespace BulletSharp
protected virtual void Dispose(bool disposing)
{
if (_native != IntPtr.Zero)
if (Native != IntPtr.Zero)
{
if (!_preventDelete)
{
btVoronoiSimplexSolver_delete(_native);
}
_native = IntPtr.Zero;
if (!_preventDelete)
{
btVoronoiSimplexSolver_delete(Native);
}
Native = IntPtr.Zero;
}
}
@ -478,95 +391,5 @@ namespace BulletSharp
{
Dispose(false);
}
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btVoronoiSimplexSolver_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_addVertex(IntPtr obj, [In] ref Vector3 w, [In] ref Vector3 p, [In] ref Vector3 q);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_backup_closest(IntPtr obj, out Vector3 v);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_closest(IntPtr obj, out Vector3 v);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_closestPtPointTetrahedron(IntPtr obj, [In] ref Vector3 p, [In] ref Vector3 a, [In] ref Vector3 b, [In] ref Vector3 c, [In] ref Vector3 d, IntPtr finalResult);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_closestPtPointTriangle(IntPtr obj, [In] ref Vector3 p, [In] ref Vector3 a, [In] ref Vector3 b, [In] ref Vector3 c, IntPtr result);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_compute_points(IntPtr obj, out Vector3 p1, out Vector3 p2);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_emptySimplex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_fullSimplex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btVoronoiSimplexSolver_getCachedBC(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_getCachedP1(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_getCachedP2(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_getCachedV(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_getCachedValidClosest(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btVoronoiSimplexSolver_getEqualVertexThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_getLastW(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_getNeedsUpdate(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btVoronoiSimplexSolver_getNumVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btVoronoiSimplexSolver_getSimplex(IntPtr obj, Vector3[] pBuf, Vector3[] qBuf, Vector3[] yBuf);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btVoronoiSimplexSolver_getSimplexPointsP(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btVoronoiSimplexSolver_getSimplexPointsQ(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern IntPtr btVoronoiSimplexSolver_getSimplexVectorW(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_inSimplex(IntPtr obj, [In] ref Vector3 w);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern float btVoronoiSimplexSolver_maxVertex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btVoronoiSimplexSolver_numVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern int btVoronoiSimplexSolver_pointOutsideOfPlane(IntPtr obj, [In] ref Vector3 p, [In] ref Vector3 a, [In] ref Vector3 b, [In] ref Vector3 c, [In] ref Vector3 d);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_reduceVertices(IntPtr obj, IntPtr usedVerts);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_removeVertex(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_reset(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setCachedBC(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setCachedP1(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setCachedP2(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setCachedV(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setCachedValidClosest(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setEqualVertexThreshold(IntPtr obj, float threshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setLastW(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setNeedsUpdate(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_setNumVertices(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
[return: MarshalAs(UnmanagedType.I1)]
static extern bool btVoronoiSimplexSolver_updateClosestVectorAndPoints(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv), SuppressUnmanagedCodeSecurity]
static extern void btVoronoiSimplexSolver_delete(IntPtr obj);
}
}

Просмотреть файл

@ -892,7 +892,7 @@ namespace BulletSharp
public GImpactMeshShape CreateGimpactShape(StridingMeshInterface trimesh)
{
GImpactMeshShape shape = new GImpactMeshShape(trimesh._native);
GImpactMeshShape shape = new GImpactMeshShape(trimesh.Native);
_allocatedCollisionShapes.Add(shape);
return shape;
}

Просмотреть файл

@ -117,7 +117,7 @@ namespace BulletSharp
public void Add(PersistentManifold item)
{
btAlignedObjectArray_btPersistentManifoldPtr_push_back(_native, item._native);
btAlignedObjectArray_btPersistentManifoldPtr_push_back(_native, item.Native);
}
public void Clear()

Просмотреть файл

@ -32,7 +32,7 @@ namespace BulletSharp
public SoftRigidCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper col0, CollisionObjectWrapper col1Wrap, bool isSwapped)
: base(btSoftRigidCollisionAlgorithm_new(mf._native, ci.Native, col0.Native,
: base(btSoftRigidCollisionAlgorithm_new(mf.Native, ci.Native, col0.Native,
col1Wrap.Native, isSwapped))
{
}

Просмотреть файл

@ -37,7 +37,7 @@ namespace BulletSharp
public SoftSoftCollisionAlgorithm(PersistentManifold mf, CollisionAlgorithmConstructionInfo ci,
CollisionObjectWrapper body0Wrap, CollisionObjectWrapper body1Wrap)
: base(btSoftSoftCollisionAlgorithm_new2(mf._native, ci.Native, body0Wrap.Native,
: base(btSoftSoftCollisionAlgorithm_new2(mf.Native, ci.Native, body0Wrap.Native,
body1Wrap.Native))
{
}

Просмотреть файл

@ -1847,6 +1847,19 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btDynamicsWorld_synchronizeMotionStates(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btElement_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btElement_getId(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btElement_getSz(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btElement_setId(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btElement_setSz(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btElement_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btEmptyAlgorithm_CreateFunc_new();
@ -2221,6 +2234,14 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btGjkPairDetector_setPenetrationDepthSolver(IntPtr obj, IntPtr penetrationDepthSolver);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btHashedOverlappingPairCache_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btHashedOverlappingPairCache_GetCount(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btHashedOverlappingPairCache_needsBroadphaseCollision(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btHeightfieldTerrainShape_new(int heightStickWidth, int heightStickLength, IntPtr heightfieldData, float heightScale, float minHeight, float maxHeight, int upAxis, PhyScalarType heightDataType, bool flipQuadEdges);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -2271,6 +2292,11 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btIndexedMesh_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btInternalTriangleIndexCallbackWrapper_new(IntPtr internalProcessTriangleIndexCallback);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btInternalTriangleIndexCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btITaskScheduler_getMaxNumThreads(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -2280,7 +2306,6 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btITaskScheduler_setNumThreads(IntPtr obj, int numThreads);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btManifoldPoint_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -2441,6 +2466,43 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btManifoldResult_setPersistentManifold(IntPtr obj, IntPtr manifoldPtr);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btMaterialProperties_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btMaterialProperties_getMaterialBase(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btMaterialProperties_getMaterialStride(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern PhyScalarType btMaterialProperties_getMaterialType(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btMaterialProperties_getNumMaterials(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btMaterialProperties_getNumTriangles(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btMaterialProperties_getTriangleMaterialsBase(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btMaterialProperties_getTriangleMaterialStride(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern PhyScalarType btMaterialProperties_getTriangleType(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setMaterialBase(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setMaterialStride(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setMaterialType(IntPtr obj, PhyScalarType value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setNumMaterials(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setNumTriangles(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setTriangleMaterialsBase(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setTriangleMaterialStride(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_setTriangleType(IntPtr obj, PhyScalarType value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btMaterialProperties_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btMinkowskiPenetrationDepthSolver_new();
@ -2507,6 +2569,104 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btMultiSphereShape_getSphereRadius(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btNodeOverlapCallback_processNode(IntPtr obj, int subPart, int triangleIndex);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btNodeOverlapCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btNullPairCache_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOptimizedBvh_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvh_build(IntPtr obj, IntPtr triangles, bool useQuantizedAabbCompression, [In] ref Vector3 bvhAabbMin, [In] ref Vector3 bvhAabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOptimizedBvh_deSerializeInPlace(IntPtr i_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvh_refit(IntPtr obj, IntPtr triangles, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvh_refitPartial(IntPtr obj, IntPtr triangles, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btOptimizedBvh_serializeInPlace(IntPtr obj, IntPtr o_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvh_updateBvhNodes(IntPtr obj, IntPtr meshInterface, int firstNode, int endNode, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOptimizedBvhNode_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_getAabbMaxOrg(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_getAabbMinOrg(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btOptimizedBvhNode_getEscapeIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btOptimizedBvhNode_getSubPart(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btOptimizedBvhNode_getTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_setAabbMaxOrg(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_setAabbMinOrg(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_setEscapeIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_setSubPart(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_setTriangleIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOptimizedBvhNode_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btOverlapCallback_processOverlap(IntPtr obj, IntPtr pair);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlapCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btOverlapFilterCallback_needBroadphaseCollision(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlapFilterCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOverlapFilterCallbackWrapper_new(IntPtr needBroadphaseCollision);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCache_cleanOverlappingPair(IntPtr obj, IntPtr pair, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCache_cleanProxyFromPairs(IntPtr obj, IntPtr proxy, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOverlappingPairCache_findPair(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btOverlappingPairCache_getNumOverlappingPairs(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOverlappingPairCache_getOverlappingPairArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOverlappingPairCache_getOverlappingPairArrayPtr(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btOverlappingPairCache_hasDeferredRemoval(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCache_processAllOverlappingPairs(IntPtr obj, IntPtr __unnamed0, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCache_setInternalGhostPairCallback(IntPtr obj, IntPtr ghostPairCallback);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCache_setOverlapFilterCallback(IntPtr obj, IntPtr callback);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCache_sortOverlappingPairs(IntPtr obj, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOverlappingPairCallback_addOverlappingPair(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btOverlappingPairCallback_removeOverlappingPair(IntPtr obj, IntPtr proxy0, IntPtr proxy1, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCallback_removeOverlappingPairsContainingProxy(IntPtr obj, IntPtr proxy0, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btOverlappingPairCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btPairCachingGhostObject_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -2521,6 +2681,62 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPairSet_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btPersistentManifold_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btPersistentManifold_new2(IntPtr body0, IntPtr body1, int __unnamed2, float contactBreakingThreshold, float contactProcessingThreshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btPersistentManifold_addManifoldPoint(IntPtr obj, IntPtr newPoint, bool isPredictive);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_clearManifold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_clearUserCache(IntPtr obj, IntPtr pt);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btPersistentManifold_getBody0(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btPersistentManifold_getBody1(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btPersistentManifold_getCacheEntry(IntPtr obj, IntPtr newPoint);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btPersistentManifold_getCompanionIdA(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btPersistentManifold_getCompanionIdB(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btPersistentManifold_getContactBreakingThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btPersistentManifold_getContactPoint(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btPersistentManifold_getContactProcessingThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btPersistentManifold_getIndex1a(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btPersistentManifold_getNumContacts(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_refreshContactPoints(IntPtr obj, [In] ref Matrix trA, [In] ref Matrix trB);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_removeContactPoint(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_replaceContactPoint(IntPtr obj, IntPtr newPoint, int insertIndex);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_setBodies(IntPtr obj, IntPtr body0, IntPtr body1);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_setCompanionIdA(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_setCompanionIdB(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_setContactBreakingThreshold(IntPtr obj, float contactBreakingThreshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_setContactProcessingThreshold(IntPtr obj, float contactProcessingThreshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_setIndex1a(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_setNumContacts(IntPtr obj, int cachedPoints);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btPersistentManifold_validContactDistance(IntPtr obj, IntPtr pt);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPersistentManifold_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btPointCollector_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -2612,6 +2828,73 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btPrimitiveTriangle_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvh_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_buildInternal(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern uint btQuantizedBvh_calculateSerializeBufferSize(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btQuantizedBvh_calculateSerializeBufferSizeNew(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_deSerializeDouble(IntPtr obj, IntPtr quantizedBvhDoubleData);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_deSerializeFloat(IntPtr obj, IntPtr quantizedBvhFloatData);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvh_deSerializeInPlace(IntPtr i_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern uint btQuantizedBvh_getAlignmentSerializationPadding();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvh_getLeafNodeArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvh_getQuantizedNodeArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvh_getSubtreeInfoArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btQuantizedBvh_isQuantized(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_reportAabbOverlappingNodex(IntPtr obj, IntPtr nodeCallback, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_reportBoxCastOverlappingNodex(IntPtr obj, IntPtr nodeCallback, [In] ref Vector3 raySource, [In] ref Vector3 rayTarget, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_reportRayOverlappingNodex(IntPtr obj, IntPtr nodeCallback, [In] ref Vector3 raySource, [In] ref Vector3 rayTarget);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btQuantizedBvh_serialize(IntPtr obj, IntPtr o_alignedDataBuffer, uint i_dataBufferSize, bool i_swapEndian);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvh_serialize2(IntPtr obj, IntPtr dataBuffer, IntPtr serializer);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_setQuantizationValues(IntPtr obj, [In] ref Vector3 bvhAabbMin, [In] ref Vector3 bvhAabbMax, float quantizationMargin);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_setTraversalMode(IntPtr obj, QuantizedBvh.TraversalMode traversalMode);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_unQuantize(IntPtr obj, IntPtr vecIn, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvh_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvhNode_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btQuantizedBvhNode_getEscapeIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btQuantizedBvhNode_getEscapeIndexOrTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btQuantizedBvhNode_getPartId(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvhNode_getQuantizedAabbMax(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvhNode_getQuantizedAabbMin(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btQuantizedBvhNode_getTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btQuantizedBvhNode_isLeafNode(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvhNode_setEscapeIndexOrTriangleIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btQuantizedBvhNode_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btQuantizedBvhTree_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -2805,6 +3088,33 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btShapeHull_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSimulationIslandManager_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_buildAndProcessIslands(IntPtr obj, IntPtr dispatcher, IntPtr collisionWorld, IntPtr callback);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_buildIslands(IntPtr obj, IntPtr dispatcher, IntPtr colWorld);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_findUnions(IntPtr obj, IntPtr dispatcher, IntPtr colWorld);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btSimulationIslandManager_getSplitIslands(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSimulationIslandManager_getUnionFind(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_initUnionFind(IntPtr obj, int n);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_setSplitIslands(IntPtr obj, bool doSplitIslands);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_storeIslandActivationState(IntPtr obj, IntPtr world);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_updateActivationState(IntPtr obj, IntPtr colWorld, IntPtr dispatcher);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSimulationIslandManager_IslandCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSoftBody_new(IntPtr worldInfo, int node_count, [In] Vector3[] x, [In] float[] m);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -3963,6 +4273,14 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSoftSoftCollisionAlgorithm_new2(IntPtr mf, IntPtr ci, IntPtr body0Wrap, IntPtr body1Wrap);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSortedOverlappingPairCache_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSortedOverlappingPairCache_getOverlapFilterCallback(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btSortedOverlappingPairCache_needsBroadphaseCollision(IntPtr obj, IntPtr proxy0, IntPtr proxy1);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSphereBoxCollisionAlgorithm_CreateFunc_new();
@ -4017,6 +4335,77 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStorageResult_setNormalOnSurfaceB(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_calculateAabbBruteForce(IntPtr obj, out Vector3 aabbMin, out Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btStridingMeshInterface_calculateSerializeBufferSize(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_getLockedReadOnlyVertexIndexBase(IntPtr obj, out IntPtr vertexbase, out int numverts, out PhyScalarType type, out int vertexStride, out IntPtr indexbase, out int indexstride, out int numfaces, out PhyScalarType indicestype, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_getLockedVertexIndexBase(IntPtr obj, out IntPtr vertexbase, out int numverts, out PhyScalarType type, out int vertexStride, out IntPtr indexbase, out int indexstride, out int numfaces, out PhyScalarType indicestype, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btStridingMeshInterface_getNumSubParts(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_getPremadeAabb(IntPtr obj, out Vector3 aabbMin, out Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_getScaling(IntPtr obj, out Vector3 scaling);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btStridingMeshInterface_hasPremadeAabb(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_InternalProcessAllTriangles(IntPtr obj, IntPtr callback, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_preallocateIndices(IntPtr obj, int numindices);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_preallocateVertices(IntPtr obj, int numverts);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btStridingMeshInterface_serialize(IntPtr obj, IntPtr dataBuffer, IntPtr serializer);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_setPremadeAabb(IntPtr obj, [In] ref Vector3 aabbMin, [In] ref Vector3 aabbMax);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_setScaling(IntPtr obj, [In] ref Vector3 scaling);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_unLockReadOnlyVertexBase(IntPtr obj, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_unLockVertexBase(IntPtr obj, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btStridingMeshInterface_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSubSimplexClosestResult_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSubSimplexClosestResult_getBarycentricCoords(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_getClosestPointOnSimplex(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btSubSimplexClosestResult_getDegenerate(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btSubSimplexClosestResult_getUsedVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btSubSimplexClosestResult_isValid(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_reset(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setBarycentricCoordinates(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setBarycentricCoordinates2(IntPtr obj, float a);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setBarycentricCoordinates3(IntPtr obj, float a, float b);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setBarycentricCoordinates4(IntPtr obj, float a, float b, float c);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setBarycentricCoordinates5(IntPtr obj, float a, float b, float c, float d);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setClosestPointOnSimplex(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setDegenerate(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_setUsedVertices(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btSubSimplexClosestResult_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTetrahedronShapeEx_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -4033,6 +4422,94 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btThreads_btSetTaskScheduler(IntPtr taskScheduler);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleBuffer_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleBuffer_clearBuffer(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btTriangleBuffer_getNumTriangles(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleBuffer_getTriangle(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleCallbackWrapper_new(IntPtr internalProcessTriangleIndexCallback);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleCallback_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleIndexVertexArray_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleIndexVertexArray_new2(int numTriangles, IntPtr triangleIndexBase, int triangleIndexStride, int numVertices, IntPtr vertexBase, int vertexStride);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleIndexVertexArray_addIndexedMesh(IntPtr obj, IntPtr mesh, PhyScalarType indexType);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleIndexVertexArray_getIndexedMeshArray(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleIndexVertexMaterialArray_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleIndexVertexMaterialArray_new2(int numTriangles, IntPtr triangleIndexBase, int triangleIndexStride, int numVertices, IntPtr vertexBase, int vertexStride, int numMaterials, IntPtr materialBase, int materialStride, IntPtr triangleMaterialsBase, int materialIndexStride);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleIndexVertexMaterialArray_addMaterialProperties(IntPtr obj, IntPtr mat, PhyScalarType triangleType);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleIndexVertexMaterialArray_getLockedMaterialBase(IntPtr obj, out IntPtr materialBase, out int numMaterials, out PhyScalarType materialType, out int materialStride, out IntPtr triangleMaterialBase, out int numTriangles, out int triangleMaterialStride, out PhyScalarType triangleType, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleIndexVertexMaterialArray_getLockedReadOnlyMaterialBase(IntPtr obj, out IntPtr materialBase, out int numMaterials, out PhyScalarType materialType, out int materialStride, out IntPtr triangleMaterialBase, out int numTriangles, out int triangleMaterialStride, out PhyScalarType triangleType, int subpart);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleInfoMap_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btTriangleInfoMap_calculateSerializeBufferSize(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfoMap_getConvexEpsilon(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfoMap_getEdgeDistanceThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfoMap_getEqualVertexThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfoMap_getMaxEdgeAngleThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfoMap_getPlanarEpsilon(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfoMap_getZeroAreaThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleInfoMap_serialize(IntPtr obj, IntPtr dataBuffer, IntPtr serializer);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfoMap_setConvexEpsilon(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfoMap_setEdgeDistanceThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfoMap_setEqualVertexThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfoMap_setMaxEdgeAngleThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfoMap_setPlanarEpsilon(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfoMap_setZeroAreaThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfoMap_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleInfo_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfo_getEdgeV0V1Angle(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfo_getEdgeV1V2Angle(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleInfo_getEdgeV2V0Angle(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btTriangleInfo_getFlags(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfo_setEdgeV0V1Angle(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfo_setEdgeV1V2Angle(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfo_setEdgeV2V0Angle(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfo_setFlags(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleInfo_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleMeshShape_getLocalAabbMax(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -4046,6 +4523,29 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleMeshShape_recalcLocalAabb(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleMesh_new(bool use32bitIndices, bool use4componentVertices);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleMesh_addIndex(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleMesh_addTriangle(IntPtr obj, [In] ref Vector3 vertex0, [In] ref Vector3 vertex1, [In] ref Vector3 vertex2, bool removeDuplicateVertices);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleMesh_addTriangleIndices(IntPtr obj, int index1, int index2, int index3);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btTriangleMesh_findOrAddVertex(IntPtr obj, [In] ref Vector3 vertex, bool removeDuplicateVertices);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btTriangleMesh_getNumTriangles(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btTriangleMesh_getUse32bitIndices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btTriangleMesh_getUse4componentVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btTriangleMesh_getWeldingThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangleMesh_setWeldingThreshold(IntPtr obj, float value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangleShape_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -4073,11 +4573,195 @@ namespace BulletSharp
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btTriangleShapeEx_overlap_test_conservative(IntPtr obj, IntPtr other);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btTriangle_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btTriangle_getPartId(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btTriangle_getTriangleIndex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_getVertex0(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_getVertex1(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_getVertex2(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_setPartId(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_setTriangleIndex(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_setVertex0(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_setVertex1(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_setVertex2(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btTriangle_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btUniformScalingShape_new(IntPtr convexChildShape, float uniformScalingFactor);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btUniformScalingShape_getUniformScalingFactor(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btUnionFind_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUnionFind_allocate(IntPtr obj, int N);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btUnionFind_find(IntPtr obj, int p, int q);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btUnionFind_find2(IntPtr obj, int x);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUnionFind_Free(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btUnionFind_getElement(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btUnionFind_getNumElements(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUnionFind_isRoot(IntPtr obj, int x);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUnionFind_reset(IntPtr obj, int N);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUnionFind_sortIslands(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUnionFind_unite(IntPtr obj, int p, int q);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUnionFind_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUnused1(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUnused2(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUnused3(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUnused4(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUsedVertexA(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUsedVertexB(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUsedVertexC(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btUsageBitfield_getUsedVertexD(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_reset(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUnused1(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUnused2(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUnused3(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUnused4(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUsedVertexA(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUsedVertexB(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUsedVertexC(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btUsageBitfield_setUsedVertexD(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btVoronoiSimplexSolver_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_addVertex(IntPtr obj, [In] ref Vector3 w, [In] ref Vector3 p, [In] ref Vector3 q);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_backup_closest(IntPtr obj, out Vector3 v);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_closest(IntPtr obj, out Vector3 v);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_closestPtPointTetrahedron(IntPtr obj, [In] ref Vector3 p, [In] ref Vector3 a, [In] ref Vector3 b, [In] ref Vector3 c, [In] ref Vector3 d, IntPtr finalResult);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_closestPtPointTriangle(IntPtr obj, [In] ref Vector3 p, [In] ref Vector3 a, [In] ref Vector3 b, [In] ref Vector3 c, IntPtr result);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_compute_points(IntPtr obj, out Vector3 p1, out Vector3 p2);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_emptySimplex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_fullSimplex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btVoronoiSimplexSolver_getCachedBC(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_getCachedP1(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_getCachedP2(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_getCachedV(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_getCachedValidClosest(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btVoronoiSimplexSolver_getEqualVertexThreshold(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_getLastW(IntPtr obj, out Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_getNeedsUpdate(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btVoronoiSimplexSolver_getNumVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btVoronoiSimplexSolver_getSimplex(IntPtr obj, Vector3[] pBuf, Vector3[] qBuf, Vector3[] yBuf);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btVoronoiSimplexSolver_getSimplexPointsP(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btVoronoiSimplexSolver_getSimplexPointsQ(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr btVoronoiSimplexSolver_getSimplexVectorW(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_inSimplex(IntPtr obj, [In] ref Vector3 w);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern float btVoronoiSimplexSolver_maxVertex(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btVoronoiSimplexSolver_numVertices(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern int btVoronoiSimplexSolver_pointOutsideOfPlane(IntPtr obj, [In] ref Vector3 p, [In] ref Vector3 a, [In] ref Vector3 b, [In] ref Vector3 c, [In] ref Vector3 d);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_reduceVertices(IntPtr obj, IntPtr usedVerts);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_removeVertex(IntPtr obj, int index);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_reset(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setCachedBC(IntPtr obj, IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setCachedP1(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setCachedP2(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setCachedV(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setCachedValidClosest(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setEqualVertexThreshold(IntPtr obj, float threshold);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setLastW(IntPtr obj, [In] ref Vector3 value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setNeedsUpdate(IntPtr obj, bool value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_setNumVertices(IntPtr obj, int value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool btVoronoiSimplexSolver_updateClosestVectorAndPoints(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void btVoronoiSimplexSolver_delete(IntPtr obj);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern IntPtr GIM_BVH_DATA_new();
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
@ -4260,5 +4944,9 @@ namespace BulletSharp
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void setGContactAddedCallback(IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void setGContactDestroyedCallback(IntPtr value);
[DllImport(Native.Dll, CallingConvention = Native.Conv)]
public static extern void setGContactProcessedCallback(IntPtr value);
}
}