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.cs48
1 files changed, 46 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
index 54a8cfd..89fd9b7 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
@@ -32,6 +32,28 @@ using OpenMetaverse;
32 32
33namespace OpenSim.Region.Physics.BulletSPlugin { 33namespace OpenSim.Region.Physics.BulletSPlugin {
34 34
35// Classes to allow some type checking for the API
36public struct BulletSim
37{
38 public BulletSim(uint id, IntPtr xx) { ID = id; Ptr = xx; }
39 public IntPtr Ptr;
40 public uint ID;
41}
42
43public struct BulletBody
44{
45 public BulletBody(uint id, IntPtr xx) { ID = id; Ptr = xx; }
46 public IntPtr Ptr;
47 public uint ID;
48}
49
50public struct BulletConstraint
51{
52 public BulletConstraint(IntPtr xx) { Ptr = xx; }
53 public IntPtr Ptr;
54}
55
56// ===============================================================================
35[StructLayout(LayoutKind.Sequential)] 57[StructLayout(LayoutKind.Sequential)]
36public struct ConvexHull 58public struct ConvexHull
37{ 59{
@@ -142,6 +164,11 @@ public struct ConfigurationParameters
142 public float shouldEnableFrictionCaching; 164 public float shouldEnableFrictionCaching;
143 public float numberOfSolverIterations; 165 public float numberOfSolverIterations;
144 166
167 public float linkConstraintUseFrameOffset;
168 public float linkConstraintEnableTransMotor;
169 public float linkConstraintTransMotorMaxVel;
170 public float linkConstraintTransMotorMaxForce;
171
145 public const float numericTrue = 1f; 172 public const float numericTrue = 1f;
146 public const float numericFalse = 0f; 173 public const float numericFalse = 0f;
147} 174}
@@ -162,6 +189,7 @@ public enum CollisionFlags : uint
162 PHYSICAL_OBJECT = 1 << 12, 189 PHYSICAL_OBJECT = 1 << 12,
163}; 190};
164 191
192// ===============================================================================
165static class BulletSimAPI { 193static class BulletSimAPI {
166 194
167[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 195[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
@@ -214,6 +242,7 @@ public static extern bool CreateObject(uint worldID, ShapeData shapeData);
214[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 242[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
215public static extern void CreateLinkset(uint worldID, int objectCount, ShapeData[] shapeDatas); 243public static extern void CreateLinkset(uint worldID, int objectCount, ShapeData[] shapeDatas);
216 244
245/* Remove old functionality
217[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 246[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
218public static extern void AddConstraint(uint worldID, uint id1, uint id2, 247public static extern void AddConstraint(uint worldID, uint id1, uint id2,
219 Vector3 frame1, Quaternion frame1rot, 248 Vector3 frame1, Quaternion frame1rot,
@@ -225,6 +254,7 @@ public static extern bool RemoveConstraintByID(uint worldID, uint id1);
225 254
226[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 255[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
227public static extern bool RemoveConstraint(uint worldID, uint id1, uint id2); 256public static extern bool RemoveConstraint(uint worldID, uint id1, uint id2);
257 */
228 258
229[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 259[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
230public static extern Vector3 GetObjectPosition(uint WorldID, uint id); 260public static extern Vector3 GetObjectPosition(uint WorldID, uint id);
@@ -350,8 +380,22 @@ public static extern IntPtr CreateObject2(IntPtr sim, ShapeData shapeData);
350[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 380[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
351public static extern IntPtr CreateConstraint2(IntPtr sim, IntPtr obj1, IntPtr obj2, 381public static extern IntPtr CreateConstraint2(IntPtr sim, IntPtr obj1, IntPtr obj2,
352 Vector3 frame1loc, Quaternion frame1rot, 382 Vector3 frame1loc, Quaternion frame1rot,
353 Vector3 frame2loc, Quaternion frame2rot, 383 Vector3 frame2loc, Quaternion frame2rot);
354 Vector3 lowLinear, Vector3 hiLinear, Vector3 lowAngular, Vector3 hiAngular); 384
385[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
386public static extern bool SetLinearLimits2(IntPtr constrain, Vector3 low, Vector3 hi);
387
388[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
389public static extern bool SetAngularLimits2(IntPtr constrain, Vector3 low, Vector3 hi);
390
391[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
392public static extern bool UseFrameOffset2(IntPtr constrain, float enable);
393
394[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
395public static extern bool TranslationalLimitMotor2(IntPtr constrain, float enable, float targetVel, float maxMotorForce);
396
397[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
398public static extern bool CalculateTransforms2(IntPtr constrain);
355 399
356[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 400[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
357public static extern bool DestroyConstraint2(IntPtr sim, IntPtr constrain); 401public static extern bool DestroyConstraint2(IntPtr sim, IntPtr constrain);