diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 242 |
1 files changed, 67 insertions, 175 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 5ffd591..e60a760 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |||
@@ -88,11 +88,11 @@ public struct BulletShape | |||
88 | public BulletShape(IntPtr xx) | 88 | public BulletShape(IntPtr xx) |
89 | { | 89 | { |
90 | ptr = xx; | 90 | ptr = xx; |
91 | type=ShapeData.PhysicsShapeType.SHAPE_UNKNOWN; | 91 | type=BSPhysicsShapeType.SHAPE_UNKNOWN; |
92 | shapeKey = 0; | 92 | shapeKey = (System.UInt64)FixedShapeKey.KEY_NONE; |
93 | isNativeShape = false; | 93 | isNativeShape = false; |
94 | } | 94 | } |
95 | public BulletShape(IntPtr xx, ShapeData.PhysicsShapeType typ) | 95 | public BulletShape(IntPtr xx, BSPhysicsShapeType typ) |
96 | { | 96 | { |
97 | ptr = xx; | 97 | ptr = xx; |
98 | type = typ; | 98 | type = typ; |
@@ -100,7 +100,7 @@ public struct BulletShape | |||
100 | isNativeShape = false; | 100 | isNativeShape = false; |
101 | } | 101 | } |
102 | public IntPtr ptr; | 102 | public IntPtr ptr; |
103 | public ShapeData.PhysicsShapeType type; | 103 | public BSPhysicsShapeType type; |
104 | public System.UInt64 shapeKey; | 104 | public System.UInt64 shapeKey; |
105 | public bool isNativeShape; | 105 | public bool isNativeShape; |
106 | public override string ToString() | 106 | public override string ToString() |
@@ -152,7 +152,7 @@ public class BulletHeightMapInfo | |||
152 | ID = id; | 152 | ID = id; |
153 | Ptr = xx; | 153 | Ptr = xx; |
154 | heightMap = hm; | 154 | heightMap = hm; |
155 | terrainRegionBase = new Vector2(0f, 0f); | 155 | terrainRegionBase = Vector3.Zero; |
156 | minCoords = new Vector3(100f, 100f, 25f); | 156 | minCoords = new Vector3(100f, 100f, 25f); |
157 | maxCoords = new Vector3(101f, 101f, 26f); | 157 | maxCoords = new Vector3(101f, 101f, 26f); |
158 | minZ = maxZ = 0f; | 158 | minZ = maxZ = 0f; |
@@ -161,7 +161,7 @@ public class BulletHeightMapInfo | |||
161 | public uint ID; | 161 | public uint ID; |
162 | public IntPtr Ptr; | 162 | public IntPtr Ptr; |
163 | public float[] heightMap; | 163 | public float[] heightMap; |
164 | public Vector2 terrainRegionBase; | 164 | public Vector3 terrainRegionBase; |
165 | public Vector3 minCoords; | 165 | public Vector3 minCoords; |
166 | public Vector3 maxCoords; | 166 | public Vector3 maxCoords; |
167 | public float sizeX, sizeY; | 167 | public float sizeX, sizeY; |
@@ -178,25 +178,39 @@ public struct ConvexHull | |||
178 | int VertexCount; | 178 | int VertexCount; |
179 | Vector3[] Vertices; | 179 | Vector3[] Vertices; |
180 | } | 180 | } |
181 | public enum BSPhysicsShapeType | ||
182 | { | ||
183 | SHAPE_UNKNOWN = 0, | ||
184 | SHAPE_CAPSULE = 1, | ||
185 | SHAPE_BOX = 2, | ||
186 | SHAPE_CONE = 3, | ||
187 | SHAPE_CYLINDER = 4, | ||
188 | SHAPE_SPHERE = 5, | ||
189 | SHAPE_MESH = 6, | ||
190 | SHAPE_HULL = 7, | ||
191 | // following defined by BulletSim | ||
192 | SHAPE_GROUNDPLANE = 20, | ||
193 | SHAPE_TERRAIN = 21, | ||
194 | SHAPE_COMPOUND = 22, | ||
195 | SHAPE_HEIGHTMAP = 23, | ||
196 | }; | ||
197 | |||
198 | // The native shapes have predefined shape hash keys | ||
199 | public enum FixedShapeKey : ulong | ||
200 | { | ||
201 | KEY_NONE = 0, | ||
202 | KEY_BOX = 1, | ||
203 | KEY_SPHERE = 2, | ||
204 | KEY_CONE = 3, | ||
205 | KEY_CYLINDER = 4, | ||
206 | KEY_CAPSULE = 5, | ||
207 | } | ||
208 | |||
181 | [StructLayout(LayoutKind.Sequential)] | 209 | [StructLayout(LayoutKind.Sequential)] |
182 | public struct ShapeData | 210 | public struct ShapeData |
183 | { | 211 | { |
184 | public enum PhysicsShapeType | ||
185 | { | ||
186 | SHAPE_UNKNOWN = 0, | ||
187 | SHAPE_AVATAR = 1, | ||
188 | SHAPE_BOX = 2, | ||
189 | SHAPE_CONE = 3, | ||
190 | SHAPE_CYLINDER = 4, | ||
191 | SHAPE_SPHERE = 5, | ||
192 | SHAPE_MESH = 6, | ||
193 | SHAPE_HULL = 7, | ||
194 | // following defined by BulletSim | ||
195 | SHAPE_GROUNDPLANE = 20, | ||
196 | SHAPE_TERRAIN = 21, | ||
197 | }; | ||
198 | public uint ID; | 212 | public uint ID; |
199 | public PhysicsShapeType Type; | 213 | public BSPhysicsShapeType Type; |
200 | public Vector3 Position; | 214 | public Vector3 Position; |
201 | public Quaternion Rotation; | 215 | public Quaternion Rotation; |
202 | public Vector3 Velocity; | 216 | public Vector3 Velocity; |
@@ -215,16 +229,6 @@ public struct ShapeData | |||
215 | // note that bools are passed as floats since bool size changes by language and architecture | 229 | // note that bools are passed as floats since bool size changes by language and architecture |
216 | public const float numericTrue = 1f; | 230 | public const float numericTrue = 1f; |
217 | public const float numericFalse = 0f; | 231 | public const float numericFalse = 0f; |
218 | |||
219 | // The native shapes have predefined shape hash keys | ||
220 | public enum FixedShapeKey : ulong | ||
221 | { | ||
222 | KEY_BOX = 1, | ||
223 | KEY_SPHERE = 2, | ||
224 | KEY_CONE = 3, | ||
225 | KEY_CYLINDER = 4, | ||
226 | KEY_CAPSULE = 5, | ||
227 | } | ||
228 | } | 232 | } |
229 | [StructLayout(LayoutKind.Sequential)] | 233 | [StructLayout(LayoutKind.Sequential)] |
230 | public struct SweepHit | 234 | public struct SweepHit |
@@ -279,6 +283,7 @@ public struct ConfigurationParameters | |||
279 | public float ccdSweptSphereRadius; | 283 | public float ccdSweptSphereRadius; |
280 | public float contactProcessingThreshold; | 284 | public float contactProcessingThreshold; |
281 | 285 | ||
286 | public float terrainImplementation; | ||
282 | public float terrainFriction; | 287 | public float terrainFriction; |
283 | public float terrainHitFraction; | 288 | public float terrainHitFraction; |
284 | public float terrainRestitution; | 289 | public float terrainRestitution; |
@@ -286,7 +291,8 @@ public struct ConfigurationParameters | |||
286 | public float avatarStandingFriction; | 291 | public float avatarStandingFriction; |
287 | public float avatarDensity; | 292 | public float avatarDensity; |
288 | public float avatarRestitution; | 293 | public float avatarRestitution; |
289 | public float avatarCapsuleRadius; | 294 | public float avatarCapsuleWidth; |
295 | public float avatarCapsuleDepth; | ||
290 | public float avatarCapsuleHeight; | 296 | public float avatarCapsuleHeight; |
291 | public float avatarContactProcessingThreshold; | 297 | public float avatarContactProcessingThreshold; |
292 | 298 | ||
@@ -299,6 +305,7 @@ public struct ConfigurationParameters | |||
299 | public float shouldEnableFrictionCaching; | 305 | public float shouldEnableFrictionCaching; |
300 | public float numberOfSolverIterations; | 306 | public float numberOfSolverIterations; |
301 | 307 | ||
308 | public float linksetImplementation; | ||
302 | public float linkConstraintUseFrameOffset; | 309 | public float linkConstraintUseFrameOffset; |
303 | public float linkConstraintEnableTransMotor; | 310 | public float linkConstraintEnableTransMotor; |
304 | public float linkConstraintTransMotorMaxVel; | 311 | public float linkConstraintTransMotorMaxVel; |
@@ -378,6 +385,7 @@ public enum CollisionFilterGroups : uint | |||
378 | BTerrainFilter = 1 << 11, | 385 | BTerrainFilter = 1 << 11, |
379 | BRaycastFilter = 1 << 12, | 386 | BRaycastFilter = 1 << 12, |
380 | BSolidFilter = 1 << 13, | 387 | BSolidFilter = 1 << 13, |
388 | BLinksetFilter = 1 << 14, | ||
381 | 389 | ||
382 | // The collsion filters and masked are defined in one place -- don't want them scattered | 390 | // The collsion filters and masked are defined in one place -- don't want them scattered |
383 | AvatarFilter = BCharacterFilter, | 391 | AvatarFilter = BCharacterFilter, |
@@ -385,18 +393,18 @@ public enum CollisionFilterGroups : uint | |||
385 | ObjectFilter = BSolidFilter, | 393 | ObjectFilter = BSolidFilter, |
386 | ObjectMask = BAllFilter, | 394 | ObjectMask = BAllFilter, |
387 | StaticObjectFilter = BStaticFilter, | 395 | StaticObjectFilter = BStaticFilter, |
388 | StaticObjectMask = BAllFilter, | 396 | StaticObjectMask = BAllFilter & ~BStaticFilter, // static objects don't collide with each other |
397 | LinksetFilter = BLinksetFilter, | ||
398 | LinksetMask = BAllFilter & ~BLinksetFilter, // linkset objects don't collide with each other | ||
389 | VolumeDetectFilter = BSensorTrigger, | 399 | VolumeDetectFilter = BSensorTrigger, |
390 | VolumeDetectMask = ~BSensorTrigger, | 400 | VolumeDetectMask = ~BSensorTrigger, |
391 | TerrainFilter = BTerrainFilter, | 401 | TerrainFilter = BTerrainFilter, |
392 | TerrainMask = BAllFilter & ~BStaticFilter, | 402 | TerrainMask = BAllFilter & ~BStaticFilter, // static objects on the ground don't collide |
393 | GroundPlaneFilter = BGroundPlaneFilter, | 403 | GroundPlaneFilter = BGroundPlaneFilter, |
394 | GroundPlaneMask = BAllFilter | 404 | GroundPlaneMask = BAllFilter |
395 | 405 | ||
396 | }; | 406 | }; |
397 | 407 | ||
398 | |||
399 | |||
400 | // CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0 | 408 | // CFM controls the 'hardness' of the constraint. 0=fixed, 0..1=violatable. Default=0 |
401 | // ERP controls amount of correction per tick. Usable range=0.1..0.8. Default=0.2. | 409 | // ERP controls amount of correction per tick. Usable range=0.1..0.8. Default=0.2. |
402 | public enum ConstraintParams : int | 410 | public enum ConstraintParams : int |
@@ -426,140 +434,6 @@ static class BulletSimAPI { | |||
426 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 434 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
427 | public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); | 435 | public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); |
428 | 436 | ||
429 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
430 | [return: MarshalAs(UnmanagedType.LPStr)] | ||
431 | public static extern string GetVersion(); | ||
432 | |||
433 | /* Remove the linkage to the old api methods | ||
434 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
435 | public static extern uint Initialize(Vector3 maxPosition, IntPtr parms, | ||
436 | int maxCollisions, IntPtr collisionArray, | ||
437 | int maxUpdates, IntPtr updateArray, | ||
438 | DebugLogCallback logRoutine); | ||
439 | |||
440 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
441 | public static extern void CreateInitialGroundPlaneAndTerrain(uint worldID); | ||
442 | |||
443 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
444 | public static extern void SetHeightmap(uint worldID, [MarshalAs(UnmanagedType.LPArray)] float[] heightMap); | ||
445 | |||
446 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
447 | public static extern void Shutdown(uint worldID); | ||
448 | |||
449 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
450 | public static extern bool UpdateParameter(uint worldID, uint localID, | ||
451 | [MarshalAs(UnmanagedType.LPStr)]string paramCode, float value); | ||
452 | |||
453 | // =============================================================================== | ||
454 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
455 | public static extern int PhysicsStep(uint worldID, float timeStep, int maxSubSteps, float fixedTimeStep, | ||
456 | out int updatedEntityCount, | ||
457 | out IntPtr updatedEntitiesPtr, | ||
458 | out int collidersCount, | ||
459 | out IntPtr collidersPtr); | ||
460 | |||
461 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
462 | public static extern bool CreateHull(uint worldID, System.UInt64 meshKey, | ||
463 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls | ||
464 | ); | ||
465 | |||
466 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
467 | public static extern bool CreateMesh(uint worldID, System.UInt64 meshKey, | ||
468 | int indexCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, | ||
469 | int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices | ||
470 | ); | ||
471 | |||
472 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
473 | public static extern bool DestroyHull(uint worldID, System.UInt64 meshKey); | ||
474 | |||
475 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
476 | public static extern bool DestroyMesh(uint worldID, System.UInt64 meshKey); | ||
477 | |||
478 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
479 | public static extern bool CreateObject(uint worldID, ShapeData shapeData); | ||
480 | |||
481 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
482 | public static extern Vector3 GetObjectPosition(uint WorldID, uint id); | ||
483 | |||
484 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
485 | public static extern Quaternion GetObjectOrientation(uint WorldID, uint id); | ||
486 | |||
487 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
488 | public static extern bool SetObjectTranslation(uint worldID, uint id, Vector3 position, Quaternion rotation); | ||
489 | |||
490 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
491 | public static extern bool SetObjectVelocity(uint worldID, uint id, Vector3 velocity); | ||
492 | |||
493 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
494 | public static extern bool SetObjectAngularVelocity(uint worldID, uint id, Vector3 angularVelocity); | ||
495 | |||
496 | // Set the current force acting on the object | ||
497 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
498 | public static extern bool SetObjectForce(uint worldID, uint id, Vector3 force); | ||
499 | |||
500 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
501 | public static extern bool SetObjectScaleMass(uint worldID, uint id, Vector3 scale, float mass, bool isDynamic); | ||
502 | |||
503 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
504 | public static extern bool SetObjectCollidable(uint worldID, uint id, bool phantom); | ||
505 | |||
506 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
507 | public static extern bool SetObjectDynamic(uint worldID, uint id, bool isDynamic, float mass); | ||
508 | |||
509 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
510 | public static extern bool SetObjectGhost(uint worldID, uint id, bool ghostly); | ||
511 | |||
512 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
513 | public static extern bool SetObjectProperties(uint worldID, uint id, bool isStatic, bool isSolid, bool genCollisions, float mass); | ||
514 | |||
515 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
516 | public static extern bool SetObjectBuoyancy(uint worldID, uint id, float buoyancy); | ||
517 | |||
518 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
519 | public static extern bool HasObject(uint worldID, uint id); | ||
520 | |||
521 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
522 | public static extern bool DestroyObject(uint worldID, uint id); | ||
523 | |||
524 | // =============================================================================== | ||
525 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
526 | public static extern SweepHit ConvexSweepTest(uint worldID, uint id, Vector3 to, float extraMargin); | ||
527 | |||
528 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
529 | public static extern RaycastHit RayTest(uint worldID, uint id, Vector3 from, Vector3 to); | ||
530 | |||
531 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
532 | public static extern Vector3 RecoverFromPenetration(uint worldID, uint id); | ||
533 | |||
534 | // =============================================================================== | ||
535 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
536 | public static extern void DumpBulletStatistics(); | ||
537 | */ | ||
538 | // Log a debug message | ||
539 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
540 | public static extern void SetDebugLogCallback(DebugLogCallback callback); | ||
541 | |||
542 | // =============================================================================== | ||
543 | // =============================================================================== | ||
544 | // =============================================================================== | ||
545 | // A new version of the API that enables moving all the logic out of the C++ code and into | ||
546 | // the C# code. This will make modifications easier for the next person. | ||
547 | // This interface passes the actual pointers to the objects in the unmanaged | ||
548 | // address space. All the management (calls for creation/destruction/lookup) | ||
549 | // is done in the C# code. | ||
550 | // The names have a "2" tacked on. This will be removed as the C# code gets rebuilt | ||
551 | // and the old code is removed. | ||
552 | |||
553 | // Functions use while converting from API1 to API2. Can be removed when totally converted. | ||
554 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
555 | public static extern IntPtr GetSimHandle2(uint worldID); | ||
556 | |||
557 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
558 | public static extern IntPtr GetBodyHandleWorldID2(uint worldID, uint id); | ||
559 | |||
560 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
561 | public static extern IntPtr GetBodyHandle2(IntPtr world, uint id); | ||
562 | |||
563 | // =============================================================================== | 437 | // =============================================================================== |
564 | // Initialization and simulation | 438 | // Initialization and simulation |
565 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 439 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
@@ -611,13 +485,25 @@ public static extern bool IsNativeShape2(IntPtr shape); | |||
611 | public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); | 485 | public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); |
612 | 486 | ||
613 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 487 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
614 | public static extern IntPtr CreateCompoundShape2(IntPtr sim); | 488 | public static extern IntPtr CreateCompoundShape2(IntPtr sim, bool enableDynamicAabbTree); |
615 | 489 | ||
616 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 490 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
617 | public static extern void AddChildToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); | 491 | public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); |
618 | 492 | ||
619 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 493 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
620 | public static extern void RemoveChildFromCompoundShape2(IntPtr cShape, IntPtr removeShape); | 494 | public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); |
495 | |||
496 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
497 | public static extern IntPtr GetChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | ||
498 | |||
499 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
500 | public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | ||
501 | |||
502 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
503 | public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); | ||
504 | |||
505 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
506 | public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape); | ||
621 | 507 | ||
622 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 508 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
623 | public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); | 509 | public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); |
@@ -881,10 +767,10 @@ public static extern float GetCcdMotionThreshold2(IntPtr obj); | |||
881 | public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); | 767 | public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); |
882 | 768 | ||
883 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 769 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
884 | public static extern float GetCcdSweepSphereRadius2(IntPtr obj); | 770 | public static extern float GetCcdSweptSphereRadius2(IntPtr obj); |
885 | 771 | ||
886 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 772 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
887 | public static extern void SetCcdSweepSphereRadius2(IntPtr obj, float val); | 773 | public static extern void SetCcdSweptSphereRadius2(IntPtr obj, float val); |
888 | 774 | ||
889 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 775 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
890 | public static extern IntPtr GetUserPointer2(IntPtr obj); | 776 | public static extern IntPtr GetUserPointer2(IntPtr obj); |
@@ -907,6 +793,12 @@ public static extern Vector3 GetGravity2(IntPtr obj); | |||
907 | public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping); | 793 | public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping); |
908 | 794 | ||
909 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 795 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |
796 | public static extern void SetLinearDamping2(IntPtr obj, float lin_damping); | ||
797 | |||
798 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
799 | public static extern void SetAngularDamping2(IntPtr obj, float ang_damping); | ||
800 | |||
801 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
910 | public static extern float GetLinearDamping2(IntPtr obj); | 802 | public static extern float GetLinearDamping2(IntPtr obj); |
911 | 803 | ||
912 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 804 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] |