aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
diff options
context:
space:
mode:
authorRobert Adams2012-07-20 14:08:29 -0700
committerRobert Adams2012-07-20 14:08:29 -0700
commitca3b6b1f90f89ab3be4a43863da81f9df0993e2f (patch)
tree3100b50cd2f7aba86edec7ed9600b1e434cc2672 /OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
parentRemove an added but unnecessary dependency in prebuild.xml (diff)
downloadopensim-SC_OLD-ca3b6b1f90f89ab3be4a43863da81f9df0993e2f.zip
opensim-SC_OLD-ca3b6b1f90f89ab3be4a43863da81f9df0993e2f.tar.gz
opensim-SC_OLD-ca3b6b1f90f89ab3be4a43863da81f9df0993e2f.tar.bz2
opensim-SC_OLD-ca3b6b1f90f89ab3be4a43863da81f9df0993e2f.tar.xz
BulletSim: more detail logging for vehicle and general physics debugging.
Physical linksets are fully functional. Tweeking of the vehicle code to make it semi-work. Utilize the new API2 for some setting operations. Add GetOrientation() API call for proper reporting of children of linksets. Changes the interface between C# and C++ code so old DLLs won't work!
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
index 086f0dc..babb707 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
@@ -146,6 +146,22 @@ public struct ConfigurationParameters
146 public const float numericFalse = 0f; 146 public const float numericFalse = 0f;
147} 147}
148 148
149// Values used by Bullet and BulletSim to control collisions
150public enum CollisionFlags : uint
151{
152 STATIC_OBJECT = 1 << 0,
153 KINEMATIC_OBJECT = 1 << 1,
154 NO_CONTACT_RESPONSE = 1 << 2,
155 CUSTOM_MATERIAL_CALLBACK = 1 << 3,
156 CHARACTER_OBJECT = 1 << 4,
157 DISABLE_VISUALIZE_OBJECT = 1 << 5,
158 DISABLE_SPU_COLLISION_PROCESS = 1 << 6,
159 // Following used by BulletSim to control collisions
160 VOLUME_DETECT_OBJECT = 1 << 10,
161 PHANTOM_OBJECT = 1 << 11,
162 PHYSICAL_OBJECT = 1 << 12,
163};
164
149static class BulletSimAPI { 165static class BulletSimAPI {
150 166
151[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 167[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
@@ -214,6 +230,9 @@ public static extern bool RemoveConstraint(uint worldID, uint id1, uint id2);
214public static extern Vector3 GetObjectPosition(uint WorldID, uint id); 230public static extern Vector3 GetObjectPosition(uint WorldID, uint id);
215 231
216[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 232[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
233public static extern Quaternion GetObjectOrientation(uint WorldID, uint id);
234
235[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
217public static extern bool SetObjectTranslation(uint worldID, uint id, Vector3 position, Quaternion rotation); 236public static extern bool SetObjectTranslation(uint worldID, uint id, Vector3 position, Quaternion rotation);
218 237
219[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 238[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
@@ -268,5 +287,37 @@ public static extern void DumpBulletStatistics();
268public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); 287public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg);
269[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] 288[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
270public static extern void SetDebugLogCallback(DebugLogCallback callback); 289public static extern void SetDebugLogCallback(DebugLogCallback callback);
290
291// ===============================================================================
292// ===============================================================================
293// ===============================================================================
294// A new version of the API that moves all the logic out of the C++ code and into
295// the C# code. This will make modifications easier for the next person.
296// This interface passes the actual pointers to the objects in the unmanaged
297// address space. All the management (calls for creation/destruction/lookup)
298// is done in the C# code.
299// The names have a 2 tacked on. This will be removed as the code gets rebuilt
300// and the old code is removed from the C# code.
301[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
302public static extern IntPtr GetSimHandle2(uint worldID);
303
304[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
305public static extern IntPtr GetBodyHandleWorldID2(uint worldID, uint id);
306
307[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
308public static extern IntPtr GetBodyHandle2(IntPtr sim, uint id);
309
310[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
311public static extern IntPtr ClearForces2(IntPtr obj);
312
313[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
314public static extern IntPtr SetCollisionFlags2(IntPtr obj, uint flags);
315
316[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
317public static extern IntPtr AddToCollisionFlags2(IntPtr obj, uint flags);
318
319[DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
320public static extern IntPtr RemoveFromCollisionFlags2(IntPtr obj, uint flags);
321
271} 322}
272} 323}