aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs44
1 files changed, 25 insertions, 19 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
index a43880d..5ffd591 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
@@ -101,9 +101,8 @@ public struct BulletShape
101 } 101 }
102 public IntPtr ptr; 102 public IntPtr ptr;
103 public ShapeData.PhysicsShapeType type; 103 public ShapeData.PhysicsShapeType type;
104 public ulong shapeKey; 104 public System.UInt64 shapeKey;
105 public bool isNativeShape; 105 public bool isNativeShape;
106 // Hulls have an underlying mesh. A pointer to it is hidden here.
107 public override string ToString() 106 public override string ToString()
108 { 107 {
109 StringBuilder buff = new StringBuilder(); 108 StringBuilder buff = new StringBuilder();
@@ -192,8 +191,9 @@ public struct ShapeData
192 SHAPE_SPHERE = 5, 191 SHAPE_SPHERE = 5,
193 SHAPE_MESH = 6, 192 SHAPE_MESH = 6,
194 SHAPE_HULL = 7, 193 SHAPE_HULL = 7,
195 SHAPE_GROUNDPLANE = 8, 194 // following defined by BulletSim
196 SHAPE_TERRAIN = 9, 195 SHAPE_GROUNDPLANE = 20,
196 SHAPE_TERRAIN = 21,
197 }; 197 };
198 public uint ID; 198 public uint ID;
199 public PhysicsShapeType Type; 199 public PhysicsShapeType Type;
@@ -223,6 +223,7 @@ public struct ShapeData
223 KEY_SPHERE = 2, 223 KEY_SPHERE = 2,
224 KEY_CONE = 3, 224 KEY_CONE = 3,
225 KEY_CYLINDER = 4, 225 KEY_CYLINDER = 4,
226 KEY_CAPSULE = 5,
226 } 227 }
227} 228}
228[StructLayout(LayoutKind.Sequential)] 229[StructLayout(LayoutKind.Sequential)]
@@ -282,6 +283,7 @@ public struct ConfigurationParameters
282 public float terrainHitFraction; 283 public float terrainHitFraction;
283 public float terrainRestitution; 284 public float terrainRestitution;
284 public float avatarFriction; 285 public float avatarFriction;
286 public float avatarStandingFriction;
285 public float avatarDensity; 287 public float avatarDensity;
286 public float avatarRestitution; 288 public float avatarRestitution;
287 public float avatarCapsuleRadius; 289 public float avatarCapsuleRadius;
@@ -305,6 +307,8 @@ public struct ConfigurationParameters
305 public float linkConstraintCFM; 307 public float linkConstraintCFM;
306 public float linkConstraintSolverIterations; 308 public float linkConstraintSolverIterations;
307 309
310 public float physicsLoggingFrames;
311
308 public const float numericTrue = 1f; 312 public const float numericTrue = 1f;
309 public const float numericFalse = 0f; 313 public const float numericFalse = 0f;
310} 314}
@@ -386,7 +390,7 @@ public enum CollisionFilterGroups : uint
386 VolumeDetectMask = ~BSensorTrigger, 390 VolumeDetectMask = ~BSensorTrigger,
387 TerrainFilter = BTerrainFilter, 391 TerrainFilter = BTerrainFilter,
388 TerrainMask = BAllFilter & ~BStaticFilter, 392 TerrainMask = BAllFilter & ~BStaticFilter,
389 GroundPlaneFilter = BAllFilter, 393 GroundPlaneFilter = BGroundPlaneFilter,
390 GroundPlaneMask = BAllFilter 394 GroundPlaneMask = BAllFilter
391 395
392}; 396};
@@ -426,6 +430,7 @@ public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg
426[return: MarshalAs(UnmanagedType.LPStr)] 430[return: MarshalAs(UnmanagedType.LPStr)]
427public static extern string GetVersion(); 431public static extern string GetVersion();
428 432
433/* Remove the linkage to the old api methods
429[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 434[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
430public static extern uint Initialize(Vector3 maxPosition, IntPtr parms, 435public static extern uint Initialize(Vector3 maxPosition, IntPtr parms,
431 int maxCollisions, IntPtr collisionArray, 436 int maxCollisions, IntPtr collisionArray,
@@ -529,7 +534,7 @@ public static extern Vector3 RecoverFromPenetration(uint worldID, uint id);
529// =============================================================================== 534// ===============================================================================
530[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 535[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
531public static extern void DumpBulletStatistics(); 536public static extern void DumpBulletStatistics();
532 537*/
533// Log a debug message 538// Log a debug message
534[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 539[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
535public static extern void SetDebugLogCallback(DebugLogCallback callback); 540public static extern void SetDebugLogCallback(DebugLogCallback callback);
@@ -560,7 +565,8 @@ public static extern IntPtr GetBodyHandle2(IntPtr world, uint id);
560[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 565[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
561public static extern IntPtr Initialize2(Vector3 maxPosition, IntPtr parms, 566public static extern IntPtr Initialize2(Vector3 maxPosition, IntPtr parms,
562 int maxCollisions, IntPtr collisionArray, 567 int maxCollisions, IntPtr collisionArray,
563 int maxUpdates, IntPtr updateArray); 568 int maxUpdates, IntPtr updateArray,
569 DebugLogCallback logRoutine);
564 570
565[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 571[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
566public static extern bool UpdateParameter2(IntPtr world, uint localID, String parm, float value); 572public static extern bool UpdateParameter2(IntPtr world, uint localID, String parm, float value);
@@ -602,6 +608,9 @@ public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData)
602public static extern bool IsNativeShape2(IntPtr shape); 608public static extern bool IsNativeShape2(IntPtr shape);
603 609
604[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 610[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
611public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale);
612
613[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
605public static extern IntPtr CreateCompoundShape2(IntPtr sim); 614public static extern IntPtr CreateCompoundShape2(IntPtr sim);
606 615
607[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 616[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
@@ -1037,18 +1046,6 @@ public static extern IntPtr GetConstraintRef2(IntPtr obj, int index);
1037public static extern int GetNumConstraintRefs2(IntPtr obj); 1046public static extern int GetNumConstraintRefs2(IntPtr obj);
1038 1047
1039[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1048[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1040public static extern Vector3 GetDeltaLinearVelocity2(IntPtr obj);
1041
1042[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1043public static extern Vector3 GetDeltaAngularVelocity2(IntPtr obj);
1044
1045[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1046public static extern Vector3 GetPushVelocity2(IntPtr obj);
1047
1048[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1049public static extern Vector3 GetTurnVelocity2(IntPtr obj);
1050
1051[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1052public static extern void SetCollisionFilterMask2(IntPtr body, uint filter, uint mask); 1049public static extern void SetCollisionFilterMask2(IntPtr body, uint filter, uint mask);
1053 1050
1054// ===================================================================================== 1051// =====================================================================================
@@ -1108,6 +1105,15 @@ public static extern float GetMargin2(IntPtr shape);
1108public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject); 1105public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject);
1109 1106
1110[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1107[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1108public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape);
1109
1110[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1111public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain);
1112
1113[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1114public static extern void DumpAllInfo2(IntPtr sim);
1115
1116[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
1111public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); 1117public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo);
1112 1118
1113[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 1119[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]