diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs | 1189 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | 888 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs | 48 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 715 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs | 116 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 246 | ||||
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs | 16 |
9 files changed, 1673 insertions, 1556 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs index 35adf11..47e7c7b 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs | |||
@@ -44,7 +44,7 @@ using System; | |||
44 | using System.Runtime.InteropServices; | 44 | using System.Runtime.InteropServices; |
45 | using System.Security; | 45 | using System.Security; |
46 | using OMV = OpenMetaverse; | 46 | using OMV = OpenMetaverse; |
47 | namespace OdeAPI | 47 | namespace OpenSim.Region.PhysicsModule.ubOde |
48 | { | 48 | { |
49 | //#if dDOUBLE | 49 | //#if dDOUBLE |
50 | // don't see much use in double precision with time steps of 20ms and 10 iterations used on opensim | 50 | // don't see much use in double precision with time steps of 20ms and 10 iterations used on opensim |
@@ -54,18 +54,18 @@ namespace OdeAPI | |||
54 | using dReal = System.Single; | 54 | using dReal = System.Single; |
55 | //#endif | 55 | //#endif |
56 | 56 | ||
57 | public static class d | 57 | internal static class SafeNativeMethods |
58 | { | 58 | { |
59 | public static dReal Infinity = dReal.MaxValue; | 59 | internal static dReal Infinity = dReal.MaxValue; |
60 | public static int NTotalBodies = 0; | 60 | internal static int NTotalBodies = 0; |
61 | public static int NTotalGeoms = 0; | 61 | internal static int NTotalGeoms = 0; |
62 | 62 | ||
63 | public const uint CONTACTS_UNIMPORTANT = 0x80000000; | 63 | internal const uint CONTACTS_UNIMPORTANT = 0x80000000; |
64 | 64 | ||
65 | #region Flags and Enumerations | 65 | #region Flags and Enumerations |
66 | 66 | ||
67 | [Flags] | 67 | [Flags] |
68 | public enum AllocateODEDataFlags : uint | 68 | internal enum AllocateODEDataFlags : uint |
69 | { | 69 | { |
70 | BasicData = 0, | 70 | BasicData = 0, |
71 | CollisionData = 0x00000001, | 71 | CollisionData = 0x00000001, |
@@ -73,13 +73,13 @@ namespace OdeAPI | |||
73 | } | 73 | } |
74 | 74 | ||
75 | [Flags] | 75 | [Flags] |
76 | public enum IniteODEFlags : uint | 76 | internal enum IniteODEFlags : uint |
77 | { | 77 | { |
78 | dInitFlagManualThreadCleanup = 0x00000001 | 78 | dInitFlagManualThreadCleanup = 0x00000001 |
79 | } | 79 | } |
80 | 80 | ||
81 | [Flags] | 81 | [Flags] |
82 | public enum ContactFlags : int | 82 | internal enum ContactFlags : int |
83 | { | 83 | { |
84 | Mu2 = 0x001, | 84 | Mu2 = 0x001, |
85 | FDir1 = 0x002, | 85 | FDir1 = 0x002, |
@@ -97,7 +97,7 @@ namespace OdeAPI | |||
97 | Approx1 = 0x3000 | 97 | Approx1 = 0x3000 |
98 | } | 98 | } |
99 | 99 | ||
100 | public enum GeomClassID : int | 100 | internal enum GeomClassID : int |
101 | { | 101 | { |
102 | SphereClass, | 102 | SphereClass, |
103 | BoxClass, | 103 | BoxClass, |
@@ -121,7 +121,7 @@ namespace OdeAPI | |||
121 | MaxUserClasses = 5 | 121 | MaxUserClasses = 5 |
122 | } | 122 | } |
123 | 123 | ||
124 | public enum JointType : int | 124 | internal enum JointType : int |
125 | { | 125 | { |
126 | None, | 126 | None, |
127 | Ball, | 127 | Ball, |
@@ -137,7 +137,7 @@ namespace OdeAPI | |||
137 | Plane2D | 137 | Plane2D |
138 | } | 138 | } |
139 | 139 | ||
140 | public enum JointParam : int | 140 | internal enum JointParam : int |
141 | { | 141 | { |
142 | LoStop, | 142 | LoStop, |
143 | HiStop, | 143 | HiStop, |
@@ -174,7 +174,7 @@ namespace OdeAPI | |||
174 | SuspensionCFM3 | 174 | SuspensionCFM3 |
175 | } | 175 | } |
176 | 176 | ||
177 | public enum dSweepAndPruneAxis : int | 177 | internal enum dSweepAndPruneAxis : int |
178 | { | 178 | { |
179 | XYZ = ((0)|(1<<2)|(2<<4)), | 179 | XYZ = ((0)|(1<<2)|(2<<4)), |
180 | XZY = ((0)|(2<<2)|(1<<4)), | 180 | XZY = ((0)|(2<<2)|(1<<4)), |
@@ -189,126 +189,126 @@ namespace OdeAPI | |||
189 | #region Callbacks | 189 | #region Callbacks |
190 | 190 | ||
191 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 191 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
192 | public delegate int AABBTestFn(IntPtr o1, IntPtr o2, ref AABB aabb); | 192 | internal delegate int AABBTestFn(IntPtr o1, IntPtr o2, ref AABB aabb); |
193 | 193 | ||
194 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 194 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
195 | public delegate int ColliderFn(IntPtr o1, IntPtr o2, int flags, out ContactGeom contact, int skip); | 195 | internal delegate int ColliderFn(IntPtr o1, IntPtr o2, int flags, out ContactGeom contact, int skip); |
196 | 196 | ||
197 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 197 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
198 | public delegate void GetAABBFn(IntPtr geom, out AABB aabb); | 198 | internal delegate void GetAABBFn(IntPtr geom, out AABB aabb); |
199 | 199 | ||
200 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 200 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
201 | public delegate ColliderFn GetColliderFnFn(int num); | 201 | internal delegate ColliderFn GetColliderFnFn(int num); |
202 | 202 | ||
203 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 203 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
204 | public delegate void GeomDtorFn(IntPtr o); | 204 | internal delegate void GeomDtorFn(IntPtr o); |
205 | 205 | ||
206 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 206 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
207 | public delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z); | 207 | internal delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z); |
208 | 208 | ||
209 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 209 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
210 | public delegate dReal OSTerrainGetHeight(IntPtr p_user_data, int x, int z); | 210 | internal delegate dReal OSTerrainGetHeight(IntPtr p_user_data, int x, int z); |
211 | 211 | ||
212 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 212 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
213 | public delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2); | 213 | internal delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2); |
214 | 214 | ||
215 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 215 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
216 | public delegate int TriCallback(IntPtr trimesh, IntPtr refObject, int triangleIndex); | 216 | internal delegate int TriCallback(IntPtr trimesh, IntPtr refObject, int triangleIndex); |
217 | 217 | ||
218 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 218 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
219 | public delegate int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount); | 219 | internal delegate int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount); |
220 | 220 | ||
221 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | 221 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] |
222 | public delegate int TriRayCallback(IntPtr trimesh, IntPtr ray, int triangleIndex, dReal u, dReal v); | 222 | internal delegate int TriRayCallback(IntPtr trimesh, IntPtr ray, int triangleIndex, dReal u, dReal v); |
223 | 223 | ||
224 | #endregion | 224 | #endregion |
225 | 225 | ||
226 | #region Structs | 226 | #region Structs |
227 | 227 | ||
228 | [StructLayout(LayoutKind.Sequential)] | 228 | [StructLayout(LayoutKind.Sequential)] |
229 | public struct AABB | 229 | internal struct AABB |
230 | { | 230 | { |
231 | public dReal MinX, MaxX; | 231 | internal dReal MinX, MaxX; |
232 | public dReal MinY, MaxY; | 232 | internal dReal MinY, MaxY; |
233 | public dReal MinZ, MaxZ; | 233 | internal dReal MinZ, MaxZ; |
234 | } | 234 | } |
235 | 235 | ||
236 | 236 | ||
237 | [StructLayout(LayoutKind.Sequential)] | 237 | [StructLayout(LayoutKind.Sequential)] |
238 | public struct Contact | 238 | internal struct Contact |
239 | { | 239 | { |
240 | public SurfaceParameters surface; | 240 | internal SurfaceParameters surface; |
241 | public ContactGeom geom; | 241 | internal ContactGeom geom; |
242 | public Vector3 fdir1; | 242 | internal Vector3 fdir1; |
243 | public static readonly int unmanagedSizeOf = Marshal.SizeOf(typeof(Contact)); | 243 | internal static readonly int unmanagedSizeOf = Marshal.SizeOf(typeof(Contact)); |
244 | } | 244 | } |
245 | 245 | ||
246 | 246 | ||
247 | [StructLayout(LayoutKind.Sequential)] | 247 | [StructLayout(LayoutKind.Sequential)] |
248 | public struct ContactGeom | 248 | internal struct ContactGeom |
249 | { | 249 | { |
250 | 250 | ||
251 | public Vector3 pos; | 251 | internal Vector3 pos; |
252 | public Vector3 normal; | 252 | internal Vector3 normal; |
253 | public dReal depth; | 253 | internal dReal depth; |
254 | public IntPtr g1; | 254 | internal IntPtr g1; |
255 | public IntPtr g2; | 255 | internal IntPtr g2; |
256 | public int side1; | 256 | internal int side1; |
257 | public int side2; | 257 | internal int side2; |
258 | public static readonly int unmanagedSizeOf = Marshal.SizeOf(typeof(ContactGeom)); | 258 | internal static readonly int unmanagedSizeOf = Marshal.SizeOf(typeof(ContactGeom)); |
259 | } | 259 | } |
260 | 260 | ||
261 | [StructLayout(LayoutKind.Sequential)] | 261 | [StructLayout(LayoutKind.Sequential)] |
262 | public struct GeomClass | 262 | internal struct GeomClass |
263 | { | 263 | { |
264 | public int bytes; | 264 | internal int bytes; |
265 | public GetColliderFnFn collider; | 265 | internal GetColliderFnFn collider; |
266 | public GetAABBFn aabb; | 266 | internal GetAABBFn aabb; |
267 | public AABBTestFn aabb_test; | 267 | internal AABBTestFn aabb_test; |
268 | public GeomDtorFn dtor; | 268 | internal GeomDtorFn dtor; |
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
272 | [StructLayout(LayoutKind.Sequential)] | 272 | [StructLayout(LayoutKind.Sequential)] |
273 | public struct JointFeedback | 273 | internal struct JointFeedback |
274 | { | 274 | { |
275 | public Vector3 f1; | 275 | internal Vector3 f1; |
276 | public Vector3 t1; | 276 | internal Vector3 t1; |
277 | public Vector3 f2; | 277 | internal Vector3 f2; |
278 | public Vector3 t2; | 278 | internal Vector3 t2; |
279 | } | 279 | } |
280 | 280 | ||
281 | 281 | ||
282 | [StructLayout(LayoutKind.Sequential)] | 282 | [StructLayout(LayoutKind.Sequential)] |
283 | public struct Mass | 283 | internal struct Mass |
284 | { | 284 | { |
285 | public dReal mass; | 285 | internal dReal mass; |
286 | public Vector4 c; | 286 | internal Vector4 c; |
287 | public Matrix3 I; | 287 | internal Matrix3 I; |
288 | } | 288 | } |
289 | 289 | ||
290 | 290 | ||
291 | [StructLayout(LayoutKind.Sequential)] | 291 | [StructLayout(LayoutKind.Sequential)] |
292 | public struct Matrix3 | 292 | internal struct Matrix3 |
293 | { | 293 | { |
294 | public Matrix3(dReal m00, dReal m10, dReal m20, dReal m01, dReal m11, dReal m21, dReal m02, dReal m12, dReal m22) | 294 | internal Matrix3(dReal m00, dReal m10, dReal m20, dReal m01, dReal m11, dReal m21, dReal m02, dReal m12, dReal m22) |
295 | { | 295 | { |
296 | M00 = m00; M10 = m10; M20 = m20; _m30 = 0.0f; | 296 | M00 = m00; M10 = m10; M20 = m20; _m30 = 0.0f; |
297 | M01 = m01; M11 = m11; M21 = m21; _m31 = 0.0f; | 297 | M01 = m01; M11 = m11; M21 = m21; _m31 = 0.0f; |
298 | M02 = m02; M12 = m12; M22 = m22; _m32 = 0.0f; | 298 | M02 = m02; M12 = m12; M22 = m22; _m32 = 0.0f; |
299 | } | 299 | } |
300 | public dReal M00, M10, M20; | 300 | internal dReal M00, M10, M20; |
301 | private dReal _m30; | 301 | private dReal _m30; |
302 | public dReal M01, M11, M21; | 302 | internal dReal M01, M11, M21; |
303 | private dReal _m31; | 303 | private dReal _m31; |
304 | public dReal M02, M12, M22; | 304 | internal dReal M02, M12, M22; |
305 | private dReal _m32; | 305 | private dReal _m32; |
306 | } | 306 | } |
307 | 307 | ||
308 | [StructLayout(LayoutKind.Sequential)] | 308 | [StructLayout(LayoutKind.Sequential)] |
309 | public struct Matrix4 | 309 | internal struct Matrix4 |
310 | { | 310 | { |
311 | public Matrix4(dReal m00, dReal m10, dReal m20, dReal m30, | 311 | internal Matrix4(dReal m00, dReal m10, dReal m20, dReal m30, |
312 | dReal m01, dReal m11, dReal m21, dReal m31, | 312 | dReal m01, dReal m11, dReal m21, dReal m31, |
313 | dReal m02, dReal m12, dReal m22, dReal m32, | 313 | dReal m02, dReal m12, dReal m22, dReal m32, |
314 | dReal m03, dReal m13, dReal m23, dReal m33) | 314 | dReal m03, dReal m13, dReal m23, dReal m33) |
@@ -318,312 +318,312 @@ namespace OdeAPI | |||
318 | M02 = m02; M12 = m12; M22 = m22; M32 = m32; | 318 | M02 = m02; M12 = m12; M22 = m22; M32 = m32; |
319 | M03 = m03; M13 = m13; M23 = m23; M33 = m33; | 319 | M03 = m03; M13 = m13; M23 = m23; M33 = m33; |
320 | } | 320 | } |
321 | public dReal M00, M10, M20, M30; | 321 | internal dReal M00, M10, M20, M30; |
322 | public dReal M01, M11, M21, M31; | 322 | internal dReal M01, M11, M21, M31; |
323 | public dReal M02, M12, M22, M32; | 323 | internal dReal M02, M12, M22, M32; |
324 | public dReal M03, M13, M23, M33; | 324 | internal dReal M03, M13, M23, M33; |
325 | } | 325 | } |
326 | 326 | ||
327 | [StructLayout(LayoutKind.Sequential)] | 327 | [StructLayout(LayoutKind.Sequential)] |
328 | public struct Quaternion | 328 | internal struct Quaternion |
329 | { | 329 | { |
330 | public dReal W, X, Y, Z; | 330 | internal dReal W, X, Y, Z; |
331 | } | 331 | } |
332 | 332 | ||
333 | 333 | ||
334 | [StructLayout(LayoutKind.Sequential)] | 334 | [StructLayout(LayoutKind.Sequential)] |
335 | public struct SurfaceParameters | 335 | internal struct SurfaceParameters |
336 | { | 336 | { |
337 | public ContactFlags mode; | 337 | internal ContactFlags mode; |
338 | public dReal mu; | 338 | internal dReal mu; |
339 | public dReal mu2; | 339 | internal dReal mu2; |
340 | public dReal bounce; | 340 | internal dReal bounce; |
341 | public dReal bounce_vel; | 341 | internal dReal bounce_vel; |
342 | public dReal soft_erp; | 342 | internal dReal soft_erp; |
343 | public dReal soft_cfm; | 343 | internal dReal soft_cfm; |
344 | public dReal motion1; | 344 | internal dReal motion1; |
345 | public dReal motion2; | 345 | internal dReal motion2; |
346 | public dReal motionN; | 346 | internal dReal motionN; |
347 | public dReal slip1; | 347 | internal dReal slip1; |
348 | public dReal slip2; | 348 | internal dReal slip2; |
349 | } | 349 | } |
350 | 350 | ||
351 | 351 | ||
352 | [StructLayout(LayoutKind.Sequential)] | 352 | [StructLayout(LayoutKind.Sequential)] |
353 | public struct Vector3 | 353 | internal struct Vector3 |
354 | { | 354 | { |
355 | public Vector3(dReal x, dReal y, dReal z) | 355 | internal Vector3(dReal x, dReal y, dReal z) |
356 | { | 356 | { |
357 | X = x; Y = y; Z = z; _w = 0.0f; | 357 | X = x; Y = y; Z = z; _w = 0.0f; |
358 | } | 358 | } |
359 | public dReal X, Y, Z; | 359 | internal dReal X, Y, Z; |
360 | private dReal _w; | 360 | private dReal _w; |
361 | } | 361 | } |
362 | 362 | ||
363 | 363 | ||
364 | [StructLayout(LayoutKind.Sequential)] | 364 | [StructLayout(LayoutKind.Sequential)] |
365 | public struct Vector4 | 365 | internal struct Vector4 |
366 | { | 366 | { |
367 | public Vector4(dReal x, dReal y, dReal z, dReal w) | 367 | internal Vector4(dReal x, dReal y, dReal z, dReal w) |
368 | { | 368 | { |
369 | X = x; Y = y; Z = z; W = w; | 369 | X = x; Y = y; Z = z; W = w; |
370 | } | 370 | } |
371 | public dReal X, Y, Z, W; | 371 | internal dReal X, Y, Z, W; |
372 | } | 372 | } |
373 | 373 | ||
374 | #endregion | 374 | #endregion |
375 | 375 | ||
376 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAllocateODEDataForThread"), SuppressUnmanagedCodeSecurity] | 376 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAllocateODEDataForThread"), SuppressUnmanagedCodeSecurity] |
377 | public static extern int AllocateODEDataForThread(uint ODEInitFlags); | 377 | internal static extern int AllocateODEDataForThread(uint ODEInitFlags); |
378 | 378 | ||
379 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnected"), SuppressUnmanagedCodeSecurity] | 379 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnected"), SuppressUnmanagedCodeSecurity] |
380 | public static extern bool AreConnected(IntPtr b1, IntPtr b2); | 380 | internal static extern bool AreConnected(IntPtr b1, IntPtr b2); |
381 | 381 | ||
382 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnectedExcluding"), SuppressUnmanagedCodeSecurity] | 382 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnectedExcluding"), SuppressUnmanagedCodeSecurity] |
383 | public static extern bool AreConnectedExcluding(IntPtr b1, IntPtr b2, JointType joint_type); | 383 | internal static extern bool AreConnectedExcluding(IntPtr b1, IntPtr b2, JointType joint_type); |
384 | 384 | ||
385 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForce"), SuppressUnmanagedCodeSecurity] | 385 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForce"), SuppressUnmanagedCodeSecurity] |
386 | public static extern void BodyAddForce(IntPtr body, dReal fx, dReal fy, dReal fz); | 386 | internal static extern void BodyAddForce(IntPtr body, dReal fx, dReal fy, dReal fz); |
387 | 387 | ||
388 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtPos"), SuppressUnmanagedCodeSecurity] | 388 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtPos"), SuppressUnmanagedCodeSecurity] |
389 | public static extern void BodyAddForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | 389 | internal static extern void BodyAddForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); |
390 | 390 | ||
391 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtRelPos"), SuppressUnmanagedCodeSecurity] | 391 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtRelPos"), SuppressUnmanagedCodeSecurity] |
392 | public static extern void BodyAddForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | 392 | internal static extern void BodyAddForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); |
393 | 393 | ||
394 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForce"), SuppressUnmanagedCodeSecurity] | 394 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForce"), SuppressUnmanagedCodeSecurity] |
395 | public static extern void BodyAddRelForce(IntPtr body, dReal fx, dReal fy, dReal fz); | 395 | internal static extern void BodyAddRelForce(IntPtr body, dReal fx, dReal fy, dReal fz); |
396 | 396 | ||
397 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtPos"), SuppressUnmanagedCodeSecurity] | 397 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtPos"), SuppressUnmanagedCodeSecurity] |
398 | public static extern void BodyAddRelForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | 398 | internal static extern void BodyAddRelForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); |
399 | 399 | ||
400 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtRelPos"), SuppressUnmanagedCodeSecurity] | 400 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtRelPos"), SuppressUnmanagedCodeSecurity] |
401 | public static extern void BodyAddRelForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | 401 | internal static extern void BodyAddRelForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); |
402 | 402 | ||
403 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelTorque"), SuppressUnmanagedCodeSecurity] | 403 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelTorque"), SuppressUnmanagedCodeSecurity] |
404 | public static extern void BodyAddRelTorque(IntPtr body, dReal fx, dReal fy, dReal fz); | 404 | internal static extern void BodyAddRelTorque(IntPtr body, dReal fx, dReal fy, dReal fz); |
405 | 405 | ||
406 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddTorque"), SuppressUnmanagedCodeSecurity] | 406 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddTorque"), SuppressUnmanagedCodeSecurity] |
407 | public static extern void BodyAddTorque(IntPtr body, dReal fx, dReal fy, dReal fz); | 407 | internal static extern void BodyAddTorque(IntPtr body, dReal fx, dReal fy, dReal fz); |
408 | 408 | ||
409 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] | 409 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] |
410 | public static extern void BodyCopyPosition(IntPtr body, out Vector3 pos); | 410 | internal static extern void BodyCopyPosition(IntPtr body, out Vector3 pos); |
411 | 411 | ||
412 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] | 412 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] |
413 | public static extern void BodyCopyPosition(IntPtr body, out dReal X); | 413 | internal static extern void BodyCopyPosition(IntPtr body, out dReal X); |
414 | 414 | ||
415 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] | 415 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] |
416 | public static extern void BodyCopyQuaternion(IntPtr body, out Quaternion quat); | 416 | internal static extern void BodyCopyQuaternion(IntPtr body, out Quaternion quat); |
417 | 417 | ||
418 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] | 418 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] |
419 | public static extern void BodyCopyQuaternion(IntPtr body, out dReal X); | 419 | internal static extern void BodyCopyQuaternion(IntPtr body, out dReal X); |
420 | 420 | ||
421 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] | 421 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] |
422 | public static extern void BodyCopyRotation(IntPtr body, out Matrix3 R); | 422 | internal static extern void BodyCopyRotation(IntPtr body, out Matrix3 R); |
423 | 423 | ||
424 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] | 424 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] |
425 | public static extern void BodyCopyRotation(IntPtr body, out dReal M00); | 425 | internal static extern void BodyCopyRotation(IntPtr body, out dReal M00); |
426 | 426 | ||
427 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity] | 427 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity] |
428 | public static extern IntPtr BodyiCreate(IntPtr world); | 428 | internal static extern IntPtr BodyiCreate(IntPtr world); |
429 | public static IntPtr BodyCreate(IntPtr world) | 429 | internal static IntPtr BodyCreate(IntPtr world) |
430 | { | 430 | { |
431 | NTotalBodies++; | 431 | NTotalBodies++; |
432 | return BodyiCreate(world); | 432 | return BodyiCreate(world); |
433 | } | 433 | } |
434 | 434 | ||
435 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDestroy"), SuppressUnmanagedCodeSecurity] | 435 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDestroy"), SuppressUnmanagedCodeSecurity] |
436 | public static extern void BodyiDestroy(IntPtr body); | 436 | internal static extern void BodyiDestroy(IntPtr body); |
437 | public static void BodyDestroy(IntPtr body) | 437 | internal static void BodyDestroy(IntPtr body) |
438 | { | 438 | { |
439 | NTotalBodies--; | 439 | NTotalBodies--; |
440 | BodyiDestroy(body); | 440 | BodyiDestroy(body); |
441 | } | 441 | } |
442 | 442 | ||
443 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDisable"), SuppressUnmanagedCodeSecurity] | 443 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDisable"), SuppressUnmanagedCodeSecurity] |
444 | public static extern void BodyDisable(IntPtr body); | 444 | internal static extern void BodyDisable(IntPtr body); |
445 | 445 | ||
446 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyEnable"), SuppressUnmanagedCodeSecurity] | 446 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyEnable"), SuppressUnmanagedCodeSecurity] |
447 | public static extern void BodyEnable(IntPtr body); | 447 | internal static extern void BodyEnable(IntPtr body); |
448 | 448 | ||
449 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | 449 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] |
450 | public static extern dReal BodyGetAutoDisableAngularThreshold(IntPtr body); | 450 | internal static extern dReal BodyGetAutoDisableAngularThreshold(IntPtr body); |
451 | 451 | ||
452 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | 452 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] |
453 | public static extern bool BodyGetAutoDisableFlag(IntPtr body); | 453 | internal static extern bool BodyGetAutoDisableFlag(IntPtr body); |
454 | 454 | ||
455 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] | 455 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] |
456 | public static extern void BodyGetAutoDisableDefaults(IntPtr body); | 456 | internal static extern void BodyGetAutoDisableDefaults(IntPtr body); |
457 | 457 | ||
458 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | 458 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] |
459 | public static extern dReal BodyGetAutoDisableLinearThreshold(IntPtr body); | 459 | internal static extern dReal BodyGetAutoDisableLinearThreshold(IntPtr body); |
460 | 460 | ||
461 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | 461 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] |
462 | public static extern int BodyGetAutoDisableSteps(IntPtr body); | 462 | internal static extern int BodyGetAutoDisableSteps(IntPtr body); |
463 | 463 | ||
464 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | 464 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] |
465 | public static extern dReal BodyGetAutoDisableTime(IntPtr body); | 465 | internal static extern dReal BodyGetAutoDisableTime(IntPtr body); |
466 | 466 | ||
467 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularVel"), SuppressUnmanagedCodeSecurity] | 467 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularVel"), SuppressUnmanagedCodeSecurity] |
468 | public extern unsafe static Vector3* BodyGetAngularVelUnsafe(IntPtr body); | 468 | internal extern unsafe static Vector3* BodyGetAngularVelUnsafe(IntPtr body); |
469 | public static Vector3 BodyGetAngularVel(IntPtr body) | 469 | internal static Vector3 BodyGetAngularVel(IntPtr body) |
470 | { | 470 | { |
471 | unsafe { return *(BodyGetAngularVelUnsafe(body)); } | 471 | unsafe { return *(BodyGetAngularVelUnsafe(body)); } |
472 | } | 472 | } |
473 | 473 | ||
474 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetData"), SuppressUnmanagedCodeSecurity] | 474 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetData"), SuppressUnmanagedCodeSecurity] |
475 | public static extern IntPtr BodyGetData(IntPtr body); | 475 | internal static extern IntPtr BodyGetData(IntPtr body); |
476 | 476 | ||
477 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] | 477 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] |
478 | public static extern int BodyGetFiniteRotationMode(IntPtr body); | 478 | internal static extern int BodyGetFiniteRotationMode(IntPtr body); |
479 | 479 | ||
480 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] | 480 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] |
481 | public static extern void BodyGetFiniteRotationAxis(IntPtr body, out Vector3 result); | 481 | internal static extern void BodyGetFiniteRotationAxis(IntPtr body, out Vector3 result); |
482 | 482 | ||
483 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetForce"), SuppressUnmanagedCodeSecurity] | 483 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetForce"), SuppressUnmanagedCodeSecurity] |
484 | public extern unsafe static Vector3* BodyGetForceUnsafe(IntPtr body); | 484 | internal extern unsafe static Vector3* BodyGetForceUnsafe(IntPtr body); |
485 | public static Vector3 BodyGetForce(IntPtr body) | 485 | internal static Vector3 BodyGetForce(IntPtr body) |
486 | { | 486 | { |
487 | unsafe { return *(BodyGetForceUnsafe(body)); } | 487 | unsafe { return *(BodyGetForceUnsafe(body)); } |
488 | } | 488 | } |
489 | 489 | ||
490 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGravityMode"), SuppressUnmanagedCodeSecurity] | 490 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGravityMode"), SuppressUnmanagedCodeSecurity] |
491 | public static extern bool BodyGetGravityMode(IntPtr body); | 491 | internal static extern bool BodyGetGravityMode(IntPtr body); |
492 | 492 | ||
493 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGyroscopicMode"), SuppressUnmanagedCodeSecurity] | 493 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGyroscopicMode"), SuppressUnmanagedCodeSecurity] |
494 | public static extern int BodyGetGyroscopicMode(IntPtr body); | 494 | internal static extern int BodyGetGyroscopicMode(IntPtr body); |
495 | 495 | ||
496 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetJoint"), SuppressUnmanagedCodeSecurity] | 496 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetJoint"), SuppressUnmanagedCodeSecurity] |
497 | public static extern IntPtr BodyGetJoint(IntPtr body, int index); | 497 | internal static extern IntPtr BodyGetJoint(IntPtr body, int index); |
498 | 498 | ||
499 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearVel"), SuppressUnmanagedCodeSecurity] | 499 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearVel"), SuppressUnmanagedCodeSecurity] |
500 | public extern unsafe static Vector3* BodyGetLinearVelUnsafe(IntPtr body); | 500 | internal extern unsafe static Vector3* BodyGetLinearVelUnsafe(IntPtr body); |
501 | public static Vector3 BodyGetLinearVel(IntPtr body) | 501 | internal static Vector3 BodyGetLinearVel(IntPtr body) |
502 | { | 502 | { |
503 | unsafe { return *(BodyGetLinearVelUnsafe(body)); } | 503 | unsafe { return *(BodyGetLinearVelUnsafe(body)); } |
504 | } | 504 | } |
505 | 505 | ||
506 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetMass"), SuppressUnmanagedCodeSecurity] | 506 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetMass"), SuppressUnmanagedCodeSecurity] |
507 | public static extern void BodyGetMass(IntPtr body, out Mass mass); | 507 | internal static extern void BodyGetMass(IntPtr body, out Mass mass); |
508 | 508 | ||
509 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNumJoints"), SuppressUnmanagedCodeSecurity] | 509 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNumJoints"), SuppressUnmanagedCodeSecurity] |
510 | public static extern int BodyGetNumJoints(IntPtr body); | 510 | internal static extern int BodyGetNumJoints(IntPtr body); |
511 | 511 | ||
512 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPointVel"), SuppressUnmanagedCodeSecurity] | 512 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPointVel"), SuppressUnmanagedCodeSecurity] |
513 | public static extern void BodyGetPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | 513 | internal static extern void BodyGetPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); |
514 | 514 | ||
515 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosition"), SuppressUnmanagedCodeSecurity] | 515 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosition"), SuppressUnmanagedCodeSecurity] |
516 | public extern unsafe static Vector3* BodyGetPositionUnsafe(IntPtr body); | 516 | internal extern unsafe static Vector3* BodyGetPositionUnsafe(IntPtr body); |
517 | public static Vector3 BodyGetPosition(IntPtr body) | 517 | internal static Vector3 BodyGetPosition(IntPtr body) |
518 | { | 518 | { |
519 | unsafe { return *(BodyGetPositionUnsafe(body)); } | 519 | unsafe { return *(BodyGetPositionUnsafe(body)); } |
520 | } | 520 | } |
521 | 521 | ||
522 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosRelPoint"), SuppressUnmanagedCodeSecurity] | 522 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosRelPoint"), SuppressUnmanagedCodeSecurity] |
523 | public static extern void BodyGetPosRelPoint(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | 523 | internal static extern void BodyGetPosRelPoint(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); |
524 | 524 | ||
525 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetQuaternion"), SuppressUnmanagedCodeSecurity] | 525 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetQuaternion"), SuppressUnmanagedCodeSecurity] |
526 | public extern unsafe static Quaternion* BodyGetQuaternionUnsafe(IntPtr body); | 526 | internal extern unsafe static Quaternion* BodyGetQuaternionUnsafe(IntPtr body); |
527 | public static Quaternion BodyGetQuaternion(IntPtr body) | 527 | internal static Quaternion BodyGetQuaternion(IntPtr body) |
528 | { | 528 | { |
529 | unsafe { return *(BodyGetQuaternionUnsafe(body)); } | 529 | unsafe { return *(BodyGetQuaternionUnsafe(body)); } |
530 | } | 530 | } |
531 | 531 | ||
532 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointPos"), SuppressUnmanagedCodeSecurity] | 532 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointPos"), SuppressUnmanagedCodeSecurity] |
533 | public static extern void BodyGetRelPointPos(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | 533 | internal static extern void BodyGetRelPointPos(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); |
534 | 534 | ||
535 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointVel"), SuppressUnmanagedCodeSecurity] | 535 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointVel"), SuppressUnmanagedCodeSecurity] |
536 | public static extern void BodyGetRelPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | 536 | internal static extern void BodyGetRelPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); |
537 | 537 | ||
538 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRotation"), SuppressUnmanagedCodeSecurity] | 538 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRotation"), SuppressUnmanagedCodeSecurity] |
539 | public extern unsafe static Matrix3* BodyGetRotationUnsafe(IntPtr body); | 539 | internal extern unsafe static Matrix3* BodyGetRotationUnsafe(IntPtr body); |
540 | public static Matrix3 BodyGetRotation(IntPtr body) | 540 | internal static Matrix3 BodyGetRotation(IntPtr body) |
541 | { | 541 | { |
542 | unsafe { return *(BodyGetRotationUnsafe(body)); } | 542 | unsafe { return *(BodyGetRotationUnsafe(body)); } |
543 | } | 543 | } |
544 | 544 | ||
545 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetTorque"), SuppressUnmanagedCodeSecurity] | 545 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetTorque"), SuppressUnmanagedCodeSecurity] |
546 | public extern unsafe static Vector3* BodyGetTorqueUnsafe(IntPtr body); | 546 | internal extern unsafe static Vector3* BodyGetTorqueUnsafe(IntPtr body); |
547 | public static Vector3 BodyGetTorque(IntPtr body) | 547 | internal static Vector3 BodyGetTorque(IntPtr body) |
548 | { | 548 | { |
549 | unsafe { return *(BodyGetTorqueUnsafe(body)); } | 549 | unsafe { return *(BodyGetTorqueUnsafe(body)); } |
550 | } | 550 | } |
551 | 551 | ||
552 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetWorld"), SuppressUnmanagedCodeSecurity] | 552 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetWorld"), SuppressUnmanagedCodeSecurity] |
553 | public static extern IntPtr BodyGetWorld(IntPtr body); | 553 | internal static extern IntPtr BodyGetWorld(IntPtr body); |
554 | 554 | ||
555 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFirstGeom"), SuppressUnmanagedCodeSecurity] | 555 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFirstGeom"), SuppressUnmanagedCodeSecurity] |
556 | public static extern IntPtr BodyGetFirstGeom(IntPtr body); | 556 | internal static extern IntPtr BodyGetFirstGeom(IntPtr body); |
557 | 557 | ||
558 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNextGeom"), SuppressUnmanagedCodeSecurity] | 558 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNextGeom"), SuppressUnmanagedCodeSecurity] |
559 | public static extern IntPtr dBodyGetNextGeom(IntPtr Geom); | 559 | internal static extern IntPtr dBodyGetNextGeom(IntPtr Geom); |
560 | 560 | ||
561 | 561 | ||
562 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyIsEnabled"), SuppressUnmanagedCodeSecurity] | 562 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyIsEnabled"), SuppressUnmanagedCodeSecurity] |
563 | public static extern bool BodyIsEnabled(IntPtr body); | 563 | internal static extern bool BodyIsEnabled(IntPtr body); |
564 | 564 | ||
565 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularVel"), SuppressUnmanagedCodeSecurity] | 565 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularVel"), SuppressUnmanagedCodeSecurity] |
566 | public static extern void BodySetAngularVel(IntPtr body, dReal x, dReal y, dReal z); | 566 | internal static extern void BodySetAngularVel(IntPtr body, dReal x, dReal y, dReal z); |
567 | 567 | ||
568 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | 568 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] |
569 | public static extern void BodySetAutoDisableAngularThreshold(IntPtr body, dReal angular_threshold); | 569 | internal static extern void BodySetAutoDisableAngularThreshold(IntPtr body, dReal angular_threshold); |
570 | 570 | ||
571 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] | 571 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] |
572 | public static extern void BodySetAutoDisableDefaults(IntPtr body); | 572 | internal static extern void BodySetAutoDisableDefaults(IntPtr body); |
573 | 573 | ||
574 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | 574 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] |
575 | public static extern void BodySetAutoDisableFlag(IntPtr body, bool do_auto_disable); | 575 | internal static extern void BodySetAutoDisableFlag(IntPtr body, bool do_auto_disable); |
576 | 576 | ||
577 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | 577 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] |
578 | public static extern void BodySetAutoDisableLinearThreshold(IntPtr body, dReal linear_threshold); | 578 | internal static extern void BodySetAutoDisableLinearThreshold(IntPtr body, dReal linear_threshold); |
579 | 579 | ||
580 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | 580 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] |
581 | public static extern void BodySetAutoDisableSteps(IntPtr body, int steps); | 581 | internal static extern void BodySetAutoDisableSteps(IntPtr body, int steps); |
582 | 582 | ||
583 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | 583 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableTime"), SuppressUnmanagedCodeSecurity] |
584 | public static extern void BodySetAutoDisableTime(IntPtr body, dReal time); | 584 | internal static extern void BodySetAutoDisableTime(IntPtr body, dReal time); |
585 | 585 | ||
586 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetData"), SuppressUnmanagedCodeSecurity] | 586 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetData"), SuppressUnmanagedCodeSecurity] |
587 | public static extern void BodySetData(IntPtr body, IntPtr data); | 587 | internal static extern void BodySetData(IntPtr body, IntPtr data); |
588 | 588 | ||
589 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] | 589 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] |
590 | public static extern void BodySetFiniteRotationMode(IntPtr body, int mode); | 590 | internal static extern void BodySetFiniteRotationMode(IntPtr body, int mode); |
591 | 591 | ||
592 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] | 592 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] |
593 | public static extern void BodySetFiniteRotationAxis(IntPtr body, dReal x, dReal y, dReal z); | 593 | internal static extern void BodySetFiniteRotationAxis(IntPtr body, dReal x, dReal y, dReal z); |
594 | 594 | ||
595 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDamping"), SuppressUnmanagedCodeSecurity] | 595 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDamping"), SuppressUnmanagedCodeSecurity] |
596 | public static extern void BodySetLinearDamping(IntPtr body, dReal scale); | 596 | internal static extern void BodySetLinearDamping(IntPtr body, dReal scale); |
597 | 597 | ||
598 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] | 598 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] |
599 | public static extern void BodySetAngularDamping(IntPtr body, dReal scale); | 599 | internal static extern void BodySetAngularDamping(IntPtr body, dReal scale); |
600 | 600 | ||
601 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDamping"), SuppressUnmanagedCodeSecurity] | 601 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDamping"), SuppressUnmanagedCodeSecurity] |
602 | public static extern dReal BodyGetLinearDamping(IntPtr body); | 602 | internal static extern dReal BodyGetLinearDamping(IntPtr body); |
603 | 603 | ||
604 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDamping"), SuppressUnmanagedCodeSecurity] | 604 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDamping"), SuppressUnmanagedCodeSecurity] |
605 | public static extern dReal BodyGetAngularDamping(IntPtr body); | 605 | internal static extern dReal BodyGetAngularDamping(IntPtr body); |
606 | 606 | ||
607 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] | 607 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] |
608 | public static extern void BodySetDamping(IntPtr body, dReal linear_scale, dReal angular_scale); | 608 | internal static extern void BodySetDamping(IntPtr body, dReal linear_scale, dReal angular_scale); |
609 | 609 | ||
610 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] | 610 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] |
611 | public static extern void BodySetAngularDampingThreshold(IntPtr body, dReal threshold); | 611 | internal static extern void BodySetAngularDampingThreshold(IntPtr body, dReal threshold); |
612 | 612 | ||
613 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] | 613 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] |
614 | public static extern void BodySetLinearDampingThreshold(IntPtr body, dReal threshold); | 614 | internal static extern void BodySetLinearDampingThreshold(IntPtr body, dReal threshold); |
615 | 615 | ||
616 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] | 616 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] |
617 | public static extern dReal BodyGetLinearDampingThreshold(IntPtr body); | 617 | internal static extern dReal BodyGetLinearDampingThreshold(IntPtr body); |
618 | 618 | ||
619 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] | 619 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] |
620 | public static extern dReal BodyGetAngularDampingThreshold(IntPtr body); | 620 | internal static extern dReal BodyGetAngularDampingThreshold(IntPtr body); |
621 | 621 | ||
622 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetForce"), SuppressUnmanagedCodeSecurity] | 622 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetForce"), SuppressUnmanagedCodeSecurity] |
623 | public static extern void BodySetForce(IntPtr body, dReal x, dReal y, dReal z); | 623 | internal static extern void BodySetForce(IntPtr body, dReal x, dReal y, dReal z); |
624 | 624 | ||
625 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGravityMode"), SuppressUnmanagedCodeSecurity] | 625 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGravityMode"), SuppressUnmanagedCodeSecurity] |
626 | public static extern void BodySetGravityMode(IntPtr body, bool mode); | 626 | internal static extern void BodySetGravityMode(IntPtr body, bool mode); |
627 | 627 | ||
628 | /// <summary> | 628 | /// <summary> |
629 | /// Sets the Gyroscopic term status on the body specified. | 629 | /// Sets the Gyroscopic term status on the body specified. |
@@ -631,112 +631,112 @@ namespace OdeAPI | |||
631 | /// <param name="body">Pointer to body</param> | 631 | /// <param name="body">Pointer to body</param> |
632 | /// <param name="enabled">NonZero enabled, Zero disabled</param> | 632 | /// <param name="enabled">NonZero enabled, Zero disabled</param> |
633 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGyroscopicMode"), SuppressUnmanagedCodeSecurity] | 633 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGyroscopicMode"), SuppressUnmanagedCodeSecurity] |
634 | public static extern void dBodySetGyroscopicMode(IntPtr body, int enabled); | 634 | internal static extern void dBodySetGyroscopicMode(IntPtr body, int enabled); |
635 | 635 | ||
636 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearVel"), SuppressUnmanagedCodeSecurity] | 636 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearVel"), SuppressUnmanagedCodeSecurity] |
637 | public static extern void BodySetLinearVel(IntPtr body, dReal x, dReal y, dReal z); | 637 | internal static extern void BodySetLinearVel(IntPtr body, dReal x, dReal y, dReal z); |
638 | 638 | ||
639 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetMass"), SuppressUnmanagedCodeSecurity] | 639 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetMass"), SuppressUnmanagedCodeSecurity] |
640 | public static extern void BodySetMass(IntPtr body, ref Mass mass); | 640 | internal static extern void BodySetMass(IntPtr body, ref Mass mass); |
641 | 641 | ||
642 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetPosition"), SuppressUnmanagedCodeSecurity] | 642 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetPosition"), SuppressUnmanagedCodeSecurity] |
643 | public static extern void BodySetPosition(IntPtr body, dReal x, dReal y, dReal z); | 643 | internal static extern void BodySetPosition(IntPtr body, dReal x, dReal y, dReal z); |
644 | 644 | ||
645 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] | 645 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] |
646 | public static extern void BodySetQuaternion(IntPtr body, ref Quaternion q); | 646 | internal static extern void BodySetQuaternion(IntPtr body, ref Quaternion q); |
647 | 647 | ||
648 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] | 648 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] |
649 | public static extern void BodySetQuaternion(IntPtr body, ref dReal w); | 649 | internal static extern void BodySetQuaternion(IntPtr body, ref dReal w); |
650 | 650 | ||
651 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] | 651 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] |
652 | public static extern void BodySetRotation(IntPtr body, ref Matrix3 R); | 652 | internal static extern void BodySetRotation(IntPtr body, ref Matrix3 R); |
653 | 653 | ||
654 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] | 654 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] |
655 | public static extern void BodySetRotation(IntPtr body, ref dReal M00); | 655 | internal static extern void BodySetRotation(IntPtr body, ref dReal M00); |
656 | 656 | ||
657 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetTorque"), SuppressUnmanagedCodeSecurity] | 657 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetTorque"), SuppressUnmanagedCodeSecurity] |
658 | public static extern void BodySetTorque(IntPtr body, dReal x, dReal y, dReal z); | 658 | internal static extern void BodySetTorque(IntPtr body, dReal x, dReal y, dReal z); |
659 | 659 | ||
660 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorFromWorld"), SuppressUnmanagedCodeSecurity] | 660 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorFromWorld"), SuppressUnmanagedCodeSecurity] |
661 | public static extern void BodyVectorFromWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | 661 | internal static extern void BodyVectorFromWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); |
662 | 662 | ||
663 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorToWorld"), SuppressUnmanagedCodeSecurity] | 663 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorToWorld"), SuppressUnmanagedCodeSecurity] |
664 | public static extern void BodyVectorToWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | 664 | internal static extern void BodyVectorToWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); |
665 | 665 | ||
666 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxBox"), SuppressUnmanagedCodeSecurity] | 666 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxBox"), SuppressUnmanagedCodeSecurity] |
667 | public static extern void BoxBox(ref Vector3 p1, ref Matrix3 R1, | 667 | internal static extern void BoxBox(ref Vector3 p1, ref Matrix3 R1, |
668 | ref Vector3 side1, ref Vector3 p2, | 668 | ref Vector3 side1, ref Vector3 p2, |
669 | ref Matrix3 R2, ref Vector3 side2, | 669 | ref Matrix3 R2, ref Vector3 side2, |
670 | ref Vector3 normal, out dReal depth, out int return_code, | 670 | ref Vector3 normal, out dReal depth, out int return_code, |
671 | int maxc, out ContactGeom contact, int skip); | 671 | int maxc, out ContactGeom contact, int skip); |
672 | 672 | ||
673 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxTouchesBox"), SuppressUnmanagedCodeSecurity] | 673 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxTouchesBox"), SuppressUnmanagedCodeSecurity] |
674 | public static extern void BoxTouchesBox(ref Vector3 _p1, ref Matrix3 R1, | 674 | internal static extern void BoxTouchesBox(ref Vector3 _p1, ref Matrix3 R1, |
675 | ref Vector3 side1, ref Vector3 _p2, | 675 | ref Vector3 side1, ref Vector3 _p2, |
676 | ref Matrix3 R2, ref Vector3 side2); | 676 | ref Matrix3 R2, ref Vector3 side2); |
677 | 677 | ||
678 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCleanupODEAllDataForThread"), SuppressUnmanagedCodeSecurity] | 678 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCleanupODEAllDataForThread"), SuppressUnmanagedCodeSecurity] |
679 | public static extern void CleanupODEAllDataForThread(); | 679 | internal static extern void CleanupODEAllDataForThread(); |
680 | 680 | ||
681 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dClosestLineSegmentPoints"), SuppressUnmanagedCodeSecurity] | 681 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dClosestLineSegmentPoints"), SuppressUnmanagedCodeSecurity] |
682 | public static extern void ClosestLineSegmentPoints(ref Vector3 a1, ref Vector3 a2, | 682 | internal static extern void ClosestLineSegmentPoints(ref Vector3 a1, ref Vector3 a2, |
683 | ref Vector3 b1, ref Vector3 b2, | 683 | ref Vector3 b1, ref Vector3 b2, |
684 | ref Vector3 cp1, ref Vector3 cp2); | 684 | ref Vector3 cp1, ref Vector3 cp2); |
685 | 685 | ||
686 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCloseODE"), SuppressUnmanagedCodeSecurity] | 686 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCloseODE"), SuppressUnmanagedCodeSecurity] |
687 | public static extern void CloseODE(); | 687 | internal static extern void CloseODE(); |
688 | 688 | ||
689 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] | 689 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] |
690 | public static extern int Collide(IntPtr o1, IntPtr o2, int flags, [In, Out] ContactGeom[] contact, int skip); | 690 | internal static extern int Collide(IntPtr o1, IntPtr o2, int flags, [In, Out] ContactGeom[] contact, int skip); |
691 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] | 691 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] |
692 | public static extern int CollidePtr(IntPtr o1, IntPtr o2, int flags, IntPtr contactgeomarray, int skip); | 692 | internal static extern int CollidePtr(IntPtr o1, IntPtr o2, int flags, IntPtr contactgeomarray, int skip); |
693 | 693 | ||
694 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dConnectingJoint"), SuppressUnmanagedCodeSecurity] | 694 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dConnectingJoint"), SuppressUnmanagedCodeSecurity] |
695 | public static extern IntPtr ConnectingJoint(IntPtr j1, IntPtr j2); | 695 | internal static extern IntPtr ConnectingJoint(IntPtr j1, IntPtr j2); |
696 | 696 | ||
697 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity] | 697 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity] |
698 | public static extern IntPtr CreateiBox(IntPtr space, dReal lx, dReal ly, dReal lz); | 698 | internal static extern IntPtr CreateiBox(IntPtr space, dReal lx, dReal ly, dReal lz); |
699 | public static IntPtr CreateBox(IntPtr space, dReal lx, dReal ly, dReal lz) | 699 | internal static IntPtr CreateBox(IntPtr space, dReal lx, dReal ly, dReal lz) |
700 | { | 700 | { |
701 | NTotalGeoms++; | 701 | NTotalGeoms++; |
702 | return CreateiBox(space, lx, ly, lz); | 702 | return CreateiBox(space, lx, ly, lz); |
703 | } | 703 | } |
704 | 704 | ||
705 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity] | 705 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity] |
706 | public static extern IntPtr CreateiCapsule(IntPtr space, dReal radius, dReal length); | 706 | internal static extern IntPtr CreateiCapsule(IntPtr space, dReal radius, dReal length); |
707 | public static IntPtr CreateCapsule(IntPtr space, dReal radius, dReal length) | 707 | internal static IntPtr CreateCapsule(IntPtr space, dReal radius, dReal length) |
708 | { | 708 | { |
709 | NTotalGeoms++; | 709 | NTotalGeoms++; |
710 | return CreateiCapsule(space, radius, length); | 710 | return CreateiCapsule(space, radius, length); |
711 | } | 711 | } |
712 | 712 | ||
713 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity] | 713 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity] |
714 | public static extern IntPtr CreateiConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); | 714 | internal static extern IntPtr CreateiConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); |
715 | public static IntPtr CreateConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons) | 715 | internal static IntPtr CreateConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons) |
716 | { | 716 | { |
717 | NTotalGeoms++; | 717 | NTotalGeoms++; |
718 | return CreateiConvex(space, planes, planeCount, points, pointCount, polygons); | 718 | return CreateiConvex(space, planes, planeCount, points, pointCount, polygons); |
719 | } | 719 | } |
720 | 720 | ||
721 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity] | 721 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity] |
722 | public static extern IntPtr CreateiCylinder(IntPtr space, dReal radius, dReal length); | 722 | internal static extern IntPtr CreateiCylinder(IntPtr space, dReal radius, dReal length); |
723 | public static IntPtr CreateCylinder(IntPtr space, dReal radius, dReal length) | 723 | internal static IntPtr CreateCylinder(IntPtr space, dReal radius, dReal length) |
724 | { | 724 | { |
725 | NTotalGeoms++; | 725 | NTotalGeoms++; |
726 | return CreateiCylinder(space, radius, length); | 726 | return CreateiCylinder(space, radius, length); |
727 | } | 727 | } |
728 | 728 | ||
729 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity] | 729 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity] |
730 | public static extern IntPtr CreateiHeightfield(IntPtr space, IntPtr data, int bPlaceable); | 730 | internal static extern IntPtr CreateiHeightfield(IntPtr space, IntPtr data, int bPlaceable); |
731 | public static IntPtr CreateHeightfield(IntPtr space, IntPtr data, int bPlaceable) | 731 | internal static IntPtr CreateHeightfield(IntPtr space, IntPtr data, int bPlaceable) |
732 | { | 732 | { |
733 | NTotalGeoms++; | 733 | NTotalGeoms++; |
734 | return CreateiHeightfield(space, data, bPlaceable); | 734 | return CreateiHeightfield(space, data, bPlaceable); |
735 | } | 735 | } |
736 | 736 | ||
737 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateOSTerrain"), SuppressUnmanagedCodeSecurity] | 737 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateOSTerrain"), SuppressUnmanagedCodeSecurity] |
738 | public static extern IntPtr CreateiOSTerrain(IntPtr space, IntPtr data, int bPlaceable); | 738 | internal static extern IntPtr CreateiOSTerrain(IntPtr space, IntPtr data, int bPlaceable); |
739 | public static IntPtr CreateOSTerrain(IntPtr space, IntPtr data, int bPlaceable) | 739 | internal static IntPtr CreateOSTerrain(IntPtr space, IntPtr data, int bPlaceable) |
740 | { | 740 | { |
741 | NTotalGeoms++; | 741 | NTotalGeoms++; |
742 | return CreateiOSTerrain(space, data, bPlaceable); | 742 | return CreateiOSTerrain(space, data, bPlaceable); |
@@ -747,127 +747,127 @@ namespace OdeAPI | |||
747 | 747 | ||
748 | 748 | ||
749 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity] | 749 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity] |
750 | public static extern IntPtr CreateiGeom(int classnum); | 750 | internal static extern IntPtr CreateiGeom(int classnum); |
751 | public static IntPtr CreateGeom(int classnum) | 751 | internal static IntPtr CreateGeom(int classnum) |
752 | { | 752 | { |
753 | NTotalGeoms++; | 753 | NTotalGeoms++; |
754 | return CreateiGeom(classnum); | 754 | return CreateiGeom(classnum); |
755 | } | 755 | } |
756 | 756 | ||
757 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity] | 757 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity] |
758 | public static extern int CreateGeomClass(ref GeomClass classptr); | 758 | internal static extern int CreateGeomClass(ref GeomClass classptr); |
759 | 759 | ||
760 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomTransform"), SuppressUnmanagedCodeSecurity] | 760 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomTransform"), SuppressUnmanagedCodeSecurity] |
761 | public static extern IntPtr CreateGeomTransform(IntPtr space); | 761 | internal static extern IntPtr CreateGeomTransform(IntPtr space); |
762 | 762 | ||
763 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity] | 763 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity] |
764 | public static extern IntPtr CreateiPlane(IntPtr space, dReal a, dReal b, dReal c, dReal d); | 764 | internal static extern IntPtr CreateiPlane(IntPtr space, dReal a, dReal b, dReal c, dReal d); |
765 | public static IntPtr CreatePlane(IntPtr space, dReal a, dReal b, dReal c, dReal d) | 765 | internal static IntPtr CreatePlane(IntPtr space, dReal a, dReal b, dReal c, dReal d) |
766 | { | 766 | { |
767 | NTotalGeoms++; | 767 | NTotalGeoms++; |
768 | return CreateiPlane(space, a, b, c, d); | 768 | return CreateiPlane(space, a, b, c, d); |
769 | } | 769 | } |
770 | 770 | ||
771 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity] | 771 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity] |
772 | public static extern IntPtr CreateiRay(IntPtr space, dReal length); | 772 | internal static extern IntPtr CreateiRay(IntPtr space, dReal length); |
773 | public static IntPtr CreateRay(IntPtr space, dReal length) | 773 | internal static IntPtr CreateRay(IntPtr space, dReal length) |
774 | { | 774 | { |
775 | NTotalGeoms++; | 775 | NTotalGeoms++; |
776 | return CreateiRay(space, length); | 776 | return CreateiRay(space, length); |
777 | } | 777 | } |
778 | 778 | ||
779 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity] | 779 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity] |
780 | public static extern IntPtr CreateiSphere(IntPtr space, dReal radius); | 780 | internal static extern IntPtr CreateiSphere(IntPtr space, dReal radius); |
781 | public static IntPtr CreateSphere(IntPtr space, dReal radius) | 781 | internal static IntPtr CreateSphere(IntPtr space, dReal radius) |
782 | { | 782 | { |
783 | NTotalGeoms++; | 783 | NTotalGeoms++; |
784 | return CreateiSphere(space, radius); | 784 | return CreateiSphere(space, radius); |
785 | } | 785 | } |
786 | 786 | ||
787 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity] | 787 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity] |
788 | public static extern IntPtr CreateiTriMesh(IntPtr space, IntPtr data, | 788 | internal static extern IntPtr CreateiTriMesh(IntPtr space, IntPtr data, |
789 | TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback); | 789 | TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback); |
790 | public static IntPtr CreateTriMesh(IntPtr space, IntPtr data, | 790 | internal static IntPtr CreateTriMesh(IntPtr space, IntPtr data, |
791 | TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback) | 791 | TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback) |
792 | { | 792 | { |
793 | NTotalGeoms++; | 793 | NTotalGeoms++; |
794 | return CreateiTriMesh(space, data, callback, arrayCallback, rayCallback); | 794 | return CreateiTriMesh(space, data, callback, arrayCallback, rayCallback); |
795 | } | 795 | } |
796 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDot"), SuppressUnmanagedCodeSecurity] | 796 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDot"), SuppressUnmanagedCodeSecurity] |
797 | public static extern dReal Dot(ref dReal X0, ref dReal X1, int n); | 797 | internal static extern dReal Dot(ref dReal X0, ref dReal X1, int n); |
798 | 798 | ||
799 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity] | 799 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity] |
800 | public static extern void DQfromW(dReal[] dq, ref Vector3 w, ref Quaternion q); | 800 | internal static extern void DQfromW(dReal[] dq, ref Vector3 w, ref Quaternion q); |
801 | 801 | ||
802 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorCholesky"), SuppressUnmanagedCodeSecurity] | 802 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorCholesky"), SuppressUnmanagedCodeSecurity] |
803 | public static extern int FactorCholesky(ref dReal A00, int n); | 803 | internal static extern int FactorCholesky(ref dReal A00, int n); |
804 | 804 | ||
805 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorLDLT"), SuppressUnmanagedCodeSecurity] | 805 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorLDLT"), SuppressUnmanagedCodeSecurity] |
806 | public static extern void FactorLDLT(ref dReal A, out dReal d, int n, int nskip); | 806 | internal static extern void FactorLDLT(ref dReal A, out dReal d, int n, int nskip); |
807 | 807 | ||
808 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] | 808 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] |
809 | public static extern void GeomBoxGetLengths(IntPtr geom, out Vector3 len); | 809 | internal static extern void GeomBoxGetLengths(IntPtr geom, out Vector3 len); |
810 | 810 | ||
811 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] | 811 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] |
812 | public static extern void GeomBoxGetLengths(IntPtr geom, out dReal x); | 812 | internal static extern void GeomBoxGetLengths(IntPtr geom, out dReal x); |
813 | 813 | ||
814 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxPointDepth"), SuppressUnmanagedCodeSecurity] | 814 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxPointDepth"), SuppressUnmanagedCodeSecurity] |
815 | public static extern dReal GeomBoxPointDepth(IntPtr geom, dReal x, dReal y, dReal z); | 815 | internal static extern dReal GeomBoxPointDepth(IntPtr geom, dReal x, dReal y, dReal z); |
816 | 816 | ||
817 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxSetLengths"), SuppressUnmanagedCodeSecurity] | 817 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxSetLengths"), SuppressUnmanagedCodeSecurity] |
818 | public static extern void GeomBoxSetLengths(IntPtr geom, dReal x, dReal y, dReal z); | 818 | internal static extern void GeomBoxSetLengths(IntPtr geom, dReal x, dReal y, dReal z); |
819 | 819 | ||
820 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleGetParams"), SuppressUnmanagedCodeSecurity] | 820 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleGetParams"), SuppressUnmanagedCodeSecurity] |
821 | public static extern void GeomCapsuleGetParams(IntPtr geom, out dReal radius, out dReal length); | 821 | internal static extern void GeomCapsuleGetParams(IntPtr geom, out dReal radius, out dReal length); |
822 | 822 | ||
823 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsulePointDepth"), SuppressUnmanagedCodeSecurity] | 823 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsulePointDepth"), SuppressUnmanagedCodeSecurity] |
824 | public static extern dReal GeomCapsulePointDepth(IntPtr geom, dReal x, dReal y, dReal z); | 824 | internal static extern dReal GeomCapsulePointDepth(IntPtr geom, dReal x, dReal y, dReal z); |
825 | 825 | ||
826 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleSetParams"), SuppressUnmanagedCodeSecurity] | 826 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleSetParams"), SuppressUnmanagedCodeSecurity] |
827 | public static extern void GeomCapsuleSetParams(IntPtr geom, dReal radius, dReal length); | 827 | internal static extern void GeomCapsuleSetParams(IntPtr geom, dReal radius, dReal length); |
828 | 828 | ||
829 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomClearOffset"), SuppressUnmanagedCodeSecurity] | 829 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomClearOffset"), SuppressUnmanagedCodeSecurity] |
830 | public static extern void GeomClearOffset(IntPtr geom); | 830 | internal static extern void GeomClearOffset(IntPtr geom); |
831 | 831 | ||
832 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] | 832 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] |
833 | public static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref Vector3 pos); | 833 | internal static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref Vector3 pos); |
834 | 834 | ||
835 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] | 835 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] |
836 | public static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref dReal X); | 836 | internal static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref dReal X); |
837 | 837 | ||
838 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | 838 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] |
839 | public static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref Quaternion Q); | 839 | internal static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref Quaternion Q); |
840 | 840 | ||
841 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | 841 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] |
842 | public static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref dReal X); | 842 | internal static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref dReal X); |
843 | 843 | ||
844 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] | 844 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] |
845 | public static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref Matrix3 R); | 845 | internal static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref Matrix3 R); |
846 | 846 | ||
847 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] | 847 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] |
848 | public static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref dReal M00); | 848 | internal static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref dReal M00); |
849 | 849 | ||
850 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] | 850 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] |
851 | public static extern void GeomCopyPosition(IntPtr geom, out Vector3 pos); | 851 | internal static extern void GeomCopyPosition(IntPtr geom, out Vector3 pos); |
852 | 852 | ||
853 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] | 853 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] |
854 | public static extern void GeomCopyPosition(IntPtr geom, out dReal X); | 854 | internal static extern void GeomCopyPosition(IntPtr geom, out dReal X); |
855 | 855 | ||
856 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] | 856 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] |
857 | public static extern void GeomCopyRotation(IntPtr geom, out Matrix3 R); | 857 | internal static extern void GeomCopyRotation(IntPtr geom, out Matrix3 R); |
858 | 858 | ||
859 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] | 859 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] |
860 | public static extern void GeomCopyRotation(IntPtr geom, out dReal M00); | 860 | internal static extern void GeomCopyRotation(IntPtr geom, out dReal M00); |
861 | 861 | ||
862 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderGetParams"), SuppressUnmanagedCodeSecurity] | 862 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderGetParams"), SuppressUnmanagedCodeSecurity] |
863 | public static extern void GeomCylinderGetParams(IntPtr geom, out dReal radius, out dReal length); | 863 | internal static extern void GeomCylinderGetParams(IntPtr geom, out dReal radius, out dReal length); |
864 | 864 | ||
865 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderSetParams"), SuppressUnmanagedCodeSecurity] | 865 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderSetParams"), SuppressUnmanagedCodeSecurity] |
866 | public static extern void GeomCylinderSetParams(IntPtr geom, dReal radius, dReal length); | 866 | internal static extern void GeomCylinderSetParams(IntPtr geom, dReal radius, dReal length); |
867 | 867 | ||
868 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity] | 868 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity] |
869 | public static extern void GeomiDestroy(IntPtr geom); | 869 | internal static extern void GeomiDestroy(IntPtr geom); |
870 | public static void GeomDestroy(IntPtr geom) | 870 | internal static void GeomDestroy(IntPtr geom) |
871 | { | 871 | { |
872 | NTotalGeoms--; | 872 | NTotalGeoms--; |
873 | GeomiDestroy(geom); | 873 | GeomiDestroy(geom); |
@@ -875,64 +875,64 @@ namespace OdeAPI | |||
875 | 875 | ||
876 | 876 | ||
877 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity] | 877 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity] |
878 | public static extern void GeomDisable(IntPtr geom); | 878 | internal static extern void GeomDisable(IntPtr geom); |
879 | 879 | ||
880 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomEnable"), SuppressUnmanagedCodeSecurity] | 880 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomEnable"), SuppressUnmanagedCodeSecurity] |
881 | public static extern void GeomEnable(IntPtr geom); | 881 | internal static extern void GeomEnable(IntPtr geom); |
882 | 882 | ||
883 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] | 883 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] |
884 | public static extern void GeomGetAABB(IntPtr geom, out AABB aabb); | 884 | internal static extern void GeomGetAABB(IntPtr geom, out AABB aabb); |
885 | 885 | ||
886 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] | 886 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] |
887 | public static extern void GeomGetAABB(IntPtr geom, out dReal minX); | 887 | internal static extern void GeomGetAABB(IntPtr geom, out dReal minX); |
888 | 888 | ||
889 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetBody"), SuppressUnmanagedCodeSecurity] | 889 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetBody"), SuppressUnmanagedCodeSecurity] |
890 | public static extern IntPtr GeomGetBody(IntPtr geom); | 890 | internal static extern IntPtr GeomGetBody(IntPtr geom); |
891 | 891 | ||
892 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCategoryBits"), SuppressUnmanagedCodeSecurity] | 892 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCategoryBits"), SuppressUnmanagedCodeSecurity] |
893 | public static extern uint GeomGetCategoryBits(IntPtr geom); | 893 | internal static extern uint GeomGetCategoryBits(IntPtr geom); |
894 | 894 | ||
895 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClassData"), SuppressUnmanagedCodeSecurity] | 895 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClassData"), SuppressUnmanagedCodeSecurity] |
896 | public static extern IntPtr GeomGetClassData(IntPtr geom); | 896 | internal static extern IntPtr GeomGetClassData(IntPtr geom); |
897 | 897 | ||
898 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCollideBits"), SuppressUnmanagedCodeSecurity] | 898 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCollideBits"), SuppressUnmanagedCodeSecurity] |
899 | public static extern uint GeomGetCollideBits(IntPtr geom); | 899 | internal static extern uint GeomGetCollideBits(IntPtr geom); |
900 | 900 | ||
901 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClass"), SuppressUnmanagedCodeSecurity] | 901 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClass"), SuppressUnmanagedCodeSecurity] |
902 | public static extern GeomClassID GeomGetClass(IntPtr geom); | 902 | internal static extern GeomClassID GeomGetClass(IntPtr geom); |
903 | 903 | ||
904 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetData"), SuppressUnmanagedCodeSecurity] | 904 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetData"), SuppressUnmanagedCodeSecurity] |
905 | public static extern IntPtr GeomGetData(IntPtr geom); | 905 | internal static extern IntPtr GeomGetData(IntPtr geom); |
906 | 906 | ||
907 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetPosition"), SuppressUnmanagedCodeSecurity] | 907 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetPosition"), SuppressUnmanagedCodeSecurity] |
908 | public extern unsafe static Vector3* GeomGetOffsetPositionUnsafe(IntPtr geom); | 908 | internal extern unsafe static Vector3* GeomGetOffsetPositionUnsafe(IntPtr geom); |
909 | public static Vector3 GeomGetOffsetPosition(IntPtr geom) | 909 | internal static Vector3 GeomGetOffsetPosition(IntPtr geom) |
910 | { | 910 | { |
911 | unsafe { return *(GeomGetOffsetPositionUnsafe(geom)); } | 911 | unsafe { return *(GeomGetOffsetPositionUnsafe(geom)); } |
912 | } | 912 | } |
913 | 913 | ||
914 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetRotation"), SuppressUnmanagedCodeSecurity] | 914 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetRotation"), SuppressUnmanagedCodeSecurity] |
915 | public extern unsafe static Matrix3* GeomGetOffsetRotationUnsafe(IntPtr geom); | 915 | internal extern unsafe static Matrix3* GeomGetOffsetRotationUnsafe(IntPtr geom); |
916 | public static Matrix3 GeomGetOffsetRotation(IntPtr geom) | 916 | internal static Matrix3 GeomGetOffsetRotation(IntPtr geom) |
917 | { | 917 | { |
918 | unsafe { return *(GeomGetOffsetRotationUnsafe(geom)); } | 918 | unsafe { return *(GeomGetOffsetRotationUnsafe(geom)); } |
919 | } | 919 | } |
920 | 920 | ||
921 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetPosition"), SuppressUnmanagedCodeSecurity] | 921 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetPosition"), SuppressUnmanagedCodeSecurity] |
922 | public extern unsafe static Vector3* GeomGetPositionUnsafe(IntPtr geom); | 922 | internal extern unsafe static Vector3* GeomGetPositionUnsafe(IntPtr geom); |
923 | public static Vector3 GeomGetPosition(IntPtr geom) | 923 | internal static Vector3 GeomGetPosition(IntPtr geom) |
924 | { | 924 | { |
925 | unsafe { return *(GeomGetPositionUnsafe(geom)); } | 925 | unsafe { return *(GeomGetPositionUnsafe(geom)); } |
926 | } | 926 | } |
927 | public static OMV.Vector3 GeomGetPositionOMV(IntPtr geom) | 927 | internal static OMV.Vector3 GeomGetPositionOMV(IntPtr geom) |
928 | { | 928 | { |
929 | Vector3 vtmp = GeomGetPosition(geom); | 929 | Vector3 vtmp = GeomGetPosition(geom); |
930 | return new OMV.Vector3(vtmp.X, vtmp.Y, vtmp.Z); | 930 | return new OMV.Vector3(vtmp.X, vtmp.Y, vtmp.Z); |
931 | } | 931 | } |
932 | 932 | ||
933 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] | 933 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] |
934 | public static extern void GeomCopyQuaternion(IntPtr geom, out Quaternion q); | 934 | internal static extern void GeomCopyQuaternion(IntPtr geom, out Quaternion q); |
935 | public static OMV.Quaternion GeomGetQuaternionOMV(IntPtr geom) | 935 | internal static OMV.Quaternion GeomGetQuaternionOMV(IntPtr geom) |
936 | { | 936 | { |
937 | Quaternion qtmp; | 937 | Quaternion qtmp; |
938 | GeomCopyQuaternion(geom, out qtmp); | 938 | GeomCopyQuaternion(geom, out qtmp); |
@@ -940,393 +940,393 @@ namespace OdeAPI | |||
940 | } | 940 | } |
941 | 941 | ||
942 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] | 942 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] |
943 | public static extern void GeomCopyQuaternion(IntPtr geom, out dReal X); | 943 | internal static extern void GeomCopyQuaternion(IntPtr geom, out dReal X); |
944 | 944 | ||
945 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetRotation"), SuppressUnmanagedCodeSecurity] | 945 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetRotation"), SuppressUnmanagedCodeSecurity] |
946 | public extern unsafe static Matrix3* GeomGetRotationUnsafe(IntPtr geom); | 946 | internal extern unsafe static Matrix3* GeomGetRotationUnsafe(IntPtr geom); |
947 | public static Matrix3 GeomGetRotation(IntPtr geom) | 947 | internal static Matrix3 GeomGetRotation(IntPtr geom) |
948 | { | 948 | { |
949 | unsafe { return *(GeomGetRotationUnsafe(geom)); } | 949 | unsafe { return *(GeomGetRotationUnsafe(geom)); } |
950 | } | 950 | } |
951 | 951 | ||
952 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetSpace"), SuppressUnmanagedCodeSecurity] | 952 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetSpace"), SuppressUnmanagedCodeSecurity] |
953 | public static extern IntPtr GeomGetSpace(IntPtr geom); | 953 | internal static extern IntPtr GeomGetSpace(IntPtr geom); |
954 | 954 | ||
955 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] | 955 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] |
956 | public static extern void GeomHeightfieldDataBuildByte(IntPtr d, byte[] pHeightData, int bCopyHeightData, | 956 | internal static extern void GeomHeightfieldDataBuildByte(IntPtr d, byte[] pHeightData, int bCopyHeightData, |
957 | dReal width, dReal depth, int widthSamples, int depthSamples, | 957 | dReal width, dReal depth, int widthSamples, int depthSamples, |
958 | dReal scale, dReal offset, dReal thickness, int bWrap); | 958 | dReal scale, dReal offset, dReal thickness, int bWrap); |
959 | 959 | ||
960 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] | 960 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] |
961 | public static extern void GeomHeightfieldDataBuildByte(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | 961 | internal static extern void GeomHeightfieldDataBuildByte(IntPtr d, IntPtr pHeightData, int bCopyHeightData, |
962 | dReal width, dReal depth, int widthSamples, int depthSamples, | 962 | dReal width, dReal depth, int widthSamples, int depthSamples, |
963 | dReal scale, dReal offset, dReal thickness, int bWrap); | 963 | dReal scale, dReal offset, dReal thickness, int bWrap); |
964 | 964 | ||
965 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildCallback"), SuppressUnmanagedCodeSecurity] | 965 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildCallback"), SuppressUnmanagedCodeSecurity] |
966 | public static extern void GeomHeightfieldDataBuildCallback(IntPtr d, IntPtr pUserData, HeightfieldGetHeight pCallback, | 966 | internal static extern void GeomHeightfieldDataBuildCallback(IntPtr d, IntPtr pUserData, HeightfieldGetHeight pCallback, |
967 | dReal width, dReal depth, int widthSamples, int depthSamples, | 967 | dReal width, dReal depth, int widthSamples, int depthSamples, |
968 | dReal scale, dReal offset, dReal thickness, int bWrap); | 968 | dReal scale, dReal offset, dReal thickness, int bWrap); |
969 | 969 | ||
970 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] | 970 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] |
971 | public static extern void GeomHeightfieldDataBuildShort(IntPtr d, ushort[] pHeightData, int bCopyHeightData, | 971 | internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, ushort[] pHeightData, int bCopyHeightData, |
972 | dReal width, dReal depth, int widthSamples, int depthSamples, | 972 | dReal width, dReal depth, int widthSamples, int depthSamples, |
973 | dReal scale, dReal offset, dReal thickness, int bWrap); | 973 | dReal scale, dReal offset, dReal thickness, int bWrap); |
974 | 974 | ||
975 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] | 975 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] |
976 | public static extern void GeomHeightfieldDataBuildShort(IntPtr d, short[] pHeightData, int bCopyHeightData, | 976 | internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, short[] pHeightData, int bCopyHeightData, |
977 | dReal width, dReal depth, int widthSamples, int depthSamples, | 977 | dReal width, dReal depth, int widthSamples, int depthSamples, |
978 | dReal scale, dReal offset, dReal thickness, int bWrap); | 978 | dReal scale, dReal offset, dReal thickness, int bWrap); |
979 | 979 | ||
980 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] | 980 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] |
981 | public static extern void GeomHeightfieldDataBuildShort(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | 981 | internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, IntPtr pHeightData, int bCopyHeightData, |
982 | dReal width, dReal depth, int widthSamples, int depthSamples, | 982 | dReal width, dReal depth, int widthSamples, int depthSamples, |
983 | dReal scale, dReal offset, dReal thickness, int bWrap); | 983 | dReal scale, dReal offset, dReal thickness, int bWrap); |
984 | 984 | ||
985 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] | 985 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] |
986 | public static extern void GeomHeightfieldDataBuildSingle(IntPtr d, float[] pHeightData, int bCopyHeightData, | 986 | internal static extern void GeomHeightfieldDataBuildSingle(IntPtr d, float[] pHeightData, int bCopyHeightData, |
987 | dReal width, dReal depth, int widthSamples, int depthSamples, | 987 | dReal width, dReal depth, int widthSamples, int depthSamples, |
988 | dReal scale, dReal offset, dReal thickness, int bWrap); | 988 | dReal scale, dReal offset, dReal thickness, int bWrap); |
989 | 989 | ||
990 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] | 990 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] |
991 | public static extern void GeomHeightfieldDataBuildSingle(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | 991 | internal static extern void GeomHeightfieldDataBuildSingle(IntPtr d, IntPtr pHeightData, int bCopyHeightData, |
992 | dReal width, dReal depth, int widthSamples, int depthSamples, | 992 | dReal width, dReal depth, int widthSamples, int depthSamples, |
993 | dReal scale, dReal offset, dReal thickness, int bWrap); | 993 | dReal scale, dReal offset, dReal thickness, int bWrap); |
994 | 994 | ||
995 | 995 | ||
996 | 996 | ||
997 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] | 997 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] |
998 | public static extern void GeomHeightfieldDataBuildDouble(IntPtr d, double[] pHeightData, int bCopyHeightData, | 998 | internal static extern void GeomHeightfieldDataBuildDouble(IntPtr d, double[] pHeightData, int bCopyHeightData, |
999 | dReal width, dReal depth, int widthSamples, int depthSamples, | 999 | dReal width, dReal depth, int widthSamples, int depthSamples, |
1000 | dReal scale, dReal offset, dReal thickness, int bWrap); | 1000 | dReal scale, dReal offset, dReal thickness, int bWrap); |
1001 | 1001 | ||
1002 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] | 1002 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] |
1003 | public static extern void GeomHeightfieldDataBuildDouble(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | 1003 | internal static extern void GeomHeightfieldDataBuildDouble(IntPtr d, IntPtr pHeightData, int bCopyHeightData, |
1004 | dReal width, dReal depth, int widthSamples, int depthSamples, | 1004 | dReal width, dReal depth, int widthSamples, int depthSamples, |
1005 | dReal scale, dReal offset, dReal thickness, int bWrap); | 1005 | dReal scale, dReal offset, dReal thickness, int bWrap); |
1006 | 1006 | ||
1007 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataCreate"), SuppressUnmanagedCodeSecurity] | 1007 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataCreate"), SuppressUnmanagedCodeSecurity] |
1008 | public static extern IntPtr GeomHeightfieldDataCreate(); | 1008 | internal static extern IntPtr GeomHeightfieldDataCreate(); |
1009 | 1009 | ||
1010 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataDestroy"), SuppressUnmanagedCodeSecurity] | 1010 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataDestroy"), SuppressUnmanagedCodeSecurity] |
1011 | public static extern void GeomHeightfieldDataDestroy(IntPtr d); | 1011 | internal static extern void GeomHeightfieldDataDestroy(IntPtr d); |
1012 | 1012 | ||
1013 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataSetBounds"), SuppressUnmanagedCodeSecurity] | 1013 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataSetBounds"), SuppressUnmanagedCodeSecurity] |
1014 | public static extern void GeomHeightfieldDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); | 1014 | internal static extern void GeomHeightfieldDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); |
1015 | 1015 | ||
1016 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldGetHeightfieldData"), SuppressUnmanagedCodeSecurity] | 1016 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldGetHeightfieldData"), SuppressUnmanagedCodeSecurity] |
1017 | public static extern IntPtr GeomHeightfieldGetHeightfieldData(IntPtr g); | 1017 | internal static extern IntPtr GeomHeightfieldGetHeightfieldData(IntPtr g); |
1018 | 1018 | ||
1019 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldSetHeightfieldData"), SuppressUnmanagedCodeSecurity] | 1019 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldSetHeightfieldData"), SuppressUnmanagedCodeSecurity] |
1020 | public static extern void GeomHeightfieldSetHeightfieldData(IntPtr g, IntPtr d); | 1020 | internal static extern void GeomHeightfieldSetHeightfieldData(IntPtr g, IntPtr d); |
1021 | 1021 | ||
1022 | 1022 | ||
1023 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity] | 1023 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity] |
1024 | public static extern void GeomOSTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData, | 1024 | internal static extern void GeomOSTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData, |
1025 | dReal sampleSize, int widthSamples, int depthSamples, | 1025 | dReal sampleSize, int widthSamples, int depthSamples, |
1026 | dReal offset, dReal thickness, int bWrap); | 1026 | dReal offset, dReal thickness, int bWrap); |
1027 | 1027 | ||
1028 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataBuild"), SuppressUnmanagedCodeSecurity] | 1028 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataBuild"), SuppressUnmanagedCodeSecurity] |
1029 | public static extern void GeomOSTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | 1029 | internal static extern void GeomOSTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData, |
1030 | dReal sampleSize, int widthSamples, int depthSamples, | 1030 | dReal sampleSize, int widthSamples, int depthSamples, |
1031 | dReal thickness, int bWrap); | 1031 | dReal thickness, int bWrap); |
1032 | 1032 | ||
1033 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataCreate"), SuppressUnmanagedCodeSecurity] | 1033 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataCreate"), SuppressUnmanagedCodeSecurity] |
1034 | public static extern IntPtr GeomOSTerrainDataCreate(); | 1034 | internal static extern IntPtr GeomOSTerrainDataCreate(); |
1035 | 1035 | ||
1036 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataDestroy"), SuppressUnmanagedCodeSecurity] | 1036 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataDestroy"), SuppressUnmanagedCodeSecurity] |
1037 | public static extern void GeomOSTerrainDataDestroy(IntPtr d); | 1037 | internal static extern void GeomOSTerrainDataDestroy(IntPtr d); |
1038 | 1038 | ||
1039 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity] | 1039 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity] |
1040 | public static extern void GeomOSTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); | 1040 | internal static extern void GeomOSTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); |
1041 | 1041 | ||
1042 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity] | 1042 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity] |
1043 | public static extern IntPtr GeomOSTerrainGetHeightfieldData(IntPtr g); | 1043 | internal static extern IntPtr GeomOSTerrainGetHeightfieldData(IntPtr g); |
1044 | 1044 | ||
1045 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity] | 1045 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity] |
1046 | public static extern void GeomOSTerrainSetHeightfieldData(IntPtr g, IntPtr d); | 1046 | internal static extern void GeomOSTerrainSetHeightfieldData(IntPtr g, IntPtr d); |
1047 | 1047 | ||
1048 | 1048 | ||
1049 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity] | 1049 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity] |
1050 | public static extern bool GeomIsEnabled(IntPtr geom); | 1050 | internal static extern bool GeomIsEnabled(IntPtr geom); |
1051 | 1051 | ||
1052 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsOffset"), SuppressUnmanagedCodeSecurity] | 1052 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsOffset"), SuppressUnmanagedCodeSecurity] |
1053 | public static extern bool GeomIsOffset(IntPtr geom); | 1053 | internal static extern bool GeomIsOffset(IntPtr geom); |
1054 | 1054 | ||
1055 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsSpace"), SuppressUnmanagedCodeSecurity] | 1055 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsSpace"), SuppressUnmanagedCodeSecurity] |
1056 | public static extern bool GeomIsSpace(IntPtr geom); | 1056 | internal static extern bool GeomIsSpace(IntPtr geom); |
1057 | 1057 | ||
1058 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] | 1058 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] |
1059 | public static extern void GeomPlaneGetParams(IntPtr geom, ref Vector4 result); | 1059 | internal static extern void GeomPlaneGetParams(IntPtr geom, ref Vector4 result); |
1060 | 1060 | ||
1061 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] | 1061 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] |
1062 | public static extern void GeomPlaneGetParams(IntPtr geom, ref dReal A); | 1062 | internal static extern void GeomPlaneGetParams(IntPtr geom, ref dReal A); |
1063 | 1063 | ||
1064 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlanePointDepth"), SuppressUnmanagedCodeSecurity] | 1064 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlanePointDepth"), SuppressUnmanagedCodeSecurity] |
1065 | public static extern dReal GeomPlanePointDepth(IntPtr geom, dReal x, dReal y, dReal z); | 1065 | internal static extern dReal GeomPlanePointDepth(IntPtr geom, dReal x, dReal y, dReal z); |
1066 | 1066 | ||
1067 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneSetParams"), SuppressUnmanagedCodeSecurity] | 1067 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneSetParams"), SuppressUnmanagedCodeSecurity] |
1068 | public static extern void GeomPlaneSetParams(IntPtr plane, dReal a, dReal b, dReal c, dReal d); | 1068 | internal static extern void GeomPlaneSetParams(IntPtr plane, dReal a, dReal b, dReal c, dReal d); |
1069 | 1069 | ||
1070 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] | 1070 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] |
1071 | public static extern void GeomRayGet(IntPtr ray, ref Vector3 start, ref Vector3 dir); | 1071 | internal static extern void GeomRayGet(IntPtr ray, ref Vector3 start, ref Vector3 dir); |
1072 | 1072 | ||
1073 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] | 1073 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] |
1074 | public static extern void GeomRayGet(IntPtr ray, ref dReal startX, ref dReal dirX); | 1074 | internal static extern void GeomRayGet(IntPtr ray, ref dReal startX, ref dReal dirX); |
1075 | 1075 | ||
1076 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetClosestHit"), SuppressUnmanagedCodeSecurity] | 1076 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetClosestHit"), SuppressUnmanagedCodeSecurity] |
1077 | public static extern int GeomRayGetClosestHit(IntPtr ray); | 1077 | internal static extern int GeomRayGetClosestHit(IntPtr ray); |
1078 | 1078 | ||
1079 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetLength"), SuppressUnmanagedCodeSecurity] | 1079 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetLength"), SuppressUnmanagedCodeSecurity] |
1080 | public static extern dReal GeomRayGetLength(IntPtr ray); | 1080 | internal static extern dReal GeomRayGetLength(IntPtr ray); |
1081 | 1081 | ||
1082 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetParams"), SuppressUnmanagedCodeSecurity] | 1082 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetParams"), SuppressUnmanagedCodeSecurity] |
1083 | public static extern dReal GeomRayGetParams(IntPtr g, out int firstContact, out int backfaceCull); | 1083 | internal static extern dReal GeomRayGetParams(IntPtr g, out int firstContact, out int backfaceCull); |
1084 | 1084 | ||
1085 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySet"), SuppressUnmanagedCodeSecurity] | 1085 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySet"), SuppressUnmanagedCodeSecurity] |
1086 | public static extern void GeomRaySet(IntPtr ray, dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz); | 1086 | internal static extern void GeomRaySet(IntPtr ray, dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz); |
1087 | 1087 | ||
1088 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetClosestHit"), SuppressUnmanagedCodeSecurity] | 1088 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetClosestHit"), SuppressUnmanagedCodeSecurity] |
1089 | public static extern void GeomRaySetClosestHit(IntPtr ray, int closestHit); | 1089 | internal static extern void GeomRaySetClosestHit(IntPtr ray, int closestHit); |
1090 | 1090 | ||
1091 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetLength"), SuppressUnmanagedCodeSecurity] | 1091 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetLength"), SuppressUnmanagedCodeSecurity] |
1092 | public static extern void GeomRaySetLength(IntPtr ray, dReal length); | 1092 | internal static extern void GeomRaySetLength(IntPtr ray, dReal length); |
1093 | 1093 | ||
1094 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetParams"), SuppressUnmanagedCodeSecurity] | 1094 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetParams"), SuppressUnmanagedCodeSecurity] |
1095 | public static extern void GeomRaySetParams(IntPtr ray, int firstContact, int backfaceCull); | 1095 | internal static extern void GeomRaySetParams(IntPtr ray, int firstContact, int backfaceCull); |
1096 | 1096 | ||
1097 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetBody"), SuppressUnmanagedCodeSecurity] | 1097 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetBody"), SuppressUnmanagedCodeSecurity] |
1098 | public static extern void GeomSetBody(IntPtr geom, IntPtr body); | 1098 | internal static extern void GeomSetBody(IntPtr geom, IntPtr body); |
1099 | 1099 | ||
1100 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCategoryBits"), SuppressUnmanagedCodeSecurity] | 1100 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCategoryBits"), SuppressUnmanagedCodeSecurity] |
1101 | public static extern void GeomSetCategoryBits(IntPtr geom, uint bits); | 1101 | internal static extern void GeomSetCategoryBits(IntPtr geom, uint bits); |
1102 | 1102 | ||
1103 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCollideBits"), SuppressUnmanagedCodeSecurity] | 1103 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCollideBits"), SuppressUnmanagedCodeSecurity] |
1104 | public static extern void GeomSetCollideBits(IntPtr geom, uint bits); | 1104 | internal static extern void GeomSetCollideBits(IntPtr geom, uint bits); |
1105 | 1105 | ||
1106 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetConvex"), SuppressUnmanagedCodeSecurity] | 1106 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetConvex"), SuppressUnmanagedCodeSecurity] |
1107 | public static extern IntPtr GeomSetConvex(IntPtr geom, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); | 1107 | internal static extern IntPtr GeomSetConvex(IntPtr geom, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); |
1108 | 1108 | ||
1109 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetData"), SuppressUnmanagedCodeSecurity] | 1109 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetData"), SuppressUnmanagedCodeSecurity] |
1110 | public static extern void GeomSetData(IntPtr geom, IntPtr data); | 1110 | internal static extern void GeomSetData(IntPtr geom, IntPtr data); |
1111 | 1111 | ||
1112 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetPosition"), SuppressUnmanagedCodeSecurity] | 1112 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetPosition"), SuppressUnmanagedCodeSecurity] |
1113 | public static extern void GeomSetOffsetPosition(IntPtr geom, dReal x, dReal y, dReal z); | 1113 | internal static extern void GeomSetOffsetPosition(IntPtr geom, dReal x, dReal y, dReal z); |
1114 | 1114 | ||
1115 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | 1115 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] |
1116 | public static extern void GeomSetOffsetQuaternion(IntPtr geom, ref Quaternion Q); | 1116 | internal static extern void GeomSetOffsetQuaternion(IntPtr geom, ref Quaternion Q); |
1117 | 1117 | ||
1118 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | 1118 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] |
1119 | public static extern void GeomSetOffsetQuaternion(IntPtr geom, ref dReal X); | 1119 | internal static extern void GeomSetOffsetQuaternion(IntPtr geom, ref dReal X); |
1120 | 1120 | ||
1121 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] | 1121 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] |
1122 | public static extern void GeomSetOffsetRotation(IntPtr geom, ref Matrix3 R); | 1122 | internal static extern void GeomSetOffsetRotation(IntPtr geom, ref Matrix3 R); |
1123 | 1123 | ||
1124 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] | 1124 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] |
1125 | public static extern void GeomSetOffsetRotation(IntPtr geom, ref dReal M00); | 1125 | internal static extern void GeomSetOffsetRotation(IntPtr geom, ref dReal M00); |
1126 | 1126 | ||
1127 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldPosition"), SuppressUnmanagedCodeSecurity] | 1127 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldPosition"), SuppressUnmanagedCodeSecurity] |
1128 | public static extern void GeomSetOffsetWorldPosition(IntPtr geom, dReal x, dReal y, dReal z); | 1128 | internal static extern void GeomSetOffsetWorldPosition(IntPtr geom, dReal x, dReal y, dReal z); |
1129 | 1129 | ||
1130 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] | 1130 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] |
1131 | public static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref Quaternion Q); | 1131 | internal static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref Quaternion Q); |
1132 | 1132 | ||
1133 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] | 1133 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] |
1134 | public static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref dReal X); | 1134 | internal static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref dReal X); |
1135 | 1135 | ||
1136 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] | 1136 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] |
1137 | public static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref Matrix3 R); | 1137 | internal static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref Matrix3 R); |
1138 | 1138 | ||
1139 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] | 1139 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] |
1140 | public static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref dReal M00); | 1140 | internal static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref dReal M00); |
1141 | 1141 | ||
1142 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetPosition"), SuppressUnmanagedCodeSecurity] | 1142 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetPosition"), SuppressUnmanagedCodeSecurity] |
1143 | public static extern void GeomSetPosition(IntPtr geom, dReal x, dReal y, dReal z); | 1143 | internal static extern void GeomSetPosition(IntPtr geom, dReal x, dReal y, dReal z); |
1144 | 1144 | ||
1145 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] | 1145 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] |
1146 | public static extern void GeomSetQuaternion(IntPtr geom, ref Quaternion quat); | 1146 | internal static extern void GeomSetQuaternion(IntPtr geom, ref Quaternion quat); |
1147 | 1147 | ||
1148 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] | 1148 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] |
1149 | public static extern void GeomSetQuaternion(IntPtr geom, ref dReal w); | 1149 | internal static extern void GeomSetQuaternion(IntPtr geom, ref dReal w); |
1150 | 1150 | ||
1151 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] | 1151 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] |
1152 | public static extern void GeomSetRotation(IntPtr geom, ref Matrix3 R); | 1152 | internal static extern void GeomSetRotation(IntPtr geom, ref Matrix3 R); |
1153 | 1153 | ||
1154 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] | 1154 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] |
1155 | public static extern void GeomSetRotation(IntPtr geom, ref dReal M00); | 1155 | internal static extern void GeomSetRotation(IntPtr geom, ref dReal M00); |
1156 | 1156 | ||
1157 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereGetRadius"), SuppressUnmanagedCodeSecurity] | 1157 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereGetRadius"), SuppressUnmanagedCodeSecurity] |
1158 | public static extern dReal GeomSphereGetRadius(IntPtr geom); | 1158 | internal static extern dReal GeomSphereGetRadius(IntPtr geom); |
1159 | 1159 | ||
1160 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSpherePointDepth"), SuppressUnmanagedCodeSecurity] | 1160 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSpherePointDepth"), SuppressUnmanagedCodeSecurity] |
1161 | public static extern dReal GeomSpherePointDepth(IntPtr geom, dReal x, dReal y, dReal z); | 1161 | internal static extern dReal GeomSpherePointDepth(IntPtr geom, dReal x, dReal y, dReal z); |
1162 | 1162 | ||
1163 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereSetRadius"), SuppressUnmanagedCodeSecurity] | 1163 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereSetRadius"), SuppressUnmanagedCodeSecurity] |
1164 | public static extern void GeomSphereSetRadius(IntPtr geom, dReal radius); | 1164 | internal static extern void GeomSphereSetRadius(IntPtr geom, dReal radius); |
1165 | 1165 | ||
1166 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetCleanup"), SuppressUnmanagedCodeSecurity] | 1166 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetCleanup"), SuppressUnmanagedCodeSecurity] |
1167 | public static extern int GeomTransformGetCleanup(IntPtr geom); | 1167 | internal static extern int GeomTransformGetCleanup(IntPtr geom); |
1168 | 1168 | ||
1169 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetGeom"), SuppressUnmanagedCodeSecurity] | 1169 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetGeom"), SuppressUnmanagedCodeSecurity] |
1170 | public static extern IntPtr GeomTransformGetGeom(IntPtr geom); | 1170 | internal static extern IntPtr GeomTransformGetGeom(IntPtr geom); |
1171 | 1171 | ||
1172 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetInfo"), SuppressUnmanagedCodeSecurity] | 1172 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetInfo"), SuppressUnmanagedCodeSecurity] |
1173 | public static extern int GeomTransformGetInfo(IntPtr geom); | 1173 | internal static extern int GeomTransformGetInfo(IntPtr geom); |
1174 | 1174 | ||
1175 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetCleanup"), SuppressUnmanagedCodeSecurity] | 1175 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetCleanup"), SuppressUnmanagedCodeSecurity] |
1176 | public static extern void GeomTransformSetCleanup(IntPtr geom, int mode); | 1176 | internal static extern void GeomTransformSetCleanup(IntPtr geom, int mode); |
1177 | 1177 | ||
1178 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetGeom"), SuppressUnmanagedCodeSecurity] | 1178 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetGeom"), SuppressUnmanagedCodeSecurity] |
1179 | public static extern void GeomTransformSetGeom(IntPtr geom, IntPtr obj); | 1179 | internal static extern void GeomTransformSetGeom(IntPtr geom, IntPtr obj); |
1180 | 1180 | ||
1181 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetInfo"), SuppressUnmanagedCodeSecurity] | 1181 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetInfo"), SuppressUnmanagedCodeSecurity] |
1182 | public static extern void GeomTransformSetInfo(IntPtr geom, int info); | 1182 | internal static extern void GeomTransformSetInfo(IntPtr geom, int info); |
1183 | 1183 | ||
1184 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] | 1184 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] |
1185 | public static extern void GeomTriMeshDataBuildDouble(IntPtr d, | 1185 | internal static extern void GeomTriMeshDataBuildDouble(IntPtr d, |
1186 | double[] vertices, int vertexStride, int vertexCount, | 1186 | double[] vertices, int vertexStride, int vertexCount, |
1187 | int[] indices, int indexCount, int triStride); | 1187 | int[] indices, int indexCount, int triStride); |
1188 | 1188 | ||
1189 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] | 1189 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] |
1190 | public static extern void GeomTriMeshDataBuildDouble(IntPtr d, | 1190 | internal static extern void GeomTriMeshDataBuildDouble(IntPtr d, |
1191 | IntPtr vertices, int vertexStride, int vertexCount, | 1191 | IntPtr vertices, int vertexStride, int vertexCount, |
1192 | IntPtr indices, int indexCount, int triStride); | 1192 | IntPtr indices, int indexCount, int triStride); |
1193 | 1193 | ||
1194 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] | 1194 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] |
1195 | public static extern void GeomTriMeshDataBuildDouble1(IntPtr d, | 1195 | internal static extern void GeomTriMeshDataBuildDouble1(IntPtr d, |
1196 | double[] vertices, int vertexStride, int vertexCount, | 1196 | double[] vertices, int vertexStride, int vertexCount, |
1197 | int[] indices, int indexCount, int triStride, | 1197 | int[] indices, int indexCount, int triStride, |
1198 | double[] normals); | 1198 | double[] normals); |
1199 | 1199 | ||
1200 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] | 1200 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] |
1201 | public static extern void GeomTriMeshDataBuildDouble(IntPtr d, | 1201 | internal static extern void GeomTriMeshDataBuildDouble(IntPtr d, |
1202 | IntPtr vertices, int vertexStride, int vertexCount, | 1202 | IntPtr vertices, int vertexStride, int vertexCount, |
1203 | IntPtr indices, int indexCount, int triStride, | 1203 | IntPtr indices, int indexCount, int triStride, |
1204 | IntPtr normals); | 1204 | IntPtr normals); |
1205 | 1205 | ||
1206 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] | 1206 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] |
1207 | public static extern void GeomTriMeshDataBuildSingle(IntPtr d, | 1207 | internal static extern void GeomTriMeshDataBuildSingle(IntPtr d, |
1208 | dReal[] vertices, int vertexStride, int vertexCount, | 1208 | dReal[] vertices, int vertexStride, int vertexCount, |
1209 | int[] indices, int indexCount, int triStride); | 1209 | int[] indices, int indexCount, int triStride); |
1210 | 1210 | ||
1211 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] | 1211 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] |
1212 | public static extern void GeomTriMeshDataBuildSingle(IntPtr d, | 1212 | internal static extern void GeomTriMeshDataBuildSingle(IntPtr d, |
1213 | IntPtr vertices, int vertexStride, int vertexCount, | 1213 | IntPtr vertices, int vertexStride, int vertexCount, |
1214 | IntPtr indices, int indexCount, int triStride); | 1214 | IntPtr indices, int indexCount, int triStride); |
1215 | 1215 | ||
1216 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] | 1216 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] |
1217 | public static extern void GeomTriMeshDataBuildSingle1(IntPtr d, | 1217 | internal static extern void GeomTriMeshDataBuildSingle1(IntPtr d, |
1218 | dReal[] vertices, int vertexStride, int vertexCount, | 1218 | dReal[] vertices, int vertexStride, int vertexCount, |
1219 | int[] indices, int indexCount, int triStride, | 1219 | int[] indices, int indexCount, int triStride, |
1220 | dReal[] normals); | 1220 | dReal[] normals); |
1221 | 1221 | ||
1222 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] | 1222 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] |
1223 | public static extern void GeomTriMeshDataBuildSingle1(IntPtr d, | 1223 | internal static extern void GeomTriMeshDataBuildSingle1(IntPtr d, |
1224 | IntPtr vertices, int vertexStride, int vertexCount, | 1224 | IntPtr vertices, int vertexStride, int vertexCount, |
1225 | IntPtr indices, int indexCount, int triStride, | 1225 | IntPtr indices, int indexCount, int triStride, |
1226 | IntPtr normals); | 1226 | IntPtr normals); |
1227 | 1227 | ||
1228 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] | 1228 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] |
1229 | public static extern void GeomTriMeshDataBuildSimple(IntPtr d, | 1229 | internal static extern void GeomTriMeshDataBuildSimple(IntPtr d, |
1230 | float[] vertices, int vertexStride, int vertexCount, | 1230 | float[] vertices, int vertexStride, int vertexCount, |
1231 | int[] indices, int indexCount, int triStride); | 1231 | int[] indices, int indexCount, int triStride); |
1232 | 1232 | ||
1233 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] | 1233 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] |
1234 | public static extern void GeomTriMeshDataBuildSimple(IntPtr d, | 1234 | internal static extern void GeomTriMeshDataBuildSimple(IntPtr d, |
1235 | IntPtr vertices, int vertexStride, int vertexCount, | 1235 | IntPtr vertices, int vertexStride, int vertexCount, |
1236 | IntPtr indices, int indexCount, int triStride); | 1236 | IntPtr indices, int indexCount, int triStride); |
1237 | 1237 | ||
1238 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] | 1238 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] |
1239 | public static extern void GeomTriMeshDataBuildSimple1(IntPtr d, | 1239 | internal static extern void GeomTriMeshDataBuildSimple1(IntPtr d, |
1240 | float[] vertices, int vertexStride, int vertexCount, | 1240 | float[] vertices, int vertexStride, int vertexCount, |
1241 | int[] indices, int indexCount, int triStride, | 1241 | int[] indices, int indexCount, int triStride, |
1242 | float[] normals); | 1242 | float[] normals); |
1243 | 1243 | ||
1244 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] | 1244 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] |
1245 | public static extern void GeomTriMeshDataBuildSimple1(IntPtr d, | 1245 | internal static extern void GeomTriMeshDataBuildSimple1(IntPtr d, |
1246 | IntPtr vertices, int vertexStride, int vertexCount, | 1246 | IntPtr vertices, int vertexStride, int vertexCount, |
1247 | IntPtr indices, int indexCount, int triStride, | 1247 | IntPtr indices, int indexCount, int triStride, |
1248 | IntPtr normals); | 1248 | IntPtr normals); |
1249 | 1249 | ||
1250 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshClearTCCache"), SuppressUnmanagedCodeSecurity] | 1250 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshClearTCCache"), SuppressUnmanagedCodeSecurity] |
1251 | public static extern void GeomTriMeshClearTCCache(IntPtr g); | 1251 | internal static extern void GeomTriMeshClearTCCache(IntPtr g); |
1252 | 1252 | ||
1253 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataCreate"), SuppressUnmanagedCodeSecurity] | 1253 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataCreate"), SuppressUnmanagedCodeSecurity] |
1254 | public static extern IntPtr GeomTriMeshDataCreate(); | 1254 | internal static extern IntPtr GeomTriMeshDataCreate(); |
1255 | 1255 | ||
1256 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataDestroy"), SuppressUnmanagedCodeSecurity] | 1256 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataDestroy"), SuppressUnmanagedCodeSecurity] |
1257 | public static extern void GeomTriMeshDataDestroy(IntPtr d); | 1257 | internal static extern void GeomTriMeshDataDestroy(IntPtr d); |
1258 | 1258 | ||
1259 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataGet"), SuppressUnmanagedCodeSecurity] | 1259 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataGet"), SuppressUnmanagedCodeSecurity] |
1260 | public static extern IntPtr GeomTriMeshDataGet(IntPtr d, int data_id); | 1260 | internal static extern IntPtr GeomTriMeshDataGet(IntPtr d, int data_id); |
1261 | 1261 | ||
1262 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataPreprocess"), SuppressUnmanagedCodeSecurity] | 1262 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataPreprocess"), SuppressUnmanagedCodeSecurity] |
1263 | public static extern void GeomTriMeshDataPreprocess(IntPtr d); | 1263 | internal static extern void GeomTriMeshDataPreprocess(IntPtr d); |
1264 | 1264 | ||
1265 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataSet"), SuppressUnmanagedCodeSecurity] | 1265 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataSet"), SuppressUnmanagedCodeSecurity] |
1266 | public static extern void GeomTriMeshDataSet(IntPtr d, int data_id, IntPtr in_data); | 1266 | internal static extern void GeomTriMeshDataSet(IntPtr d, int data_id, IntPtr in_data); |
1267 | 1267 | ||
1268 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataUpdate"), SuppressUnmanagedCodeSecurity] | 1268 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataUpdate"), SuppressUnmanagedCodeSecurity] |
1269 | public static extern void GeomTriMeshDataUpdate(IntPtr d); | 1269 | internal static extern void GeomTriMeshDataUpdate(IntPtr d); |
1270 | 1270 | ||
1271 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshEnableTC"), SuppressUnmanagedCodeSecurity] | 1271 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshEnableTC"), SuppressUnmanagedCodeSecurity] |
1272 | public static extern void GeomTriMeshEnableTC(IntPtr g, int geomClass, bool enable); | 1272 | internal static extern void GeomTriMeshEnableTC(IntPtr g, int geomClass, bool enable); |
1273 | 1273 | ||
1274 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetArrayCallback"), SuppressUnmanagedCodeSecurity] | 1274 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetArrayCallback"), SuppressUnmanagedCodeSecurity] |
1275 | public static extern TriArrayCallback GeomTriMeshGetArrayCallback(IntPtr g); | 1275 | internal static extern TriArrayCallback GeomTriMeshGetArrayCallback(IntPtr g); |
1276 | 1276 | ||
1277 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetCallback"), SuppressUnmanagedCodeSecurity] | 1277 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetCallback"), SuppressUnmanagedCodeSecurity] |
1278 | public static extern TriCallback GeomTriMeshGetCallback(IntPtr g); | 1278 | internal static extern TriCallback GeomTriMeshGetCallback(IntPtr g); |
1279 | 1279 | ||
1280 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetData"), SuppressUnmanagedCodeSecurity] | 1280 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetData"), SuppressUnmanagedCodeSecurity] |
1281 | public static extern IntPtr GeomTriMeshGetData(IntPtr g); | 1281 | internal static extern IntPtr GeomTriMeshGetData(IntPtr g); |
1282 | 1282 | ||
1283 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetLastTransform"), SuppressUnmanagedCodeSecurity] | 1283 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetLastTransform"), SuppressUnmanagedCodeSecurity] |
1284 | public extern unsafe static Matrix4* GeomTriMeshGetLastTransformUnsafe(IntPtr geom); | 1284 | internal extern unsafe static Matrix4* GeomTriMeshGetLastTransformUnsafe(IntPtr geom); |
1285 | public static Matrix4 GeomTriMeshGetLastTransform(IntPtr geom) | 1285 | internal static Matrix4 GeomTriMeshGetLastTransform(IntPtr geom) |
1286 | { | 1286 | { |
1287 | unsafe { return *(GeomTriMeshGetLastTransformUnsafe(geom)); } | 1287 | unsafe { return *(GeomTriMeshGetLastTransformUnsafe(geom)); } |
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetPoint"), SuppressUnmanagedCodeSecurity] | 1290 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetPoint"), SuppressUnmanagedCodeSecurity] |
1291 | public extern static void GeomTriMeshGetPoint(IntPtr g, int index, dReal u, dReal v, ref Vector3 outVec); | 1291 | internal extern static void GeomTriMeshGetPoint(IntPtr g, int index, dReal u, dReal v, ref Vector3 outVec); |
1292 | 1292 | ||
1293 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetRayCallback"), SuppressUnmanagedCodeSecurity] | 1293 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetRayCallback"), SuppressUnmanagedCodeSecurity] |
1294 | public static extern TriRayCallback GeomTriMeshGetRayCallback(IntPtr g); | 1294 | internal static extern TriRayCallback GeomTriMeshGetRayCallback(IntPtr g); |
1295 | 1295 | ||
1296 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangle"), SuppressUnmanagedCodeSecurity] | 1296 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangle"), SuppressUnmanagedCodeSecurity] |
1297 | public extern static void GeomTriMeshGetTriangle(IntPtr g, int index, ref Vector3 v0, ref Vector3 v1, ref Vector3 v2); | 1297 | internal extern static void GeomTriMeshGetTriangle(IntPtr g, int index, ref Vector3 v0, ref Vector3 v1, ref Vector3 v2); |
1298 | 1298 | ||
1299 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangleCount"), SuppressUnmanagedCodeSecurity] | 1299 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangleCount"), SuppressUnmanagedCodeSecurity] |
1300 | public extern static int GeomTriMeshGetTriangleCount(IntPtr g); | 1300 | internal extern static int GeomTriMeshGetTriangleCount(IntPtr g); |
1301 | 1301 | ||
1302 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriMeshDataID"), SuppressUnmanagedCodeSecurity] | 1302 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriMeshDataID"), SuppressUnmanagedCodeSecurity] |
1303 | public static extern IntPtr GeomTriMeshGetTriMeshDataID(IntPtr g); | 1303 | internal static extern IntPtr GeomTriMeshGetTriMeshDataID(IntPtr g); |
1304 | 1304 | ||
1305 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshIsTCEnabled"), SuppressUnmanagedCodeSecurity] | 1305 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshIsTCEnabled"), SuppressUnmanagedCodeSecurity] |
1306 | public static extern bool GeomTriMeshIsTCEnabled(IntPtr g, int geomClass); | 1306 | internal static extern bool GeomTriMeshIsTCEnabled(IntPtr g, int geomClass); |
1307 | 1307 | ||
1308 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetArrayCallback"), SuppressUnmanagedCodeSecurity] | 1308 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetArrayCallback"), SuppressUnmanagedCodeSecurity] |
1309 | public static extern void GeomTriMeshSetArrayCallback(IntPtr g, TriArrayCallback arrayCallback); | 1309 | internal static extern void GeomTriMeshSetArrayCallback(IntPtr g, TriArrayCallback arrayCallback); |
1310 | 1310 | ||
1311 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetCallback"), SuppressUnmanagedCodeSecurity] | 1311 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetCallback"), SuppressUnmanagedCodeSecurity] |
1312 | public static extern void GeomTriMeshSetCallback(IntPtr g, TriCallback callback); | 1312 | internal static extern void GeomTriMeshSetCallback(IntPtr g, TriCallback callback); |
1313 | 1313 | ||
1314 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetData"), SuppressUnmanagedCodeSecurity] | 1314 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetData"), SuppressUnmanagedCodeSecurity] |
1315 | public static extern void GeomTriMeshSetData(IntPtr g, IntPtr data); | 1315 | internal static extern void GeomTriMeshSetData(IntPtr g, IntPtr data); |
1316 | 1316 | ||
1317 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] | 1317 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] |
1318 | public static extern void GeomTriMeshSetLastTransform(IntPtr g, ref Matrix4 last_trans); | 1318 | internal static extern void GeomTriMeshSetLastTransform(IntPtr g, ref Matrix4 last_trans); |
1319 | 1319 | ||
1320 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] | 1320 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] |
1321 | public static extern void GeomTriMeshSetLastTransform(IntPtr g, ref dReal M00); | 1321 | internal static extern void GeomTriMeshSetLastTransform(IntPtr g, ref dReal M00); |
1322 | 1322 | ||
1323 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetRayCallback"), SuppressUnmanagedCodeSecurity] | 1323 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetRayCallback"), SuppressUnmanagedCodeSecurity] |
1324 | public static extern void GeomTriMeshSetRayCallback(IntPtr g, TriRayCallback callback); | 1324 | internal static extern void GeomTriMeshSetRayCallback(IntPtr g, TriRayCallback callback); |
1325 | 1325 | ||
1326 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGetConfiguration"), SuppressUnmanagedCodeSecurity] | 1326 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGetConfiguration"), SuppressUnmanagedCodeSecurity] |
1327 | public static extern IntPtr iGetConfiguration(); | 1327 | internal static extern IntPtr iGetConfiguration(); |
1328 | 1328 | ||
1329 | public static string GetConfiguration() | 1329 | internal static string GetConfiguration() |
1330 | { | 1330 | { |
1331 | IntPtr ptr = iGetConfiguration(); | 1331 | IntPtr ptr = iGetConfiguration(); |
1332 | string s = Marshal.PtrToStringAnsi(ptr); | 1332 | string s = Marshal.PtrToStringAnsi(ptr); |
@@ -1334,691 +1334,688 @@ namespace OdeAPI | |||
1334 | } | 1334 | } |
1335 | 1335 | ||
1336 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceCreate"), SuppressUnmanagedCodeSecurity] | 1336 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceCreate"), SuppressUnmanagedCodeSecurity] |
1337 | public static extern IntPtr HashSpaceCreate(IntPtr space); | 1337 | internal static extern IntPtr HashSpaceCreate(IntPtr space); |
1338 | 1338 | ||
1339 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceGetLevels"), SuppressUnmanagedCodeSecurity] | 1339 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceGetLevels"), SuppressUnmanagedCodeSecurity] |
1340 | public static extern void HashSpaceGetLevels(IntPtr space, out int minlevel, out int maxlevel); | 1340 | internal static extern void HashSpaceGetLevels(IntPtr space, out int minlevel, out int maxlevel); |
1341 | 1341 | ||
1342 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceSetLevels"), SuppressUnmanagedCodeSecurity] | 1342 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceSetLevels"), SuppressUnmanagedCodeSecurity] |
1343 | public static extern void HashSpaceSetLevels(IntPtr space, int minlevel, int maxlevel); | 1343 | internal static extern void HashSpaceSetLevels(IntPtr space, int minlevel, int maxlevel); |
1344 | 1344 | ||
1345 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInfiniteAABB"), SuppressUnmanagedCodeSecurity] | 1345 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInfiniteAABB"), SuppressUnmanagedCodeSecurity] |
1346 | public static extern void InfiniteAABB(IntPtr geom, out AABB aabb); | 1346 | internal static extern void InfiniteAABB(IntPtr geom, out AABB aabb); |
1347 | 1347 | ||
1348 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE"), SuppressUnmanagedCodeSecurity] | 1348 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE"), SuppressUnmanagedCodeSecurity] |
1349 | public static extern void InitODE(); | 1349 | internal static extern void InitODE(); |
1350 | 1350 | ||
1351 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE2"), SuppressUnmanagedCodeSecurity] | 1351 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE2"), SuppressUnmanagedCodeSecurity] |
1352 | public static extern int InitODE2(uint ODEInitFlags); | 1352 | internal static extern int InitODE2(uint ODEInitFlags); |
1353 | 1353 | ||
1354 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dIsPositiveDefinite"), SuppressUnmanagedCodeSecurity] | 1354 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dIsPositiveDefinite"), SuppressUnmanagedCodeSecurity] |
1355 | public static extern int IsPositiveDefinite(ref dReal A, int n); | 1355 | internal static extern int IsPositiveDefinite(ref dReal A, int n); |
1356 | 1356 | ||
1357 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInvertPDMatrix"), SuppressUnmanagedCodeSecurity] | 1357 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInvertPDMatrix"), SuppressUnmanagedCodeSecurity] |
1358 | public static extern int InvertPDMatrix(ref dReal A, out dReal Ainv, int n); | 1358 | internal static extern int InvertPDMatrix(ref dReal A, out dReal Ainv, int n); |
1359 | 1359 | ||
1360 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddAMotorTorques"), SuppressUnmanagedCodeSecurity] | 1360 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddAMotorTorques"), SuppressUnmanagedCodeSecurity] |
1361 | public static extern void JointAddAMotorTorques(IntPtr joint, dReal torque1, dReal torque2, dReal torque3); | 1361 | internal static extern void JointAddAMotorTorques(IntPtr joint, dReal torque1, dReal torque2, dReal torque3); |
1362 | 1362 | ||
1363 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHingeTorque"), SuppressUnmanagedCodeSecurity] | 1363 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHingeTorque"), SuppressUnmanagedCodeSecurity] |
1364 | public static extern void JointAddHingeTorque(IntPtr joint, dReal torque); | 1364 | internal static extern void JointAddHingeTorque(IntPtr joint, dReal torque); |
1365 | 1365 | ||
1366 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHinge2Torque"), SuppressUnmanagedCodeSecurity] | 1366 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHinge2Torque"), SuppressUnmanagedCodeSecurity] |
1367 | public static extern void JointAddHinge2Torques(IntPtr joint, dReal torque1, dReal torque2); | 1367 | internal static extern void JointAddHinge2Torques(IntPtr joint, dReal torque1, dReal torque2); |
1368 | 1368 | ||
1369 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddPRTorque"), SuppressUnmanagedCodeSecurity] | 1369 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddPRTorque"), SuppressUnmanagedCodeSecurity] |
1370 | public static extern void JointAddPRTorque(IntPtr joint, dReal torque); | 1370 | internal static extern void JointAddPRTorque(IntPtr joint, dReal torque); |
1371 | 1371 | ||
1372 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddUniversalTorque"), SuppressUnmanagedCodeSecurity] | 1372 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddUniversalTorque"), SuppressUnmanagedCodeSecurity] |
1373 | public static extern void JointAddUniversalTorques(IntPtr joint, dReal torque1, dReal torque2); | 1373 | internal static extern void JointAddUniversalTorques(IntPtr joint, dReal torque1, dReal torque2); |
1374 | 1374 | ||
1375 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddSliderForce"), SuppressUnmanagedCodeSecurity] | 1375 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddSliderForce"), SuppressUnmanagedCodeSecurity] |
1376 | public static extern void JointAddSliderForce(IntPtr joint, dReal force); | 1376 | internal static extern void JointAddSliderForce(IntPtr joint, dReal force); |
1377 | 1377 | ||
1378 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAttach"), SuppressUnmanagedCodeSecurity] | 1378 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAttach"), SuppressUnmanagedCodeSecurity] |
1379 | public static extern void JointAttach(IntPtr joint, IntPtr body1, IntPtr body2); | 1379 | internal static extern void JointAttach(IntPtr joint, IntPtr body1, IntPtr body2); |
1380 | 1380 | ||
1381 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateAMotor"), SuppressUnmanagedCodeSecurity] | 1381 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateAMotor"), SuppressUnmanagedCodeSecurity] |
1382 | public static extern IntPtr JointCreateAMotor(IntPtr world, IntPtr group); | 1382 | internal static extern IntPtr JointCreateAMotor(IntPtr world, IntPtr group); |
1383 | 1383 | ||
1384 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateBall"), SuppressUnmanagedCodeSecurity] | 1384 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateBall"), SuppressUnmanagedCodeSecurity] |
1385 | public static extern IntPtr JointCreateBall(IntPtr world, IntPtr group); | 1385 | internal static extern IntPtr JointCreateBall(IntPtr world, IntPtr group); |
1386 | 1386 | ||
1387 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] | 1387 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] |
1388 | public static extern IntPtr JointCreateContact(IntPtr world, IntPtr group, ref Contact contact); | 1388 | internal static extern IntPtr JointCreateContact(IntPtr world, IntPtr group, ref Contact contact); |
1389 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] | 1389 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] |
1390 | public static extern IntPtr JointCreateContactPtr(IntPtr world, IntPtr group, IntPtr contact); | 1390 | internal static extern IntPtr JointCreateContactPtr(IntPtr world, IntPtr group, IntPtr contact); |
1391 | 1391 | ||
1392 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateFixed"), SuppressUnmanagedCodeSecurity] | 1392 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateFixed"), SuppressUnmanagedCodeSecurity] |
1393 | public static extern IntPtr JointCreateFixed(IntPtr world, IntPtr group); | 1393 | internal static extern IntPtr JointCreateFixed(IntPtr world, IntPtr group); |
1394 | 1394 | ||
1395 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge"), SuppressUnmanagedCodeSecurity] | 1395 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge"), SuppressUnmanagedCodeSecurity] |
1396 | public static extern IntPtr JointCreateHinge(IntPtr world, IntPtr group); | 1396 | internal static extern IntPtr JointCreateHinge(IntPtr world, IntPtr group); |
1397 | 1397 | ||
1398 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge2"), SuppressUnmanagedCodeSecurity] | 1398 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge2"), SuppressUnmanagedCodeSecurity] |
1399 | public static extern IntPtr JointCreateHinge2(IntPtr world, IntPtr group); | 1399 | internal static extern IntPtr JointCreateHinge2(IntPtr world, IntPtr group); |
1400 | 1400 | ||
1401 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateLMotor"), SuppressUnmanagedCodeSecurity] | 1401 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateLMotor"), SuppressUnmanagedCodeSecurity] |
1402 | public static extern IntPtr JointCreateLMotor(IntPtr world, IntPtr group); | 1402 | internal static extern IntPtr JointCreateLMotor(IntPtr world, IntPtr group); |
1403 | 1403 | ||
1404 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateNull"), SuppressUnmanagedCodeSecurity] | 1404 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateNull"), SuppressUnmanagedCodeSecurity] |
1405 | public static extern IntPtr JointCreateNull(IntPtr world, IntPtr group); | 1405 | internal static extern IntPtr JointCreateNull(IntPtr world, IntPtr group); |
1406 | 1406 | ||
1407 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePR"), SuppressUnmanagedCodeSecurity] | 1407 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePR"), SuppressUnmanagedCodeSecurity] |
1408 | public static extern IntPtr JointCreatePR(IntPtr world, IntPtr group); | 1408 | internal static extern IntPtr JointCreatePR(IntPtr world, IntPtr group); |
1409 | 1409 | ||
1410 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePlane2D"), SuppressUnmanagedCodeSecurity] | 1410 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePlane2D"), SuppressUnmanagedCodeSecurity] |
1411 | public static extern IntPtr JointCreatePlane2D(IntPtr world, IntPtr group); | 1411 | internal static extern IntPtr JointCreatePlane2D(IntPtr world, IntPtr group); |
1412 | 1412 | ||
1413 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateSlider"), SuppressUnmanagedCodeSecurity] | 1413 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateSlider"), SuppressUnmanagedCodeSecurity] |
1414 | public static extern IntPtr JointCreateSlider(IntPtr world, IntPtr group); | 1414 | internal static extern IntPtr JointCreateSlider(IntPtr world, IntPtr group); |
1415 | 1415 | ||
1416 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateUniversal"), SuppressUnmanagedCodeSecurity] | 1416 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateUniversal"), SuppressUnmanagedCodeSecurity] |
1417 | public static extern IntPtr JointCreateUniversal(IntPtr world, IntPtr group); | 1417 | internal static extern IntPtr JointCreateUniversal(IntPtr world, IntPtr group); |
1418 | 1418 | ||
1419 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointDestroy"), SuppressUnmanagedCodeSecurity] | 1419 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointDestroy"), SuppressUnmanagedCodeSecurity] |
1420 | public static extern void JointDestroy(IntPtr j); | 1420 | internal static extern void JointDestroy(IntPtr j); |
1421 | 1421 | ||
1422 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngle"), SuppressUnmanagedCodeSecurity] | 1422 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngle"), SuppressUnmanagedCodeSecurity] |
1423 | public static extern dReal JointGetAMotorAngle(IntPtr j, int anum); | 1423 | internal static extern dReal JointGetAMotorAngle(IntPtr j, int anum); |
1424 | 1424 | ||
1425 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngleRate"), SuppressUnmanagedCodeSecurity] | 1425 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngleRate"), SuppressUnmanagedCodeSecurity] |
1426 | public static extern dReal JointGetAMotorAngleRate(IntPtr j, int anum); | 1426 | internal static extern dReal JointGetAMotorAngleRate(IntPtr j, int anum); |
1427 | 1427 | ||
1428 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxis"), SuppressUnmanagedCodeSecurity] | 1428 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxis"), SuppressUnmanagedCodeSecurity] |
1429 | public static extern void JointGetAMotorAxis(IntPtr j, int anum, out Vector3 result); | 1429 | internal static extern void JointGetAMotorAxis(IntPtr j, int anum, out Vector3 result); |
1430 | 1430 | ||
1431 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxisRel"), SuppressUnmanagedCodeSecurity] | 1431 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxisRel"), SuppressUnmanagedCodeSecurity] |
1432 | public static extern int JointGetAMotorAxisRel(IntPtr j, int anum); | 1432 | internal static extern int JointGetAMotorAxisRel(IntPtr j, int anum); |
1433 | 1433 | ||
1434 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorMode"), SuppressUnmanagedCodeSecurity] | 1434 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorMode"), SuppressUnmanagedCodeSecurity] |
1435 | public static extern int JointGetAMotorMode(IntPtr j); | 1435 | internal static extern int JointGetAMotorMode(IntPtr j); |
1436 | 1436 | ||
1437 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] | 1437 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] |
1438 | public static extern int JointGetAMotorNumAxes(IntPtr j); | 1438 | internal static extern int JointGetAMotorNumAxes(IntPtr j); |
1439 | 1439 | ||
1440 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorParam"), SuppressUnmanagedCodeSecurity] | 1440 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorParam"), SuppressUnmanagedCodeSecurity] |
1441 | public static extern dReal JointGetAMotorParam(IntPtr j, int parameter); | 1441 | internal static extern dReal JointGetAMotorParam(IntPtr j, int parameter); |
1442 | 1442 | ||
1443 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor"), SuppressUnmanagedCodeSecurity] | 1443 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor"), SuppressUnmanagedCodeSecurity] |
1444 | public static extern void JointGetBallAnchor(IntPtr j, out Vector3 result); | 1444 | internal static extern void JointGetBallAnchor(IntPtr j, out Vector3 result); |
1445 | 1445 | ||
1446 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor2"), SuppressUnmanagedCodeSecurity] | 1446 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor2"), SuppressUnmanagedCodeSecurity] |
1447 | public static extern void JointGetBallAnchor2(IntPtr j, out Vector3 result); | 1447 | internal static extern void JointGetBallAnchor2(IntPtr j, out Vector3 result); |
1448 | 1448 | ||
1449 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBody"), SuppressUnmanagedCodeSecurity] | 1449 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBody"), SuppressUnmanagedCodeSecurity] |
1450 | public static extern IntPtr JointGetBody(IntPtr j); | 1450 | internal static extern IntPtr JointGetBody(IntPtr j); |
1451 | 1451 | ||
1452 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetData"), SuppressUnmanagedCodeSecurity] | 1452 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetData"), SuppressUnmanagedCodeSecurity] |
1453 | public static extern IntPtr JointGetData(IntPtr j); | 1453 | internal static extern IntPtr JointGetData(IntPtr j); |
1454 | 1454 | ||
1455 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetFeedback"), SuppressUnmanagedCodeSecurity] | 1455 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetFeedback"), SuppressUnmanagedCodeSecurity] |
1456 | public extern unsafe static JointFeedback* JointGetFeedbackUnsafe(IntPtr j); | 1456 | internal extern unsafe static JointFeedback* JointGetFeedbackUnsafe(IntPtr j); |
1457 | public static JointFeedback JointGetFeedback(IntPtr j) | 1457 | internal static JointFeedback JointGetFeedback(IntPtr j) |
1458 | { | 1458 | { |
1459 | unsafe { return *(JointGetFeedbackUnsafe(j)); } | 1459 | unsafe { return *(JointGetFeedbackUnsafe(j)); } |
1460 | } | 1460 | } |
1461 | 1461 | ||
1462 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor"), SuppressUnmanagedCodeSecurity] | 1462 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor"), SuppressUnmanagedCodeSecurity] |
1463 | public static extern void JointGetHingeAnchor(IntPtr j, out Vector3 result); | 1463 | internal static extern void JointGetHingeAnchor(IntPtr j, out Vector3 result); |
1464 | 1464 | ||
1465 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngle"), SuppressUnmanagedCodeSecurity] | 1465 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngle"), SuppressUnmanagedCodeSecurity] |
1466 | public static extern dReal JointGetHingeAngle(IntPtr j); | 1466 | internal static extern dReal JointGetHingeAngle(IntPtr j); |
1467 | 1467 | ||
1468 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngleRate"), SuppressUnmanagedCodeSecurity] | 1468 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngleRate"), SuppressUnmanagedCodeSecurity] |
1469 | public static extern dReal JointGetHingeAngleRate(IntPtr j); | 1469 | internal static extern dReal JointGetHingeAngleRate(IntPtr j); |
1470 | 1470 | ||
1471 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAxis"), SuppressUnmanagedCodeSecurity] | 1471 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAxis"), SuppressUnmanagedCodeSecurity] |
1472 | public static extern void JointGetHingeAxis(IntPtr j, out Vector3 result); | 1472 | internal static extern void JointGetHingeAxis(IntPtr j, out Vector3 result); |
1473 | 1473 | ||
1474 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeParam"), SuppressUnmanagedCodeSecurity] | 1474 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeParam"), SuppressUnmanagedCodeSecurity] |
1475 | public static extern dReal JointGetHingeParam(IntPtr j, int parameter); | 1475 | internal static extern dReal JointGetHingeParam(IntPtr j, int parameter); |
1476 | 1476 | ||
1477 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1"), SuppressUnmanagedCodeSecurity] | 1477 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1"), SuppressUnmanagedCodeSecurity] |
1478 | public static extern dReal JointGetHinge2Angle1(IntPtr j); | 1478 | internal static extern dReal JointGetHinge2Angle1(IntPtr j); |
1479 | 1479 | ||
1480 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1Rate"), SuppressUnmanagedCodeSecurity] | 1480 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1Rate"), SuppressUnmanagedCodeSecurity] |
1481 | public static extern dReal JointGetHinge2Angle1Rate(IntPtr j); | 1481 | internal static extern dReal JointGetHinge2Angle1Rate(IntPtr j); |
1482 | 1482 | ||
1483 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle2Rate"), SuppressUnmanagedCodeSecurity] | 1483 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle2Rate"), SuppressUnmanagedCodeSecurity] |
1484 | public static extern dReal JointGetHinge2Angle2Rate(IntPtr j); | 1484 | internal static extern dReal JointGetHinge2Angle2Rate(IntPtr j); |
1485 | 1485 | ||
1486 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor2"), SuppressUnmanagedCodeSecurity] | 1486 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor2"), SuppressUnmanagedCodeSecurity] |
1487 | public static extern void JointGetHingeAnchor2(IntPtr j, out Vector3 result); | 1487 | internal static extern void JointGetHingeAnchor2(IntPtr j, out Vector3 result); |
1488 | 1488 | ||
1489 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor"), SuppressUnmanagedCodeSecurity] | 1489 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor"), SuppressUnmanagedCodeSecurity] |
1490 | public static extern void JointGetHinge2Anchor(IntPtr j, out Vector3 result); | 1490 | internal static extern void JointGetHinge2Anchor(IntPtr j, out Vector3 result); |
1491 | 1491 | ||
1492 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor2"), SuppressUnmanagedCodeSecurity] | 1492 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor2"), SuppressUnmanagedCodeSecurity] |
1493 | public static extern void JointGetHinge2Anchor2(IntPtr j, out Vector3 result); | 1493 | internal static extern void JointGetHinge2Anchor2(IntPtr j, out Vector3 result); |
1494 | 1494 | ||
1495 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis1"), SuppressUnmanagedCodeSecurity] | 1495 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis1"), SuppressUnmanagedCodeSecurity] |
1496 | public static extern void JointGetHinge2Axis1(IntPtr j, out Vector3 result); | 1496 | internal static extern void JointGetHinge2Axis1(IntPtr j, out Vector3 result); |
1497 | 1497 | ||
1498 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis2"), SuppressUnmanagedCodeSecurity] | 1498 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis2"), SuppressUnmanagedCodeSecurity] |
1499 | public static extern void JointGetHinge2Axis2(IntPtr j, out Vector3 result); | 1499 | internal static extern void JointGetHinge2Axis2(IntPtr j, out Vector3 result); |
1500 | 1500 | ||
1501 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Param"), SuppressUnmanagedCodeSecurity] | 1501 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Param"), SuppressUnmanagedCodeSecurity] |
1502 | public static extern dReal JointGetHinge2Param(IntPtr j, int parameter); | 1502 | internal static extern dReal JointGetHinge2Param(IntPtr j, int parameter); |
1503 | 1503 | ||
1504 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorAxis"), SuppressUnmanagedCodeSecurity] | 1504 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorAxis"), SuppressUnmanagedCodeSecurity] |
1505 | public static extern void JointGetLMotorAxis(IntPtr j, int anum, out Vector3 result); | 1505 | internal static extern void JointGetLMotorAxis(IntPtr j, int anum, out Vector3 result); |
1506 | 1506 | ||
1507 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] | 1507 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] |
1508 | public static extern int JointGetLMotorNumAxes(IntPtr j); | 1508 | internal static extern int JointGetLMotorNumAxes(IntPtr j); |
1509 | 1509 | ||
1510 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorParam"), SuppressUnmanagedCodeSecurity] | 1510 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorParam"), SuppressUnmanagedCodeSecurity] |
1511 | public static extern dReal JointGetLMotorParam(IntPtr j, int parameter); | 1511 | internal static extern dReal JointGetLMotorParam(IntPtr j, int parameter); |
1512 | 1512 | ||
1513 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAnchor"), SuppressUnmanagedCodeSecurity] | 1513 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAnchor"), SuppressUnmanagedCodeSecurity] |
1514 | public static extern void JointGetPRAnchor(IntPtr j, out Vector3 result); | 1514 | internal static extern void JointGetPRAnchor(IntPtr j, out Vector3 result); |
1515 | 1515 | ||
1516 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis1"), SuppressUnmanagedCodeSecurity] | 1516 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis1"), SuppressUnmanagedCodeSecurity] |
1517 | public static extern void JointGetPRAxis1(IntPtr j, out Vector3 result); | 1517 | internal static extern void JointGetPRAxis1(IntPtr j, out Vector3 result); |
1518 | 1518 | ||
1519 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis2"), SuppressUnmanagedCodeSecurity] | 1519 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis2"), SuppressUnmanagedCodeSecurity] |
1520 | public static extern void JointGetPRAxis2(IntPtr j, out Vector3 result); | 1520 | internal static extern void JointGetPRAxis2(IntPtr j, out Vector3 result); |
1521 | 1521 | ||
1522 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRParam"), SuppressUnmanagedCodeSecurity] | 1522 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRParam"), SuppressUnmanagedCodeSecurity] |
1523 | public static extern dReal JointGetPRParam(IntPtr j, int parameter); | 1523 | internal static extern dReal JointGetPRParam(IntPtr j, int parameter); |
1524 | 1524 | ||
1525 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPosition"), SuppressUnmanagedCodeSecurity] | 1525 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPosition"), SuppressUnmanagedCodeSecurity] |
1526 | public static extern dReal JointGetPRPosition(IntPtr j); | 1526 | internal static extern dReal JointGetPRPosition(IntPtr j); |
1527 | 1527 | ||
1528 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPositionRate"), SuppressUnmanagedCodeSecurity] | 1528 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPositionRate"), SuppressUnmanagedCodeSecurity] |
1529 | public static extern dReal JointGetPRPositionRate(IntPtr j); | 1529 | internal static extern dReal JointGetPRPositionRate(IntPtr j); |
1530 | 1530 | ||
1531 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderAxis"), SuppressUnmanagedCodeSecurity] | 1531 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderAxis"), SuppressUnmanagedCodeSecurity] |
1532 | public static extern void JointGetSliderAxis(IntPtr j, out Vector3 result); | 1532 | internal static extern void JointGetSliderAxis(IntPtr j, out Vector3 result); |
1533 | 1533 | ||
1534 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderParam"), SuppressUnmanagedCodeSecurity] | 1534 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderParam"), SuppressUnmanagedCodeSecurity] |
1535 | public static extern dReal JointGetSliderParam(IntPtr j, int parameter); | 1535 | internal static extern dReal JointGetSliderParam(IntPtr j, int parameter); |
1536 | 1536 | ||
1537 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPosition"), SuppressUnmanagedCodeSecurity] | 1537 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPosition"), SuppressUnmanagedCodeSecurity] |
1538 | public static extern dReal JointGetSliderPosition(IntPtr j); | 1538 | internal static extern dReal JointGetSliderPosition(IntPtr j); |
1539 | 1539 | ||
1540 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPositionRate"), SuppressUnmanagedCodeSecurity] | 1540 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPositionRate"), SuppressUnmanagedCodeSecurity] |
1541 | public static extern dReal JointGetSliderPositionRate(IntPtr j); | 1541 | internal static extern dReal JointGetSliderPositionRate(IntPtr j); |
1542 | 1542 | ||
1543 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetType"), SuppressUnmanagedCodeSecurity] | 1543 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetType"), SuppressUnmanagedCodeSecurity] |
1544 | public static extern JointType JointGetType(IntPtr j); | 1544 | internal static extern JointType JointGetType(IntPtr j); |
1545 | 1545 | ||
1546 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor"), SuppressUnmanagedCodeSecurity] | 1546 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor"), SuppressUnmanagedCodeSecurity] |
1547 | public static extern void JointGetUniversalAnchor(IntPtr j, out Vector3 result); | 1547 | internal static extern void JointGetUniversalAnchor(IntPtr j, out Vector3 result); |
1548 | 1548 | ||
1549 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor2"), SuppressUnmanagedCodeSecurity] | 1549 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor2"), SuppressUnmanagedCodeSecurity] |
1550 | public static extern void JointGetUniversalAnchor2(IntPtr j, out Vector3 result); | 1550 | internal static extern void JointGetUniversalAnchor2(IntPtr j, out Vector3 result); |
1551 | 1551 | ||
1552 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1"), SuppressUnmanagedCodeSecurity] | 1552 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1"), SuppressUnmanagedCodeSecurity] |
1553 | public static extern dReal JointGetUniversalAngle1(IntPtr j); | 1553 | internal static extern dReal JointGetUniversalAngle1(IntPtr j); |
1554 | 1554 | ||
1555 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1Rate"), SuppressUnmanagedCodeSecurity] | 1555 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1Rate"), SuppressUnmanagedCodeSecurity] |
1556 | public static extern dReal JointGetUniversalAngle1Rate(IntPtr j); | 1556 | internal static extern dReal JointGetUniversalAngle1Rate(IntPtr j); |
1557 | 1557 | ||
1558 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2"), SuppressUnmanagedCodeSecurity] | 1558 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2"), SuppressUnmanagedCodeSecurity] |
1559 | public static extern dReal JointGetUniversalAngle2(IntPtr j); | 1559 | internal static extern dReal JointGetUniversalAngle2(IntPtr j); |
1560 | 1560 | ||
1561 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2Rate"), SuppressUnmanagedCodeSecurity] | 1561 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2Rate"), SuppressUnmanagedCodeSecurity] |
1562 | public static extern dReal JointGetUniversalAngle2Rate(IntPtr j); | 1562 | internal static extern dReal JointGetUniversalAngle2Rate(IntPtr j); |
1563 | 1563 | ||
1564 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngles"), SuppressUnmanagedCodeSecurity] | 1564 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngles"), SuppressUnmanagedCodeSecurity] |
1565 | public static extern void JointGetUniversalAngles(IntPtr j, out dReal angle1, out dReal angle2); | 1565 | internal static extern void JointGetUniversalAngles(IntPtr j, out dReal angle1, out dReal angle2); |
1566 | 1566 | ||
1567 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis1"), SuppressUnmanagedCodeSecurity] | 1567 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis1"), SuppressUnmanagedCodeSecurity] |
1568 | public static extern void JointGetUniversalAxis1(IntPtr j, out Vector3 result); | 1568 | internal static extern void JointGetUniversalAxis1(IntPtr j, out Vector3 result); |
1569 | 1569 | ||
1570 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis2"), SuppressUnmanagedCodeSecurity] | 1570 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis2"), SuppressUnmanagedCodeSecurity] |
1571 | public static extern void JointGetUniversalAxis2(IntPtr j, out Vector3 result); | 1571 | internal static extern void JointGetUniversalAxis2(IntPtr j, out Vector3 result); |
1572 | 1572 | ||
1573 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalParam"), SuppressUnmanagedCodeSecurity] | 1573 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalParam"), SuppressUnmanagedCodeSecurity] |
1574 | public static extern dReal JointGetUniversalParam(IntPtr j, int parameter); | 1574 | internal static extern dReal JointGetUniversalParam(IntPtr j, int parameter); |
1575 | 1575 | ||
1576 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupCreate"), SuppressUnmanagedCodeSecurity] | 1576 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupCreate"), SuppressUnmanagedCodeSecurity] |
1577 | public static extern IntPtr JointGroupCreate(int max_size); | 1577 | internal static extern IntPtr JointGroupCreate(int max_size); |
1578 | 1578 | ||
1579 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupDestroy"), SuppressUnmanagedCodeSecurity] | 1579 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupDestroy"), SuppressUnmanagedCodeSecurity] |
1580 | public static extern void JointGroupDestroy(IntPtr group); | 1580 | internal static extern void JointGroupDestroy(IntPtr group); |
1581 | 1581 | ||
1582 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupEmpty"), SuppressUnmanagedCodeSecurity] | 1582 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupEmpty"), SuppressUnmanagedCodeSecurity] |
1583 | public static extern void JointGroupEmpty(IntPtr group); | 1583 | internal static extern void JointGroupEmpty(IntPtr group); |
1584 | 1584 | ||
1585 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAngle"), SuppressUnmanagedCodeSecurity] | 1585 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAngle"), SuppressUnmanagedCodeSecurity] |
1586 | public static extern void JointSetAMotorAngle(IntPtr j, int anum, dReal angle); | 1586 | internal static extern void JointSetAMotorAngle(IntPtr j, int anum, dReal angle); |
1587 | 1587 | ||
1588 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAxis"), SuppressUnmanagedCodeSecurity] | 1588 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAxis"), SuppressUnmanagedCodeSecurity] |
1589 | public static extern void JointSetAMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); | 1589 | internal static extern void JointSetAMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); |
1590 | 1590 | ||
1591 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorMode"), SuppressUnmanagedCodeSecurity] | 1591 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorMode"), SuppressUnmanagedCodeSecurity] |
1592 | public static extern void JointSetAMotorMode(IntPtr j, int mode); | 1592 | internal static extern void JointSetAMotorMode(IntPtr j, int mode); |
1593 | 1593 | ||
1594 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] | 1594 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] |
1595 | public static extern void JointSetAMotorNumAxes(IntPtr group, int num); | 1595 | internal static extern void JointSetAMotorNumAxes(IntPtr group, int num); |
1596 | 1596 | ||
1597 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorParam"), SuppressUnmanagedCodeSecurity] | 1597 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorParam"), SuppressUnmanagedCodeSecurity] |
1598 | public static extern void JointSetAMotorParam(IntPtr group, int parameter, dReal value); | 1598 | internal static extern void JointSetAMotorParam(IntPtr group, int parameter, dReal value); |
1599 | 1599 | ||
1600 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor"), SuppressUnmanagedCodeSecurity] | 1600 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor"), SuppressUnmanagedCodeSecurity] |
1601 | public static extern void JointSetBallAnchor(IntPtr j, dReal x, dReal y, dReal z); | 1601 | internal static extern void JointSetBallAnchor(IntPtr j, dReal x, dReal y, dReal z); |
1602 | 1602 | ||
1603 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor2"), SuppressUnmanagedCodeSecurity] | 1603 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor2"), SuppressUnmanagedCodeSecurity] |
1604 | public static extern void JointSetBallAnchor2(IntPtr j, dReal x, dReal y, dReal z); | 1604 | internal static extern void JointSetBallAnchor2(IntPtr j, dReal x, dReal y, dReal z); |
1605 | 1605 | ||
1606 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetData"), SuppressUnmanagedCodeSecurity] | 1606 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetData"), SuppressUnmanagedCodeSecurity] |
1607 | public static extern void JointSetData(IntPtr j, IntPtr data); | 1607 | internal static extern void JointSetData(IntPtr j, IntPtr data); |
1608 | 1608 | ||
1609 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFeedback"), SuppressUnmanagedCodeSecurity] | 1609 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFeedback"), SuppressUnmanagedCodeSecurity] |
1610 | public static extern void JointSetFeedback(IntPtr j, out JointFeedback feedback); | 1610 | internal static extern void JointSetFeedback(IntPtr j, out JointFeedback feedback); |
1611 | 1611 | ||
1612 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFixed"), SuppressUnmanagedCodeSecurity] | 1612 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFixed"), SuppressUnmanagedCodeSecurity] |
1613 | public static extern void JointSetFixed(IntPtr j); | 1613 | internal static extern void JointSetFixed(IntPtr j); |
1614 | 1614 | ||
1615 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchor"), SuppressUnmanagedCodeSecurity] | 1615 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchor"), SuppressUnmanagedCodeSecurity] |
1616 | public static extern void JointSetHingeAnchor(IntPtr j, dReal x, dReal y, dReal z); | 1616 | internal static extern void JointSetHingeAnchor(IntPtr j, dReal x, dReal y, dReal z); |
1617 | 1617 | ||
1618 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchorDelta"), SuppressUnmanagedCodeSecurity] | 1618 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchorDelta"), SuppressUnmanagedCodeSecurity] |
1619 | public static extern void JointSetHingeAnchorDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); | 1619 | internal static extern void JointSetHingeAnchorDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); |
1620 | 1620 | ||
1621 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAxis"), SuppressUnmanagedCodeSecurity] | 1621 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAxis"), SuppressUnmanagedCodeSecurity] |
1622 | public static extern void JointSetHingeAxis(IntPtr j, dReal x, dReal y, dReal z); | 1622 | internal static extern void JointSetHingeAxis(IntPtr j, dReal x, dReal y, dReal z); |
1623 | 1623 | ||
1624 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeParam"), SuppressUnmanagedCodeSecurity] | 1624 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeParam"), SuppressUnmanagedCodeSecurity] |
1625 | public static extern void JointSetHingeParam(IntPtr j, int parameter, dReal value); | 1625 | internal static extern void JointSetHingeParam(IntPtr j, int parameter, dReal value); |
1626 | 1626 | ||
1627 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Anchor"), SuppressUnmanagedCodeSecurity] | 1627 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Anchor"), SuppressUnmanagedCodeSecurity] |
1628 | public static extern void JointSetHinge2Anchor(IntPtr j, dReal x, dReal y, dReal z); | 1628 | internal static extern void JointSetHinge2Anchor(IntPtr j, dReal x, dReal y, dReal z); |
1629 | 1629 | ||
1630 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis1"), SuppressUnmanagedCodeSecurity] | 1630 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis1"), SuppressUnmanagedCodeSecurity] |
1631 | public static extern void JointSetHinge2Axis1(IntPtr j, dReal x, dReal y, dReal z); | 1631 | internal static extern void JointSetHinge2Axis1(IntPtr j, dReal x, dReal y, dReal z); |
1632 | 1632 | ||
1633 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis2"), SuppressUnmanagedCodeSecurity] | 1633 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis2"), SuppressUnmanagedCodeSecurity] |
1634 | public static extern void JointSetHinge2Axis2(IntPtr j, dReal x, dReal y, dReal z); | 1634 | internal static extern void JointSetHinge2Axis2(IntPtr j, dReal x, dReal y, dReal z); |
1635 | 1635 | ||
1636 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Param"), SuppressUnmanagedCodeSecurity] | 1636 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Param"), SuppressUnmanagedCodeSecurity] |
1637 | public static extern void JointSetHinge2Param(IntPtr j, int parameter, dReal value); | 1637 | internal static extern void JointSetHinge2Param(IntPtr j, int parameter, dReal value); |
1638 | 1638 | ||
1639 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorAxis"), SuppressUnmanagedCodeSecurity] | 1639 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorAxis"), SuppressUnmanagedCodeSecurity] |
1640 | public static extern void JointSetLMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); | 1640 | internal static extern void JointSetLMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); |
1641 | 1641 | ||
1642 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] | 1642 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] |
1643 | public static extern void JointSetLMotorNumAxes(IntPtr j, int num); | 1643 | internal static extern void JointSetLMotorNumAxes(IntPtr j, int num); |
1644 | 1644 | ||
1645 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorParam"), SuppressUnmanagedCodeSecurity] | 1645 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorParam"), SuppressUnmanagedCodeSecurity] |
1646 | public static extern void JointSetLMotorParam(IntPtr j, int parameter, dReal value); | 1646 | internal static extern void JointSetLMotorParam(IntPtr j, int parameter, dReal value); |
1647 | 1647 | ||
1648 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DAngleParam"), SuppressUnmanagedCodeSecurity] | 1648 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DAngleParam"), SuppressUnmanagedCodeSecurity] |
1649 | public static extern void JointSetPlane2DAngleParam(IntPtr j, int parameter, dReal value); | 1649 | internal static extern void JointSetPlane2DAngleParam(IntPtr j, int parameter, dReal value); |
1650 | 1650 | ||
1651 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DXParam"), SuppressUnmanagedCodeSecurity] | 1651 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DXParam"), SuppressUnmanagedCodeSecurity] |
1652 | public static extern void JointSetPlane2DXParam(IntPtr j, int parameter, dReal value); | 1652 | internal static extern void JointSetPlane2DXParam(IntPtr j, int parameter, dReal value); |
1653 | 1653 | ||
1654 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DYParam"), SuppressUnmanagedCodeSecurity] | 1654 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DYParam"), SuppressUnmanagedCodeSecurity] |
1655 | public static extern void JointSetPlane2DYParam(IntPtr j, int parameter, dReal value); | 1655 | internal static extern void JointSetPlane2DYParam(IntPtr j, int parameter, dReal value); |
1656 | 1656 | ||
1657 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAnchor"), SuppressUnmanagedCodeSecurity] | 1657 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAnchor"), SuppressUnmanagedCodeSecurity] |
1658 | public static extern void JointSetPRAnchor(IntPtr j, dReal x, dReal y, dReal z); | 1658 | internal static extern void JointSetPRAnchor(IntPtr j, dReal x, dReal y, dReal z); |
1659 | 1659 | ||
1660 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis1"), SuppressUnmanagedCodeSecurity] | 1660 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis1"), SuppressUnmanagedCodeSecurity] |
1661 | public static extern void JointSetPRAxis1(IntPtr j, dReal x, dReal y, dReal z); | 1661 | internal static extern void JointSetPRAxis1(IntPtr j, dReal x, dReal y, dReal z); |
1662 | 1662 | ||
1663 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis2"), SuppressUnmanagedCodeSecurity] | 1663 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis2"), SuppressUnmanagedCodeSecurity] |
1664 | public static extern void JointSetPRAxis2(IntPtr j, dReal x, dReal y, dReal z); | 1664 | internal static extern void JointSetPRAxis2(IntPtr j, dReal x, dReal y, dReal z); |
1665 | 1665 | ||
1666 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRParam"), SuppressUnmanagedCodeSecurity] | 1666 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRParam"), SuppressUnmanagedCodeSecurity] |
1667 | public static extern void JointSetPRParam(IntPtr j, int parameter, dReal value); | 1667 | internal static extern void JointSetPRParam(IntPtr j, int parameter, dReal value); |
1668 | 1668 | ||
1669 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxis"), SuppressUnmanagedCodeSecurity] | 1669 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxis"), SuppressUnmanagedCodeSecurity] |
1670 | public static extern void JointSetSliderAxis(IntPtr j, dReal x, dReal y, dReal z); | 1670 | internal static extern void JointSetSliderAxis(IntPtr j, dReal x, dReal y, dReal z); |
1671 | 1671 | ||
1672 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxisDelta"), SuppressUnmanagedCodeSecurity] | 1672 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxisDelta"), SuppressUnmanagedCodeSecurity] |
1673 | public static extern void JointSetSliderAxisDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); | 1673 | internal static extern void JointSetSliderAxisDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); |
1674 | 1674 | ||
1675 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderParam"), SuppressUnmanagedCodeSecurity] | 1675 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderParam"), SuppressUnmanagedCodeSecurity] |
1676 | public static extern void JointSetSliderParam(IntPtr j, int parameter, dReal value); | 1676 | internal static extern void JointSetSliderParam(IntPtr j, int parameter, dReal value); |
1677 | 1677 | ||
1678 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAnchor"), SuppressUnmanagedCodeSecurity] | 1678 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAnchor"), SuppressUnmanagedCodeSecurity] |
1679 | public static extern void JointSetUniversalAnchor(IntPtr j, dReal x, dReal y, dReal z); | 1679 | internal static extern void JointSetUniversalAnchor(IntPtr j, dReal x, dReal y, dReal z); |
1680 | 1680 | ||
1681 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis1"), SuppressUnmanagedCodeSecurity] | 1681 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis1"), SuppressUnmanagedCodeSecurity] |
1682 | public static extern void JointSetUniversalAxis1(IntPtr j, dReal x, dReal y, dReal z); | 1682 | internal static extern void JointSetUniversalAxis1(IntPtr j, dReal x, dReal y, dReal z); |
1683 | 1683 | ||
1684 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis2"), SuppressUnmanagedCodeSecurity] | 1684 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis2"), SuppressUnmanagedCodeSecurity] |
1685 | public static extern void JointSetUniversalAxis2(IntPtr j, dReal x, dReal y, dReal z); | 1685 | internal static extern void JointSetUniversalAxis2(IntPtr j, dReal x, dReal y, dReal z); |
1686 | 1686 | ||
1687 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalParam"), SuppressUnmanagedCodeSecurity] | 1687 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalParam"), SuppressUnmanagedCodeSecurity] |
1688 | public static extern void JointSetUniversalParam(IntPtr j, int parameter, dReal value); | 1688 | internal static extern void JointSetUniversalParam(IntPtr j, int parameter, dReal value); |
1689 | 1689 | ||
1690 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dLDLTAddTL"), SuppressUnmanagedCodeSecurity] | 1690 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dLDLTAddTL"), SuppressUnmanagedCodeSecurity] |
1691 | public static extern void LDLTAddTL(ref dReal L, ref dReal d, ref dReal a, int n, int nskip); | 1691 | internal static extern void LDLTAddTL(ref dReal L, ref dReal d, ref dReal a, int n, int nskip); |
1692 | 1692 | ||
1693 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdd"), SuppressUnmanagedCodeSecurity] | 1693 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdd"), SuppressUnmanagedCodeSecurity] |
1694 | public static extern void MassAdd(ref Mass a, ref Mass b); | 1694 | internal static extern void MassAdd(ref Mass a, ref Mass b); |
1695 | 1695 | ||
1696 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdjust"), SuppressUnmanagedCodeSecurity] | 1696 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdjust"), SuppressUnmanagedCodeSecurity] |
1697 | public static extern void MassAdjust(ref Mass m, dReal newmass); | 1697 | internal static extern void MassAdjust(ref Mass m, dReal newmass); |
1698 | 1698 | ||
1699 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassCheck"), SuppressUnmanagedCodeSecurity] | 1699 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassCheck"), SuppressUnmanagedCodeSecurity] |
1700 | public static extern bool MassCheck(ref Mass m); | 1700 | internal static extern bool MassCheck(ref Mass m); |
1701 | 1701 | ||
1702 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] | 1702 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] |
1703 | public static extern void MassRotate(ref Mass mass, ref Matrix3 R); | 1703 | internal static extern void MassRotate(ref Mass mass, ref Matrix3 R); |
1704 | 1704 | ||
1705 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] | 1705 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] |
1706 | public static extern void MassRotate(ref Mass mass, ref dReal M00); | 1706 | internal static extern void MassRotate(ref Mass mass, ref dReal M00); |
1707 | 1707 | ||
1708 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBox"), SuppressUnmanagedCodeSecurity] | 1708 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBox"), SuppressUnmanagedCodeSecurity] |
1709 | public static extern void MassSetBox(out Mass mass, dReal density, dReal lx, dReal ly, dReal lz); | 1709 | internal static extern void MassSetBox(out Mass mass, dReal density, dReal lx, dReal ly, dReal lz); |
1710 | 1710 | ||
1711 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBoxTotal"), SuppressUnmanagedCodeSecurity] | 1711 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBoxTotal"), SuppressUnmanagedCodeSecurity] |
1712 | public static extern void MassSetBoxTotal(out Mass mass, dReal total_mass, dReal lx, dReal ly, dReal lz); | 1712 | internal static extern void MassSetBoxTotal(out Mass mass, dReal total_mass, dReal lx, dReal ly, dReal lz); |
1713 | 1713 | ||
1714 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsule"), SuppressUnmanagedCodeSecurity] | 1714 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsule"), SuppressUnmanagedCodeSecurity] |
1715 | public static extern void MassSetCapsule(out Mass mass, dReal density, int direction, dReal radius, dReal length); | 1715 | internal static extern void MassSetCapsule(out Mass mass, dReal density, int direction, dReal radius, dReal length); |
1716 | 1716 | ||
1717 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsuleTotal"), SuppressUnmanagedCodeSecurity] | 1717 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsuleTotal"), SuppressUnmanagedCodeSecurity] |
1718 | public static extern void MassSetCapsuleTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); | 1718 | internal static extern void MassSetCapsuleTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); |
1719 | 1719 | ||
1720 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinder"), SuppressUnmanagedCodeSecurity] | 1720 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinder"), SuppressUnmanagedCodeSecurity] |
1721 | public static extern void MassSetCylinder(out Mass mass, dReal density, int direction, dReal radius, dReal length); | 1721 | internal static extern void MassSetCylinder(out Mass mass, dReal density, int direction, dReal radius, dReal length); |
1722 | 1722 | ||
1723 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinderTotal"), SuppressUnmanagedCodeSecurity] | 1723 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinderTotal"), SuppressUnmanagedCodeSecurity] |
1724 | public static extern void MassSetCylinderTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); | 1724 | internal static extern void MassSetCylinderTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); |
1725 | 1725 | ||
1726 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetParameters"), SuppressUnmanagedCodeSecurity] | 1726 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetParameters"), SuppressUnmanagedCodeSecurity] |
1727 | public static extern void MassSetParameters(out Mass mass, dReal themass, | 1727 | internal static extern void MassSetParameters(out Mass mass, dReal themass, |
1728 | dReal cgx, dReal cgy, dReal cgz, | 1728 | dReal cgx, dReal cgy, dReal cgz, |
1729 | dReal i11, dReal i22, dReal i33, | 1729 | dReal i11, dReal i22, dReal i33, |
1730 | dReal i12, dReal i13, dReal i23); | 1730 | dReal i12, dReal i13, dReal i23); |
1731 | 1731 | ||
1732 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphere"), SuppressUnmanagedCodeSecurity] | 1732 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphere"), SuppressUnmanagedCodeSecurity] |
1733 | public static extern void MassSetSphere(out Mass mass, dReal density, dReal radius); | 1733 | internal static extern void MassSetSphere(out Mass mass, dReal density, dReal radius); |
1734 | 1734 | ||
1735 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphereTotal"), SuppressUnmanagedCodeSecurity] | 1735 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphereTotal"), SuppressUnmanagedCodeSecurity] |
1736 | public static extern void dMassSetSphereTotal(out Mass mass, dReal total_mass, dReal radius); | 1736 | internal static extern void dMassSetSphereTotal(out Mass mass, dReal total_mass, dReal radius); |
1737 | 1737 | ||
1738 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetTrimesh"), SuppressUnmanagedCodeSecurity] | 1738 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetTrimesh"), SuppressUnmanagedCodeSecurity] |
1739 | public static extern void MassSetTrimesh(out Mass mass, dReal density, IntPtr g); | 1739 | internal static extern void MassSetTrimesh(out Mass mass, dReal density, IntPtr g); |
1740 | 1740 | ||
1741 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetZero"), SuppressUnmanagedCodeSecurity] | 1741 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetZero"), SuppressUnmanagedCodeSecurity] |
1742 | public static extern void MassSetZero(out Mass mass); | 1742 | internal static extern void MassSetZero(out Mass mass); |
1743 | 1743 | ||
1744 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassTranslate"), SuppressUnmanagedCodeSecurity] | 1744 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassTranslate"), SuppressUnmanagedCodeSecurity] |
1745 | public static extern void MassTranslate(ref Mass mass, dReal x, dReal y, dReal z); | 1745 | internal static extern void MassTranslate(ref Mass mass, dReal x, dReal y, dReal z); |
1746 | 1746 | ||
1747 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] | 1747 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] |
1748 | public static extern void Multiply0(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); | 1748 | internal static extern void Multiply0(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); |
1749 | 1749 | ||
1750 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] | 1750 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] |
1751 | private static extern void MultiplyiM3V3(out Vector3 vout, ref Matrix3 matrix, ref Vector3 vect,int p, int q, int r); | 1751 | private static extern void MultiplyiM3V3(out Vector3 vout, ref Matrix3 matrix, ref Vector3 vect,int p, int q, int r); |
1752 | public static void MultiplyM3V3(out Vector3 outvector, ref Matrix3 matrix, ref Vector3 invector) | 1752 | internal static void MultiplyM3V3(out Vector3 outvector, ref Matrix3 matrix, ref Vector3 invector) |
1753 | { | 1753 | { |
1754 | MultiplyiM3V3(out outvector, ref matrix, ref invector, 3, 3, 1); | 1754 | MultiplyiM3V3(out outvector, ref matrix, ref invector, 3, 3, 1); |
1755 | } | 1755 | } |
1756 | 1756 | ||
1757 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply1"), SuppressUnmanagedCodeSecurity] | 1757 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply1"), SuppressUnmanagedCodeSecurity] |
1758 | public static extern void Multiply1(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); | 1758 | internal static extern void Multiply1(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); |
1759 | 1759 | ||
1760 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply2"), SuppressUnmanagedCodeSecurity] | 1760 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply2"), SuppressUnmanagedCodeSecurity] |
1761 | public static extern void Multiply2(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); | 1761 | internal static extern void Multiply2(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); |
1762 | 1762 | ||
1763 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] | 1763 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] |
1764 | public static extern void QFromAxisAndAngle(out Quaternion q, dReal ax, dReal ay, dReal az, dReal angle); | 1764 | internal static extern void QFromAxisAndAngle(out Quaternion q, dReal ax, dReal ay, dReal az, dReal angle); |
1765 | 1765 | ||
1766 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQfromR"), SuppressUnmanagedCodeSecurity] | 1766 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQfromR"), SuppressUnmanagedCodeSecurity] |
1767 | public static extern void QfromR(out Quaternion q, ref Matrix3 R); | 1767 | internal static extern void QfromR(out Quaternion q, ref Matrix3 R); |
1768 | 1768 | ||
1769 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply0"), SuppressUnmanagedCodeSecurity] | 1769 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply0"), SuppressUnmanagedCodeSecurity] |
1770 | public static extern void QMultiply0(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | 1770 | internal static extern void QMultiply0(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); |
1771 | 1771 | ||
1772 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply1"), SuppressUnmanagedCodeSecurity] | 1772 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply1"), SuppressUnmanagedCodeSecurity] |
1773 | public static extern void QMultiply1(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | 1773 | internal static extern void QMultiply1(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); |
1774 | 1774 | ||
1775 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply2"), SuppressUnmanagedCodeSecurity] | 1775 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply2"), SuppressUnmanagedCodeSecurity] |
1776 | public static extern void QMultiply2(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | 1776 | internal static extern void QMultiply2(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); |
1777 | 1777 | ||
1778 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply3"), SuppressUnmanagedCodeSecurity] | 1778 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply3"), SuppressUnmanagedCodeSecurity] |
1779 | public static extern void QMultiply3(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | 1779 | internal static extern void QMultiply3(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); |
1780 | 1780 | ||
1781 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQSetIdentity"), SuppressUnmanagedCodeSecurity] | 1781 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQSetIdentity"), SuppressUnmanagedCodeSecurity] |
1782 | public static extern void QSetIdentity(out Quaternion q); | 1782 | internal static extern void QSetIdentity(out Quaternion q); |
1783 | 1783 | ||
1784 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] | 1784 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] |
1785 | public static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref Vector3 center, ref Vector3 extents, int depth); | 1785 | internal static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref Vector3 center, ref Vector3 extents, int depth); |
1786 | 1786 | ||
1787 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] | 1787 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] |
1788 | public static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref dReal centerX, ref dReal extentsX, int depth); | 1788 | internal static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref dReal centerX, ref dReal extentsX, int depth); |
1789 | 1789 | ||
1790 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRandReal"), SuppressUnmanagedCodeSecurity] | 1790 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRandReal"), SuppressUnmanagedCodeSecurity] |
1791 | public static extern dReal RandReal(); | 1791 | internal static extern dReal RandReal(); |
1792 | 1792 | ||
1793 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFrom2Axes"), SuppressUnmanagedCodeSecurity] | 1793 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFrom2Axes"), SuppressUnmanagedCodeSecurity] |
1794 | public static extern void RFrom2Axes(out Matrix3 R, dReal ax, dReal ay, dReal az, dReal bx, dReal by, dReal bz); | 1794 | internal static extern void RFrom2Axes(out Matrix3 R, dReal ax, dReal ay, dReal az, dReal bx, dReal by, dReal bz); |
1795 | 1795 | ||
1796 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] | 1796 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] |
1797 | public static extern void RFromAxisAndAngle(out Matrix3 R, dReal x, dReal y, dReal z, dReal angle); | 1797 | internal static extern void RFromAxisAndAngle(out Matrix3 R, dReal x, dReal y, dReal z, dReal angle); |
1798 | 1798 | ||
1799 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromEulerAngles"), SuppressUnmanagedCodeSecurity] | 1799 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromEulerAngles"), SuppressUnmanagedCodeSecurity] |
1800 | public static extern void RFromEulerAngles(out Matrix3 R, dReal phi, dReal theta, dReal psi); | 1800 | internal static extern void RFromEulerAngles(out Matrix3 R, dReal phi, dReal theta, dReal psi); |
1801 | 1801 | ||
1802 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRfromQ"), SuppressUnmanagedCodeSecurity] | 1802 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRfromQ"), SuppressUnmanagedCodeSecurity] |
1803 | public static extern void RfromQ(out Matrix3 R, ref Quaternion q); | 1803 | internal static extern void RfromQ(out Matrix3 R, ref Quaternion q); |
1804 | 1804 | ||
1805 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromZAxis"), SuppressUnmanagedCodeSecurity] | 1805 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromZAxis"), SuppressUnmanagedCodeSecurity] |
1806 | public static extern void RFromZAxis(out Matrix3 R, dReal ax, dReal ay, dReal az); | 1806 | internal static extern void RFromZAxis(out Matrix3 R, dReal ax, dReal ay, dReal az); |
1807 | 1807 | ||
1808 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRSetIdentity"), SuppressUnmanagedCodeSecurity] | 1808 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRSetIdentity"), SuppressUnmanagedCodeSecurity] |
1809 | public static extern void RSetIdentity(out Matrix3 R); | 1809 | internal static extern void RSetIdentity(out Matrix3 R); |
1810 | 1810 | ||
1811 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetValue"), SuppressUnmanagedCodeSecurity] | 1811 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetValue"), SuppressUnmanagedCodeSecurity] |
1812 | public static extern void SetValue(out dReal a, int n); | 1812 | internal static extern void SetValue(out dReal a, int n); |
1813 | 1813 | ||
1814 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetZero"), SuppressUnmanagedCodeSecurity] | 1814 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetZero"), SuppressUnmanagedCodeSecurity] |
1815 | public static extern void SetZero(out dReal a, int n); | 1815 | internal static extern void SetZero(out dReal a, int n); |
1816 | 1816 | ||
1817 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSimpleSpaceCreate"), SuppressUnmanagedCodeSecurity] | 1817 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSimpleSpaceCreate"), SuppressUnmanagedCodeSecurity] |
1818 | public static extern IntPtr SimpleSpaceCreate(IntPtr space); | 1818 | internal static extern IntPtr SimpleSpaceCreate(IntPtr space); |
1819 | 1819 | ||
1820 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveCholesky"), SuppressUnmanagedCodeSecurity] | 1820 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveCholesky"), SuppressUnmanagedCodeSecurity] |
1821 | public static extern void SolveCholesky(ref dReal L, out dReal b, int n); | 1821 | internal static extern void SolveCholesky(ref dReal L, out dReal b, int n); |
1822 | 1822 | ||
1823 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1"), SuppressUnmanagedCodeSecurity] | 1823 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1"), SuppressUnmanagedCodeSecurity] |
1824 | public static extern void SolveL1(ref dReal L, out dReal b, int n, int nskip); | 1824 | internal static extern void SolveL1(ref dReal L, out dReal b, int n, int nskip); |
1825 | 1825 | ||
1826 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1T"), SuppressUnmanagedCodeSecurity] | 1826 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1T"), SuppressUnmanagedCodeSecurity] |
1827 | public static extern void SolveL1T(ref dReal L, out dReal b, int n, int nskip); | 1827 | internal static extern void SolveL1T(ref dReal L, out dReal b, int n, int nskip); |
1828 | 1828 | ||
1829 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveLDLT"), SuppressUnmanagedCodeSecurity] | 1829 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveLDLT"), SuppressUnmanagedCodeSecurity] |
1830 | public static extern void SolveLDLT(ref dReal L, ref dReal d, out dReal b, int n, int nskip); | 1830 | internal static extern void SolveLDLT(ref dReal L, ref dReal d, out dReal b, int n, int nskip); |
1831 | 1831 | ||
1832 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceAdd"), SuppressUnmanagedCodeSecurity] | 1832 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceAdd"), SuppressUnmanagedCodeSecurity] |
1833 | public static extern void SpaceAdd(IntPtr space, IntPtr geom); | 1833 | internal static extern void SpaceAdd(IntPtr space, IntPtr geom); |
1834 | 1834 | ||
1835 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceLockQuery"), SuppressUnmanagedCodeSecurity] | 1835 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceLockQuery"), SuppressUnmanagedCodeSecurity] |
1836 | public static extern bool SpaceLockQuery(IntPtr space); | 1836 | internal static extern bool SpaceLockQuery(IntPtr space); |
1837 | 1837 | ||
1838 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceClean"), SuppressUnmanagedCodeSecurity] | 1838 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceClean"), SuppressUnmanagedCodeSecurity] |
1839 | public static extern void SpaceClean(IntPtr space); | 1839 | internal static extern void SpaceClean(IntPtr space); |
1840 | 1840 | ||
1841 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide"), SuppressUnmanagedCodeSecurity] | 1841 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide"), SuppressUnmanagedCodeSecurity] |
1842 | public static extern void SpaceCollide(IntPtr space, IntPtr data, NearCallback callback); | 1842 | internal static extern void SpaceCollide(IntPtr space, IntPtr data, NearCallback callback); |
1843 | 1843 | ||
1844 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide2"), SuppressUnmanagedCodeSecurity] | 1844 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide2"), SuppressUnmanagedCodeSecurity] |
1845 | public static extern void SpaceCollide2(IntPtr space1, IntPtr space2, IntPtr data, NearCallback callback); | 1845 | internal static extern void SpaceCollide2(IntPtr space1, IntPtr space2, IntPtr data, NearCallback callback); |
1846 | 1846 | ||
1847 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceDestroy"), SuppressUnmanagedCodeSecurity] | 1847 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceDestroy"), SuppressUnmanagedCodeSecurity] |
1848 | public static extern void SpaceDestroy(IntPtr space); | 1848 | internal static extern void SpaceDestroy(IntPtr space); |
1849 | 1849 | ||
1850 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetCleanup"), SuppressUnmanagedCodeSecurity] | 1850 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetCleanup"), SuppressUnmanagedCodeSecurity] |
1851 | public static extern bool SpaceGetCleanup(IntPtr space); | 1851 | internal static extern bool SpaceGetCleanup(IntPtr space); |
1852 | 1852 | ||
1853 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetNumGeoms"), SuppressUnmanagedCodeSecurity] | 1853 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetNumGeoms"), SuppressUnmanagedCodeSecurity] |
1854 | public static extern int SpaceGetNumGeoms(IntPtr space); | 1854 | internal static extern int SpaceGetNumGeoms(IntPtr space); |
1855 | 1855 | ||
1856 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetGeom"), SuppressUnmanagedCodeSecurity] | 1856 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetGeom"), SuppressUnmanagedCodeSecurity] |
1857 | public static extern IntPtr SpaceGetGeom(IntPtr space, int i); | 1857 | internal static extern IntPtr SpaceGetGeom(IntPtr space, int i); |
1858 | 1858 | ||
1859 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetSublevel"), SuppressUnmanagedCodeSecurity] | 1859 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetSublevel"), SuppressUnmanagedCodeSecurity] |
1860 | public static extern int SpaceGetSublevel(IntPtr space); | 1860 | internal static extern int SpaceGetSublevel(IntPtr space); |
1861 | 1861 | ||
1862 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceQuery"), SuppressUnmanagedCodeSecurity] | 1862 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceQuery"), SuppressUnmanagedCodeSecurity] |
1863 | public static extern bool SpaceQuery(IntPtr space, IntPtr geom); | 1863 | internal static extern bool SpaceQuery(IntPtr space, IntPtr geom); |
1864 | 1864 | ||
1865 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceRemove"), SuppressUnmanagedCodeSecurity] | 1865 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceRemove"), SuppressUnmanagedCodeSecurity] |
1866 | public static extern void SpaceRemove(IntPtr space, IntPtr geom); | 1866 | internal static extern void SpaceRemove(IntPtr space, IntPtr geom); |
1867 | 1867 | ||
1868 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetCleanup"), SuppressUnmanagedCodeSecurity] | 1868 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetCleanup"), SuppressUnmanagedCodeSecurity] |
1869 | public static extern void SpaceSetCleanup(IntPtr space, bool mode); | 1869 | internal static extern void SpaceSetCleanup(IntPtr space, bool mode); |
1870 | 1870 | ||
1871 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetSublevel"), SuppressUnmanagedCodeSecurity] | 1871 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetSublevel"), SuppressUnmanagedCodeSecurity] |
1872 | public static extern void SpaceSetSublevel(IntPtr space, int sublevel); | 1872 | internal static extern void SpaceSetSublevel(IntPtr space, int sublevel); |
1873 | 1873 | ||
1874 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSweepAndPruneSpaceCreate"), SuppressUnmanagedCodeSecurity] | 1874 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSweepAndPruneSpaceCreate"), SuppressUnmanagedCodeSecurity] |
1875 | public static extern IntPtr SweepAndPruneSpaceCreate(IntPtr space, int AxisOrder); | 1875 | internal static extern IntPtr SweepAndPruneSpaceCreate(IntPtr space, int AxisOrder); |
1876 | 1876 | ||
1877 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dVectorScale"), SuppressUnmanagedCodeSecurity] | 1877 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dVectorScale"), SuppressUnmanagedCodeSecurity] |
1878 | public static extern void VectorScale(out dReal a, ref dReal d, int n); | 1878 | internal static extern void VectorScale(out dReal a, ref dReal d, int n); |
1879 | 1879 | ||
1880 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldCreate"), SuppressUnmanagedCodeSecurity] | 1880 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldCreate"), SuppressUnmanagedCodeSecurity] |
1881 | public static extern IntPtr WorldCreate(); | 1881 | internal static extern IntPtr WorldCreate(); |
1882 | 1882 | ||
1883 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldDestroy"), SuppressUnmanagedCodeSecurity] | 1883 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldDestroy"), SuppressUnmanagedCodeSecurity] |
1884 | public static extern void WorldDestroy(IntPtr world); | 1884 | internal static extern void WorldDestroy(IntPtr world); |
1885 | 1885 | ||
1886 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] | 1886 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] |
1887 | public static extern int WorldGetAutoDisableAverageSamplesCount(IntPtr world); | 1887 | internal static extern int WorldGetAutoDisableAverageSamplesCount(IntPtr world); |
1888 | 1888 | ||
1889 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | 1889 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] |
1890 | public static extern dReal WorldGetAutoDisableAngularThreshold(IntPtr world); | 1890 | internal static extern dReal WorldGetAutoDisableAngularThreshold(IntPtr world); |
1891 | 1891 | ||
1892 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | 1892 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] |
1893 | public static extern bool WorldGetAutoDisableFlag(IntPtr world); | 1893 | internal static extern bool WorldGetAutoDisableFlag(IntPtr world); |
1894 | 1894 | ||
1895 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | 1895 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] |
1896 | public static extern dReal WorldGetAutoDisableLinearThreshold(IntPtr world); | 1896 | internal static extern dReal WorldGetAutoDisableLinearThreshold(IntPtr world); |
1897 | 1897 | ||
1898 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | 1898 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] |
1899 | public static extern int WorldGetAutoDisableSteps(IntPtr world); | 1899 | internal static extern int WorldGetAutoDisableSteps(IntPtr world); |
1900 | 1900 | ||
1901 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | 1901 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] |
1902 | public static extern dReal WorldGetAutoDisableTime(IntPtr world); | 1902 | internal static extern dReal WorldGetAutoDisableTime(IntPtr world); |
1903 | 1903 | ||
1904 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] | 1904 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] |
1905 | public static extern int WorldGetAutoEnableDepthSF1(IntPtr world); | 1905 | internal static extern int WorldGetAutoEnableDepthSF1(IntPtr world); |
1906 | 1906 | ||
1907 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetCFM"), SuppressUnmanagedCodeSecurity] | 1907 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetCFM"), SuppressUnmanagedCodeSecurity] |
1908 | public static extern dReal WorldGetCFM(IntPtr world); | 1908 | internal static extern dReal WorldGetCFM(IntPtr world); |
1909 | 1909 | ||
1910 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetERP"), SuppressUnmanagedCodeSecurity] | 1910 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetERP"), SuppressUnmanagedCodeSecurity] |
1911 | public static extern dReal WorldGetERP(IntPtr world); | 1911 | internal static extern dReal WorldGetERP(IntPtr world); |
1912 | 1912 | ||
1913 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] | 1913 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] |
1914 | public static extern void WorldGetGravity(IntPtr world, out Vector3 gravity); | 1914 | internal static extern void WorldGetGravity(IntPtr world, out Vector3 gravity); |
1915 | 1915 | ||
1916 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] | 1916 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] |
1917 | public static extern void WorldGetGravity(IntPtr world, out dReal X); | 1917 | internal static extern void WorldGetGravity(IntPtr world, out dReal X); |
1918 | 1918 | ||
1919 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] | 1919 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] |
1920 | public static extern dReal WorldGetContactMaxCorrectingVel(IntPtr world); | 1920 | internal static extern dReal WorldGetContactMaxCorrectingVel(IntPtr world); |
1921 | 1921 | ||
1922 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] | 1922 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] |
1923 | public static extern dReal WorldGetContactSurfaceLayer(IntPtr world); | 1923 | internal static extern dReal WorldGetContactSurfaceLayer(IntPtr world); |
1924 | 1924 | ||
1925 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDamping"), SuppressUnmanagedCodeSecurity] | 1925 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDamping"), SuppressUnmanagedCodeSecurity] |
1926 | public static extern dReal WorldGetAngularDamping(IntPtr world); | 1926 | internal static extern dReal WorldGetAngularDamping(IntPtr world); |
1927 | 1927 | ||
1928 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] | 1928 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] |
1929 | public static extern dReal WorldGetAngularDampingThreshold(IntPtr world); | 1929 | internal static extern dReal WorldGetAngularDampingThreshold(IntPtr world); |
1930 | 1930 | ||
1931 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDamping"), SuppressUnmanagedCodeSecurity] | 1931 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDamping"), SuppressUnmanagedCodeSecurity] |
1932 | public static extern dReal WorldGetLinearDamping(IntPtr world); | 1932 | internal static extern dReal WorldGetLinearDamping(IntPtr world); |
1933 | 1933 | ||
1934 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] | 1934 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] |
1935 | public static extern dReal WorldGetLinearDampingThreshold(IntPtr world); | 1935 | internal static extern dReal WorldGetLinearDampingThreshold(IntPtr world); |
1936 | 1936 | ||
1937 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] | 1937 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] |
1938 | public static extern int WorldGetQuickStepNumIterations(IntPtr world); | 1938 | internal static extern int WorldGetQuickStepNumIterations(IntPtr world); |
1939 | 1939 | ||
1940 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepW"), SuppressUnmanagedCodeSecurity] | 1940 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepW"), SuppressUnmanagedCodeSecurity] |
1941 | public static extern dReal WorldGetQuickStepW(IntPtr world); | 1941 | internal static extern dReal WorldGetQuickStepW(IntPtr world); |
1942 | 1942 | ||
1943 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] | 1943 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] |
1944 | public static extern dReal WorldGetMaxAngularSpeed(IntPtr world); | 1944 | internal static extern dReal WorldGetMaxAngularSpeed(IntPtr world); |
1945 | 1945 | ||
1946 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] | 1946 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] |
1947 | public static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out Vector3 force); | 1947 | internal static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out Vector3 force); |
1948 | 1948 | ||
1949 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] | 1949 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] |
1950 | public static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out dReal forceX); | 1950 | internal static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out dReal forceX); |
1951 | 1951 | ||
1952 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldQuickStep"), SuppressUnmanagedCodeSecurity] | 1952 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldQuickStep"), SuppressUnmanagedCodeSecurity] |
1953 | public static extern void WorldQuickStep(IntPtr world, dReal stepsize); | 1953 | internal static extern void WorldQuickStep(IntPtr world, dReal stepsize); |
1954 | 1954 | ||
1955 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDamping"), SuppressUnmanagedCodeSecurity] | 1955 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDamping"), SuppressUnmanagedCodeSecurity] |
1956 | public static extern void WorldSetAngularDamping(IntPtr world, dReal scale); | 1956 | internal static extern void WorldSetAngularDamping(IntPtr world, dReal scale); |
1957 | 1957 | ||
1958 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] | 1958 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] |
1959 | public static extern void WorldSetAngularDampingThreshold(IntPtr world, dReal threshold); | 1959 | internal static extern void WorldSetAngularDampingThreshold(IntPtr world, dReal threshold); |
1960 | 1960 | ||
1961 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | 1961 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] |
1962 | public static extern void WorldSetAutoDisableAngularThreshold(IntPtr world, dReal angular_threshold); | 1962 | internal static extern void WorldSetAutoDisableAngularThreshold(IntPtr world, dReal angular_threshold); |
1963 | 1963 | ||
1964 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] | 1964 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] |
1965 | public static extern void WorldSetAutoDisableAverageSamplesCount(IntPtr world, int average_samples_count); | 1965 | internal static extern void WorldSetAutoDisableAverageSamplesCount(IntPtr world, int average_samples_count); |
1966 | 1966 | ||
1967 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | 1967 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] |
1968 | public static extern void WorldSetAutoDisableFlag(IntPtr world, bool do_auto_disable); | 1968 | internal static extern void WorldSetAutoDisableFlag(IntPtr world, bool do_auto_disable); |
1969 | 1969 | ||
1970 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | 1970 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] |
1971 | public static extern void WorldSetAutoDisableLinearThreshold(IntPtr world, dReal linear_threshold); | 1971 | internal static extern void WorldSetAutoDisableLinearThreshold(IntPtr world, dReal linear_threshold); |
1972 | 1972 | ||
1973 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | 1973 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] |
1974 | public static extern void WorldSetAutoDisableSteps(IntPtr world, int steps); | 1974 | internal static extern void WorldSetAutoDisableSteps(IntPtr world, int steps); |
1975 | 1975 | ||
1976 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | 1976 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableTime"), SuppressUnmanagedCodeSecurity] |
1977 | public static extern void WorldSetAutoDisableTime(IntPtr world, dReal time); | 1977 | internal static extern void WorldSetAutoDisableTime(IntPtr world, dReal time); |
1978 | 1978 | ||
1979 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] | 1979 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] |
1980 | public static extern void WorldSetAutoEnableDepthSF1(IntPtr world, int autoEnableDepth); | 1980 | internal static extern void WorldSetAutoEnableDepthSF1(IntPtr world, int autoEnableDepth); |
1981 | 1981 | ||
1982 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetCFM"), SuppressUnmanagedCodeSecurity] | 1982 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetCFM"), SuppressUnmanagedCodeSecurity] |
1983 | public static extern void WorldSetCFM(IntPtr world, dReal cfm); | 1983 | internal static extern void WorldSetCFM(IntPtr world, dReal cfm); |
1984 | 1984 | ||
1985 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] | 1985 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] |
1986 | public static extern void WorldSetContactMaxCorrectingVel(IntPtr world, dReal vel); | 1986 | internal static extern void WorldSetContactMaxCorrectingVel(IntPtr world, dReal vel); |
1987 | 1987 | ||
1988 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] | 1988 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] |
1989 | public static extern void WorldSetContactSurfaceLayer(IntPtr world, dReal depth); | 1989 | internal static extern void WorldSetContactSurfaceLayer(IntPtr world, dReal depth); |
1990 | 1990 | ||
1991 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetDamping"), SuppressUnmanagedCodeSecurity] | 1991 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetDamping"), SuppressUnmanagedCodeSecurity] |
1992 | public static extern void WorldSetDamping(IntPtr world, dReal linear_scale, dReal angular_scale); | 1992 | internal static extern void WorldSetDamping(IntPtr world, dReal linear_scale, dReal angular_scale); |
1993 | 1993 | ||
1994 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetERP"), SuppressUnmanagedCodeSecurity] | 1994 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetERP"), SuppressUnmanagedCodeSecurity] |
1995 | public static extern void WorldSetERP(IntPtr world, dReal erp); | 1995 | internal static extern void WorldSetERP(IntPtr world, dReal erp); |
1996 | 1996 | ||
1997 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetGravity"), SuppressUnmanagedCodeSecurity] | 1997 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetGravity"), SuppressUnmanagedCodeSecurity] |
1998 | public static extern void WorldSetGravity(IntPtr world, dReal x, dReal y, dReal z); | 1998 | internal static extern void WorldSetGravity(IntPtr world, dReal x, dReal y, dReal z); |
1999 | 1999 | ||
2000 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDamping"), SuppressUnmanagedCodeSecurity] | 2000 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDamping"), SuppressUnmanagedCodeSecurity] |
2001 | public static extern void WorldSetLinearDamping(IntPtr world, dReal scale); | 2001 | internal static extern void WorldSetLinearDamping(IntPtr world, dReal scale); |
2002 | 2002 | ||
2003 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] | 2003 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] |
2004 | public static extern void WorldSetLinearDampingThreshold(IntPtr world, dReal threshold); | 2004 | internal static extern void WorldSetLinearDampingThreshold(IntPtr world, dReal threshold); |
2005 | 2005 | ||
2006 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] | 2006 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] |
2007 | public static extern void WorldSetQuickStepNumIterations(IntPtr world, int num); | 2007 | internal static extern void WorldSetQuickStepNumIterations(IntPtr world, int num); |
2008 | 2008 | ||
2009 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepW"), SuppressUnmanagedCodeSecurity] | 2009 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepW"), SuppressUnmanagedCodeSecurity] |
2010 | public static extern void WorldSetQuickStepW(IntPtr world, dReal over_relaxation); | 2010 | internal static extern void WorldSetQuickStepW(IntPtr world, dReal over_relaxation); |
2011 | 2011 | ||
2012 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] | 2012 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] |
2013 | public static extern void WorldSetMaxAngularSpeed(IntPtr world, dReal max_speed); | 2013 | internal static extern void WorldSetMaxAngularSpeed(IntPtr world, dReal max_speed); |
2014 | 2014 | ||
2015 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStep"), SuppressUnmanagedCodeSecurity] | 2015 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStep"), SuppressUnmanagedCodeSecurity] |
2016 | public static extern void WorldStep(IntPtr world, dReal stepsize); | 2016 | internal static extern void WorldStep(IntPtr world, dReal stepsize); |
2017 | 2017 | ||
2018 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStepFast1"), SuppressUnmanagedCodeSecurity] | 2018 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStepFast1"), SuppressUnmanagedCodeSecurity] |
2019 | public static extern void WorldStepFast1(IntPtr world, dReal stepsize, int maxiterations); | 2019 | internal static extern void WorldStepFast1(IntPtr world, dReal stepsize, int maxiterations); |
2020 | |||
2021 | [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldExportDIF"), SuppressUnmanagedCodeSecurity] | ||
2022 | public static extern void WorldExportDIF(IntPtr world, string filename, bool append, string prefix); | ||
2023 | } | 2020 | } |
2024 | } | 2021 | } |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index f111e87..60cc549 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs | |||
@@ -32,7 +32,6 @@ using System; | |||
32 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using OpenMetaverse; | 34 | using OpenMetaverse; |
35 | using OdeAPI; | ||
36 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
37 | using OpenSim.Region.PhysicsModules.SharedBase; | 36 | using OpenSim.Region.PhysicsModules.SharedBase; |
38 | using log4net; | 37 | using log4net; |
@@ -43,7 +42,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
43 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. | 42 | /// Various properties that ODE uses for AMotors but isn't exposed in ODE.NET so we must define them ourselves. |
44 | /// </summary> | 43 | /// </summary> |
45 | 44 | ||
46 | public enum dParam : int | 45 | public enum dParam:int |
47 | { | 46 | { |
48 | LowStop = 0, | 47 | LowStop = 0, |
49 | HiStop = 1, | 48 | HiStop = 1, |
@@ -68,7 +67,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
68 | StopCFM3 = 8 + 512 | 67 | StopCFM3 = 8 + 512 |
69 | } | 68 | } |
70 | 69 | ||
71 | public class OdeCharacter : PhysicsActor | 70 | public class OdeCharacter:PhysicsActor |
72 | { | 71 | { |
73 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 72 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
74 | 73 | ||
@@ -122,7 +121,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
122 | 121 | ||
123 | private bool m_freemove = false; | 122 | private bool m_freemove = false; |
124 | 123 | ||
125 | // private string m_name = String.Empty; | 124 | // private string m_name = String.Empty; |
126 | // other filter control | 125 | // other filter control |
127 | int m_colliderfilter = 0; | 126 | int m_colliderfilter = 0; |
128 | int m_colliderGroundfilter = 0; | 127 | int m_colliderGroundfilter = 0; |
@@ -144,7 +143,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
144 | 143 | ||
145 | public IntPtr Amotor = IntPtr.Zero; | 144 | public IntPtr Amotor = IntPtr.Zero; |
146 | 145 | ||
147 | public d.Mass ShellMass; | 146 | internal SafeNativeMethods.Mass ShellMass; |
148 | 147 | ||
149 | public int m_eventsubscription = 0; | 148 | public int m_eventsubscription = 0; |
150 | private int m_cureventsubscription = 0; | 149 | private int m_cureventsubscription = 0; |
@@ -165,7 +164,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
165 | private float m_targetHoverHeight; | 164 | private float m_targetHoverHeight; |
166 | 165 | ||
167 | 166 | ||
168 | public OdeCharacter(uint localID, String avName, ODEScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor) | 167 | public OdeCharacter(uint localID,String avName,ODEScene parent_scene,Vector3 pos,Vector3 pSize,float pfeetOffset,float density,float walk_divisor,float rundivisor) |
169 | { | 168 | { |
170 | m_uuid = UUID.Random(); | 169 | m_uuid = UUID.Random(); |
171 | m_localID = localID; | 170 | m_localID = localID; |
@@ -174,21 +173,21 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
174 | timeStep = parent_scene.ODE_STEPSIZE; | 173 | timeStep = parent_scene.ODE_STEPSIZE; |
175 | invtimeStep = 1 / timeStep; | 174 | invtimeStep = 1 / timeStep; |
176 | 175 | ||
177 | if (pos.IsFinite()) | 176 | if(pos.IsFinite()) |
178 | { | 177 | { |
179 | if (pos.Z > 99999f) | 178 | if(pos.Z > 99999f) |
180 | { | 179 | { |
181 | pos.Z = parent_scene.GetTerrainHeightAtXY(127, 127) + 5; | 180 | pos.Z = parent_scene.GetTerrainHeightAtXY(127,127) + 5; |
182 | } | 181 | } |
183 | if (pos.Z < -100f) // shouldn't this be 0 ? | 182 | if(pos.Z < -100f) // shouldn't this be 0 ? |
184 | { | 183 | { |
185 | pos.Z = parent_scene.GetTerrainHeightAtXY(127, 127) + 5; | 184 | pos.Z = parent_scene.GetTerrainHeightAtXY(127,127) + 5; |
186 | } | 185 | } |
187 | _position = pos; | 186 | _position = pos; |
188 | } | 187 | } |
189 | else | 188 | else |
190 | { | 189 | { |
191 | _position = new Vector3(((float)m_parent_scene.WorldExtents.X * 0.5f), ((float)m_parent_scene.WorldExtents.Y * 0.5f), parent_scene.GetTerrainHeightAtXY(128f, 128f) + 10f); | 190 | _position = new Vector3(((float)m_parent_scene.WorldExtents.X * 0.5f),((float)m_parent_scene.WorldExtents.Y * 0.5f),parent_scene.GetTerrainHeightAtXY(128f,128f) + 10f); |
192 | m_log.Warn("[PHYSICS]: Got NaN Position on Character Create"); | 191 | m_log.Warn("[PHYSICS]: Got NaN Position on Character Create"); |
193 | } | 192 | } |
194 | 193 | ||
@@ -216,7 +215,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
216 | walkDivisor = walk_divisor; | 215 | walkDivisor = walk_divisor; |
217 | runDivisor = rundivisor; | 216 | runDivisor = rundivisor; |
218 | 217 | ||
219 | m_mass = m_density * m_size.X * m_size.Y * m_size.Z; ; // sure we have a default | 218 | m_mass = m_density * m_size.X * m_size.Y * m_size.Z; |
219 | ; // sure we have a default | ||
220 | 220 | ||
221 | PID_D = basePID_D * m_mass * invtimeStep; | 221 | PID_D = basePID_D * m_mass * invtimeStep; |
222 | PID_P = basePID_P * m_mass * invtimeStep; | 222 | PID_P = basePID_P * m_mass * invtimeStep; |
@@ -225,13 +225,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
225 | 225 | ||
226 | Name = avName; | 226 | Name = avName; |
227 | 227 | ||
228 | AddChange(changes.Add, null); | 228 | AddChange(changes.Add,null); |
229 | } | 229 | } |
230 | 230 | ||
231 | public override int PhysicsActorType | 231 | public override int PhysicsActorType |
232 | { | 232 | { |
233 | get { return (int)ActorTypes.Agent; } | 233 | get |
234 | set { return; } | 234 | { |
235 | return (int)ActorTypes.Agent; | ||
236 | } | ||
237 | set | ||
238 | { | ||
239 | return; | ||
240 | } | ||
235 | } | 241 | } |
236 | 242 | ||
237 | public override void getContactData(ref ContactData cdata) | 243 | public override void getContactData(ref ContactData cdata) |
@@ -241,68 +247,116 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
241 | cdata.softcolide = false; | 247 | cdata.softcolide = false; |
242 | } | 248 | } |
243 | 249 | ||
244 | public override bool Building { get; set; } | 250 | public override bool Building |
251 | { | ||
252 | get; set; | ||
253 | } | ||
245 | 254 | ||
246 | /// <summary> | 255 | /// <summary> |
247 | /// If this is set, the avatar will move faster | 256 | /// If this is set, the avatar will move faster |
248 | /// </summary> | 257 | /// </summary> |
249 | public override bool SetAlwaysRun | 258 | public override bool SetAlwaysRun |
250 | { | 259 | { |
251 | get { return m_alwaysRun; } | 260 | get |
252 | set { m_alwaysRun = value; } | 261 | { |
262 | return m_alwaysRun; | ||
263 | } | ||
264 | set | ||
265 | { | ||
266 | m_alwaysRun = value; | ||
267 | } | ||
253 | } | 268 | } |
254 | 269 | ||
255 | public override uint LocalID | 270 | public override uint LocalID |
256 | { | 271 | { |
257 | get { return m_localID; } | 272 | get |
258 | set { m_localID = value; } | 273 | { |
274 | return m_localID; | ||
275 | } | ||
276 | set | ||
277 | { | ||
278 | m_localID = value; | ||
279 | } | ||
259 | } | 280 | } |
260 | 281 | ||
261 | public override PhysicsActor ParentActor | 282 | public override PhysicsActor ParentActor |
262 | { | 283 | { |
263 | get { return (PhysicsActor)this; } | 284 | get |
285 | { | ||
286 | return (PhysicsActor)this; | ||
287 | } | ||
264 | } | 288 | } |
265 | 289 | ||
266 | public override bool Grabbed | 290 | public override bool Grabbed |
267 | { | 291 | { |
268 | set { return; } | 292 | set |
293 | { | ||
294 | return; | ||
295 | } | ||
269 | } | 296 | } |
270 | 297 | ||
271 | public override bool Selected | 298 | public override bool Selected |
272 | { | 299 | { |
273 | set { return; } | 300 | set |
301 | { | ||
302 | return; | ||
303 | } | ||
274 | } | 304 | } |
275 | 305 | ||
276 | public override float Buoyancy | 306 | public override float Buoyancy |
277 | { | 307 | { |
278 | get { return m_buoyancy; } | 308 | get |
279 | set { m_buoyancy = value; } | 309 | { |
310 | return m_buoyancy; | ||
311 | } | ||
312 | set | ||
313 | { | ||
314 | m_buoyancy = value; | ||
315 | } | ||
280 | } | 316 | } |
281 | 317 | ||
282 | public override bool FloatOnWater | 318 | public override bool FloatOnWater |
283 | { | 319 | { |
284 | set { return; } | 320 | set |
321 | { | ||
322 | return; | ||
323 | } | ||
285 | } | 324 | } |
286 | 325 | ||
287 | public override bool IsPhysical | 326 | public override bool IsPhysical |
288 | { | 327 | { |
289 | get { return m_isPhysical; } | 328 | get |
290 | set { return; } | 329 | { |
330 | return m_isPhysical; | ||
331 | } | ||
332 | set | ||
333 | { | ||
334 | return; | ||
335 | } | ||
291 | } | 336 | } |
292 | 337 | ||
293 | public override bool ThrottleUpdates | 338 | public override bool ThrottleUpdates |
294 | { | 339 | { |
295 | get { return false; } | 340 | get |
296 | set { return; } | 341 | { |
342 | return false; | ||
343 | } | ||
344 | set | ||
345 | { | ||
346 | return; | ||
347 | } | ||
297 | } | 348 | } |
298 | 349 | ||
299 | public override bool Flying | 350 | public override bool Flying |
300 | { | 351 | { |
301 | get { return m_flying; } | 352 | get |
353 | { | ||
354 | return m_flying; | ||
355 | } | ||
302 | set | 356 | set |
303 | { | 357 | { |
304 | m_flying = value; | 358 | m_flying = value; |
305 | // m_log.DebugFormat("[PHYSICS]: Set OdeCharacter Flying to {0}", flying); | 359 | // m_log.DebugFormat("[PHYSICS]: Set OdeCharacter Flying to {0}", flying); |
306 | } | 360 | } |
307 | } | 361 | } |
308 | 362 | ||
@@ -312,23 +366,26 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
312 | /// </summary> | 366 | /// </summary> |
313 | public override bool IsColliding | 367 | public override bool IsColliding |
314 | { | 368 | { |
315 | get { return (m_iscolliding || m_iscollidingGround); } | 369 | get |
370 | { | ||
371 | return (m_iscolliding || m_iscollidingGround); | ||
372 | } | ||
316 | set | 373 | set |
317 | { | 374 | { |
318 | if (value) | 375 | if(value) |
319 | { | 376 | { |
320 | m_colliderfilter += 3; | 377 | m_colliderfilter += 3; |
321 | if (m_colliderfilter > 3) | 378 | if(m_colliderfilter > 3) |
322 | m_colliderfilter = 3; | 379 | m_colliderfilter = 3; |
323 | } | 380 | } |
324 | else | 381 | else |
325 | { | 382 | { |
326 | m_colliderfilter--; | 383 | m_colliderfilter--; |
327 | if (m_colliderfilter < 0) | 384 | if(m_colliderfilter < 0) |
328 | m_colliderfilter = 0; | 385 | m_colliderfilter = 0; |
329 | } | 386 | } |
330 | 387 | ||
331 | if (m_colliderfilter == 0) | 388 | if(m_colliderfilter == 0) |
332 | m_iscolliding = false; | 389 | m_iscolliding = false; |
333 | else | 390 | else |
334 | { | 391 | { |
@@ -344,28 +401,31 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
344 | /// </summary> | 401 | /// </summary> |
345 | public override bool CollidingGround | 402 | public override bool CollidingGround |
346 | { | 403 | { |
347 | get { return m_iscollidingGround; } | 404 | get |
405 | { | ||
406 | return m_iscollidingGround; | ||
407 | } | ||
348 | set | 408 | set |
349 | { | 409 | { |
350 | /* we now control this | 410 | /* we now control this |
351 | if (value) | 411 | if (value) |
352 | { | 412 | { |
353 | m_colliderGroundfilter += 2; | 413 | m_colliderGroundfilter += 2; |
354 | if (m_colliderGroundfilter > 2) | 414 | if (m_colliderGroundfilter > 2) |
355 | m_colliderGroundfilter = 2; | 415 | m_colliderGroundfilter = 2; |
356 | } | 416 | } |
357 | else | 417 | else |
358 | { | 418 | { |
359 | m_colliderGroundfilter--; | 419 | m_colliderGroundfilter--; |
360 | if (m_colliderGroundfilter < 0) | 420 | if (m_colliderGroundfilter < 0) |
361 | m_colliderGroundfilter = 0; | 421 | m_colliderGroundfilter = 0; |
362 | } | 422 | } |
363 | 423 | ||
364 | if (m_colliderGroundfilter == 0) | 424 | if (m_colliderGroundfilter == 0) |
365 | m_iscollidingGround = false; | 425 | m_iscollidingGround = false; |
366 | else | 426 | else |
367 | m_iscollidingGround = true; | 427 | m_iscollidingGround = true; |
368 | */ | 428 | */ |
369 | } | 429 | } |
370 | 430 | ||
371 | } | 431 | } |
@@ -375,31 +435,34 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
375 | /// </summary> | 435 | /// </summary> |
376 | public override bool CollidingObj | 436 | public override bool CollidingObj |
377 | { | 437 | { |
378 | get { return m_iscollidingObj; } | 438 | get |
439 | { | ||
440 | return m_iscollidingObj; | ||
441 | } | ||
379 | set | 442 | set |
380 | { | 443 | { |
381 | // Ubit filter this also | 444 | // Ubit filter this also |
382 | if (value) | 445 | if(value) |
383 | { | 446 | { |
384 | m_colliderObjectfilter += 2; | 447 | m_colliderObjectfilter += 2; |
385 | if (m_colliderObjectfilter > 2) | 448 | if(m_colliderObjectfilter > 2) |
386 | m_colliderObjectfilter = 2; | 449 | m_colliderObjectfilter = 2; |
387 | } | 450 | } |
388 | else | 451 | else |
389 | { | 452 | { |
390 | m_colliderObjectfilter--; | 453 | m_colliderObjectfilter--; |
391 | if (m_colliderObjectfilter < 0) | 454 | if(m_colliderObjectfilter < 0) |
392 | m_colliderObjectfilter = 0; | 455 | m_colliderObjectfilter = 0; |
393 | } | 456 | } |
394 | 457 | ||
395 | if (m_colliderObjectfilter == 0) | 458 | if(m_colliderObjectfilter == 0) |
396 | m_iscollidingObj = false; | 459 | m_iscollidingObj = false; |
397 | else | 460 | else |
398 | m_iscollidingObj = true; | 461 | m_iscollidingObj = true; |
399 | 462 | ||
400 | // m_iscollidingObj = value; | 463 | // m_iscollidingObj = value; |
401 | 464 | ||
402 | if (m_iscollidingObj) | 465 | if(m_iscollidingObj) |
403 | m_pidControllerActive = false; | 466 | m_pidControllerActive = false; |
404 | else | 467 | else |
405 | m_pidControllerActive = true; | 468 | m_pidControllerActive = true; |
@@ -418,7 +481,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
418 | 481 | ||
419 | public override bool Stopped | 482 | public override bool Stopped |
420 | { | 483 | { |
421 | get { return _zeroFlag; } | 484 | get |
485 | { | ||
486 | return _zeroFlag; | ||
487 | } | ||
422 | } | 488 | } |
423 | 489 | ||
424 | /// <summary> | 490 | /// <summary> |
@@ -428,20 +494,23 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
428 | /// </summary> | 494 | /// </summary> |
429 | public override Vector3 Position | 495 | public override Vector3 Position |
430 | { | 496 | { |
431 | get { return _position; } | 497 | get |
498 | { | ||
499 | return _position; | ||
500 | } | ||
432 | set | 501 | set |
433 | { | 502 | { |
434 | if (value.IsFinite()) | 503 | if(value.IsFinite()) |
435 | { | 504 | { |
436 | if (value.Z > 9999999f) | 505 | if(value.Z > 9999999f) |
437 | { | 506 | { |
438 | value.Z = m_parent_scene.GetTerrainHeightAtXY(127, 127) + 5; | 507 | value.Z = m_parent_scene.GetTerrainHeightAtXY(127,127) + 5; |
439 | } | 508 | } |
440 | if (value.Z < -100f) | 509 | if(value.Z < -100f) |
441 | { | 510 | { |
442 | value.Z = m_parent_scene.GetTerrainHeightAtXY(127, 127) + 5; | 511 | value.Z = m_parent_scene.GetTerrainHeightAtXY(127,127) + 5; |
443 | } | 512 | } |
444 | AddChange(changes.Position, value); | 513 | AddChange(changes.Position,value); |
445 | } | 514 | } |
446 | else | 515 | else |
447 | { | 516 | { |
@@ -452,8 +521,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
452 | 521 | ||
453 | public override Vector3 RotationalVelocity | 522 | public override Vector3 RotationalVelocity |
454 | { | 523 | { |
455 | get { return m_rotationalVelocity; } | 524 | get |
456 | set { m_rotationalVelocity = value; } | 525 | { |
526 | return m_rotationalVelocity; | ||
527 | } | ||
528 | set | ||
529 | { | ||
530 | m_rotationalVelocity = value; | ||
531 | } | ||
457 | } | 532 | } |
458 | 533 | ||
459 | /// <summary> | 534 | /// <summary> |
@@ -468,7 +543,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
468 | } | 543 | } |
469 | set | 544 | set |
470 | { | 545 | { |
471 | if (value.IsFinite()) | 546 | if(value.IsFinite()) |
472 | { | 547 | { |
473 | if(value.X <0.01f) | 548 | if(value.X <0.01f) |
474 | value.X = 0.01f; | 549 | value.X = 0.01f; |
@@ -477,7 +552,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
477 | if(value.Z <0.01f) | 552 | if(value.Z <0.01f) |
478 | value.Z = 0.01f; | 553 | value.Z = 0.01f; |
479 | 554 | ||
480 | AddChange(changes.Size, value); | 555 | AddChange(changes.Size,value); |
481 | } | 556 | } |
482 | else | 557 | else |
483 | { | 558 | { |
@@ -486,21 +561,21 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
486 | } | 561 | } |
487 | } | 562 | } |
488 | 563 | ||
489 | public override void setAvatarSize(Vector3 size, float feetOffset) | 564 | public override void setAvatarSize(Vector3 size,float feetOffset) |
490 | { | 565 | { |
491 | if (size.IsFinite()) | 566 | if(size.IsFinite()) |
492 | { | 567 | { |
493 | if (size.X < 0.01f) | 568 | if(size.X < 0.01f) |
494 | size.X = 0.01f; | 569 | size.X = 0.01f; |
495 | if (size.Y < 0.01f) | 570 | if(size.Y < 0.01f) |
496 | size.Y = 0.01f; | 571 | size.Y = 0.01f; |
497 | if (size.Z < 0.01f) | 572 | if(size.Z < 0.01f) |
498 | size.Z = 0.01f; | 573 | size.Z = 0.01f; |
499 | 574 | ||
500 | strAvatarSize st = new strAvatarSize(); | 575 | strAvatarSize st = new strAvatarSize(); |
501 | st.size = size; | 576 | st.size = size; |
502 | st.offset = feetOffset; | 577 | st.offset = feetOffset; |
503 | AddChange(changes.AvatarSize, st); | 578 | AddChange(changes.AvatarSize,st); |
504 | } | 579 | } |
505 | else | 580 | else |
506 | { | 581 | { |
@@ -545,32 +620,44 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
545 | 620 | ||
546 | public override Vector3 Force | 621 | public override Vector3 Force |
547 | { | 622 | { |
548 | get { return _target_velocity; } | 623 | get |
549 | set { return; } | 624 | { |
625 | return _target_velocity; | ||
626 | } | ||
627 | set | ||
628 | { | ||
629 | return; | ||
630 | } | ||
550 | } | 631 | } |
551 | 632 | ||
552 | public override int VehicleType | 633 | public override int VehicleType |
553 | { | 634 | { |
554 | get { return 0; } | 635 | get |
555 | set { return; } | 636 | { |
637 | return 0; | ||
638 | } | ||
639 | set | ||
640 | { | ||
641 | return; | ||
642 | } | ||
556 | } | 643 | } |
557 | 644 | ||
558 | public override void VehicleFloatParam(int param, float value) | 645 | public override void VehicleFloatParam(int param,float value) |
559 | { | 646 | { |
560 | 647 | ||
561 | } | 648 | } |
562 | 649 | ||
563 | public override void VehicleVectorParam(int param, Vector3 value) | 650 | public override void VehicleVectorParam(int param,Vector3 value) |
564 | { | 651 | { |
565 | 652 | ||
566 | } | 653 | } |
567 | 654 | ||
568 | public override void VehicleRotationParam(int param, Quaternion rotation) | 655 | public override void VehicleRotationParam(int param,Quaternion rotation) |
569 | { | 656 | { |
570 | 657 | ||
571 | } | 658 | } |
572 | 659 | ||
573 | public override void VehicleFlags(int param, bool remove) | 660 | public override void VehicleFlags(int param,bool remove) |
574 | { | 661 | { |
575 | 662 | ||
576 | } | 663 | } |
@@ -600,7 +687,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
600 | 687 | ||
601 | public override PrimitiveBaseShape Shape | 688 | public override PrimitiveBaseShape Shape |
602 | { | 689 | { |
603 | set { return; } | 690 | set |
691 | { | ||
692 | return; | ||
693 | } | ||
604 | } | 694 | } |
605 | 695 | ||
606 | public override Vector3 rootVelocity | 696 | public override Vector3 rootVelocity |
@@ -619,9 +709,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
619 | } | 709 | } |
620 | set | 710 | set |
621 | { | 711 | { |
622 | if (value.IsFinite()) | 712 | if(value.IsFinite()) |
623 | { | 713 | { |
624 | AddChange(changes.Velocity, value); | 714 | AddChange(changes.Velocity,value); |
625 | } | 715 | } |
626 | else | 716 | else |
627 | { | 717 | { |
@@ -638,9 +728,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
638 | } | 728 | } |
639 | set | 729 | set |
640 | { | 730 | { |
641 | if (value.IsFinite()) | 731 | if(value.IsFinite()) |
642 | { | 732 | { |
643 | AddChange(changes.TargetVelocity, value); | 733 | AddChange(changes.TargetVelocity,value); |
644 | } | 734 | } |
645 | else | 735 | else |
646 | { | 736 | { |
@@ -651,38 +741,62 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
651 | 741 | ||
652 | public override Vector3 Torque | 742 | public override Vector3 Torque |
653 | { | 743 | { |
654 | get { return Vector3.Zero; } | 744 | get |
655 | set { return; } | 745 | { |
746 | return Vector3.Zero; | ||
747 | } | ||
748 | set | ||
749 | { | ||
750 | return; | ||
751 | } | ||
656 | } | 752 | } |
657 | 753 | ||
658 | public override float CollisionScore | 754 | public override float CollisionScore |
659 | { | 755 | { |
660 | get { return 0f; } | 756 | get |
661 | set { } | 757 | { |
758 | return 0f; | ||
759 | } | ||
760 | set | ||
761 | { | ||
762 | } | ||
662 | } | 763 | } |
663 | 764 | ||
664 | public override bool Kinematic | 765 | public override bool Kinematic |
665 | { | 766 | { |
666 | get { return false; } | 767 | get |
667 | set { } | 768 | { |
769 | return false; | ||
770 | } | ||
771 | set | ||
772 | { | ||
773 | } | ||
668 | } | 774 | } |
669 | 775 | ||
670 | public override Quaternion Orientation | 776 | public override Quaternion Orientation |
671 | { | 777 | { |
672 | get { return m_orientation; } | 778 | get |
779 | { | ||
780 | return m_orientation; | ||
781 | } | ||
673 | set | 782 | set |
674 | { | 783 | { |
675 | // fakeori = value; | 784 | // fakeori = value; |
676 | // givefakeori++; | 785 | // givefakeori++; |
677 | value.Normalize(); | 786 | value.Normalize(); |
678 | AddChange(changes.Orientation, value); | 787 | AddChange(changes.Orientation,value); |
679 | } | 788 | } |
680 | } | 789 | } |
681 | 790 | ||
682 | public override Vector3 Acceleration | 791 | public override Vector3 Acceleration |
683 | { | 792 | { |
684 | get { return _acceleration; } | 793 | get |
685 | set { } | 794 | { |
795 | return _acceleration; | ||
796 | } | ||
797 | set | ||
798 | { | ||
799 | } | ||
686 | } | 800 | } |
687 | 801 | ||
688 | public void SetAcceleration(Vector3 accel) | 802 | public void SetAcceleration(Vector3 accel) |
@@ -696,17 +810,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
696 | /// The PID controller takes this target velocity and tries to make it a reality | 810 | /// The PID controller takes this target velocity and tries to make it a reality |
697 | /// </summary> | 811 | /// </summary> |
698 | /// <param name="force"></param> | 812 | /// <param name="force"></param> |
699 | public override void AddForce(Vector3 force, bool pushforce) | 813 | public override void AddForce(Vector3 force,bool pushforce) |
700 | { | 814 | { |
701 | if (force.IsFinite()) | 815 | if(force.IsFinite()) |
702 | { | 816 | { |
703 | if (pushforce) | 817 | if(pushforce) |
704 | { | 818 | { |
705 | AddChange(changes.Force, force * m_density / (m_parent_scene.ODE_STEPSIZE * 28f)); | 819 | AddChange(changes.Force,force * m_density / (m_parent_scene.ODE_STEPSIZE * 28f)); |
706 | } | 820 | } |
707 | else | 821 | else |
708 | { | 822 | { |
709 | AddChange(changes.TargetVelocity, force); | 823 | AddChange(changes.TargetVelocity,force); |
710 | } | 824 | } |
711 | } | 825 | } |
712 | else | 826 | else |
@@ -716,19 +830,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
716 | //m_lastUpdateSent = false; | 830 | //m_lastUpdateSent = false; |
717 | } | 831 | } |
718 | 832 | ||
719 | public override void AddAngularForce(Vector3 force, bool pushforce) | 833 | public override void AddAngularForce(Vector3 force,bool pushforce) |
720 | { | 834 | { |
721 | 835 | ||
722 | } | 836 | } |
723 | 837 | ||
724 | public override void SetMomentum(Vector3 momentum) | 838 | public override void SetMomentum(Vector3 momentum) |
725 | { | 839 | { |
726 | if (momentum.IsFinite()) | 840 | if(momentum.IsFinite()) |
727 | AddChange(changes.Momentum, momentum); | 841 | AddChange(changes.Momentum,momentum); |
728 | } | 842 | } |
729 | 843 | ||
730 | 844 | ||
731 | private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ) | 845 | private void AvatarGeomAndBodyCreation(float npositionX,float npositionY,float npositionZ) |
732 | { | 846 | { |
733 | // sizes one day should came from visual parameters | 847 | // sizes one day should came from visual parameters |
734 | float sx = m_size.X; | 848 | float sx = m_size.X; |
@@ -739,7 +853,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
739 | boneOff = bot + 0.3f; | 853 | boneOff = bot + 0.3f; |
740 | 854 | ||
741 | float feetsz = sz * 0.45f; | 855 | float feetsz = sz * 0.45f; |
742 | if (feetsz > 0.6f) | 856 | if(feetsz > 0.6f) |
743 | feetsz = 0.6f; | 857 | feetsz = 0.6f; |
744 | 858 | ||
745 | feetOff = bot + feetsz; | 859 | feetOff = bot + feetsz; |
@@ -751,28 +865,28 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
751 | 865 | ||
752 | m_parent_scene.waitForSpaceUnlock(m_parent_scene.CharsSpace); | 866 | m_parent_scene.waitForSpaceUnlock(m_parent_scene.CharsSpace); |
753 | 867 | ||
754 | collider = d.SimpleSpaceCreate(m_parent_scene.CharsSpace); | 868 | collider = SafeNativeMethods.SimpleSpaceCreate(m_parent_scene.CharsSpace); |
755 | d.SpaceSetSublevel(collider, 3); | 869 | SafeNativeMethods.SpaceSetSublevel(collider,3); |
756 | d.SpaceSetCleanup(collider, false); | 870 | SafeNativeMethods.SpaceSetCleanup(collider,false); |
757 | d.GeomSetCategoryBits(collider, (uint)m_collisionCategories); | 871 | SafeNativeMethods.GeomSetCategoryBits(collider,(uint)m_collisionCategories); |
758 | d.GeomSetCollideBits(collider, (uint)m_collisionFlags); | 872 | SafeNativeMethods.GeomSetCollideBits(collider,(uint)m_collisionFlags); |
759 | 873 | ||
760 | float r = m_size.X; | 874 | float r = m_size.X; |
761 | if (m_size.Y > r) | 875 | if(m_size.Y > r) |
762 | r = m_size.Y; | 876 | r = m_size.Y; |
763 | float l = m_size.Z - r; | 877 | float l = m_size.Z - r; |
764 | r *= 0.5f; | 878 | r *= 0.5f; |
765 | 879 | ||
766 | capsule = d.CreateCapsule(collider, r, l); | 880 | capsule = SafeNativeMethods.CreateCapsule(collider,r,l); |
767 | 881 | ||
768 | m_mass = m_density * m_size.X * m_size.Y * m_size.Z; // update mass | 882 | m_mass = m_density * m_size.X * m_size.Y * m_size.Z; // update mass |
769 | 883 | ||
770 | d.MassSetBoxTotal(out ShellMass, m_mass, m_size.X, m_size.Y, m_size.Z); | 884 | SafeNativeMethods.MassSetBoxTotal(out ShellMass,m_mass,m_size.X,m_size.Y,m_size.Z); |
771 | 885 | ||
772 | PID_D = basePID_D * m_mass / m_parent_scene.ODE_STEPSIZE; | 886 | PID_D = basePID_D * m_mass / m_parent_scene.ODE_STEPSIZE; |
773 | PID_P = basePID_P * m_mass / m_parent_scene.ODE_STEPSIZE; | 887 | PID_P = basePID_P * m_mass / m_parent_scene.ODE_STEPSIZE; |
774 | 888 | ||
775 | Body = d.BodyCreate(m_parent_scene.world); | 889 | Body = SafeNativeMethods.BodyCreate(m_parent_scene.world); |
776 | 890 | ||
777 | _zeroFlag = false; | 891 | _zeroFlag = false; |
778 | m_pidControllerActive = true; | 892 | m_pidControllerActive = true; |
@@ -780,53 +894,53 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
780 | 894 | ||
781 | _velocity = Vector3.Zero; | 895 | _velocity = Vector3.Zero; |
782 | 896 | ||
783 | d.BodySetAutoDisableFlag(Body, false); | 897 | SafeNativeMethods.BodySetAutoDisableFlag(Body,false); |
784 | d.BodySetPosition(Body, npositionX, npositionY, npositionZ); | 898 | SafeNativeMethods.BodySetPosition(Body,npositionX,npositionY,npositionZ); |
785 | 899 | ||
786 | _position.X = npositionX; | 900 | _position.X = npositionX; |
787 | _position.Y = npositionY; | 901 | _position.Y = npositionY; |
788 | _position.Z = npositionZ; | 902 | _position.Z = npositionZ; |
789 | 903 | ||
790 | d.BodySetMass(Body, ref ShellMass); | 904 | SafeNativeMethods.BodySetMass(Body,ref ShellMass); |
791 | d.GeomSetBody(capsule, Body); | 905 | SafeNativeMethods.GeomSetBody(capsule,Body); |
792 | 906 | ||
793 | // The purpose of the AMotor here is to keep the avatar's physical | 907 | // The purpose of the AMotor here is to keep the avatar's physical |
794 | // surrogate from rotating while moving | 908 | // surrogate from rotating while moving |
795 | Amotor = d.JointCreateAMotor(m_parent_scene.world, IntPtr.Zero); | 909 | Amotor = SafeNativeMethods.JointCreateAMotor(m_parent_scene.world,IntPtr.Zero); |
796 | d.JointAttach(Amotor, Body, IntPtr.Zero); | 910 | SafeNativeMethods.JointAttach(Amotor,Body,IntPtr.Zero); |
797 | 911 | ||
798 | d.JointSetAMotorMode(Amotor, 0); | 912 | SafeNativeMethods.JointSetAMotorMode(Amotor,0); |
799 | d.JointSetAMotorNumAxes(Amotor, 3); | 913 | SafeNativeMethods.JointSetAMotorNumAxes(Amotor,3); |
800 | d.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); | 914 | SafeNativeMethods.JointSetAMotorAxis(Amotor,0,0,1,0,0); |
801 | d.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); | 915 | SafeNativeMethods.JointSetAMotorAxis(Amotor,1,0,0,1,0); |
802 | d.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); | 916 | SafeNativeMethods.JointSetAMotorAxis(Amotor,2,0,0,0,1); |
803 | 917 | ||
804 | d.JointSetAMotorAngle(Amotor, 0, 0); | 918 | SafeNativeMethods.JointSetAMotorAngle(Amotor,0,0); |
805 | d.JointSetAMotorAngle(Amotor, 1, 0); | 919 | SafeNativeMethods.JointSetAMotorAngle(Amotor,1,0); |
806 | d.JointSetAMotorAngle(Amotor, 2, 0); | 920 | SafeNativeMethods.JointSetAMotorAngle(Amotor,2,0); |
807 | 921 | ||
808 | d.JointSetAMotorParam(Amotor, (int)dParam.StopCFM, 0f); // make it HARD | 922 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.StopCFM,0f); // make it HARD |
809 | d.JointSetAMotorParam(Amotor, (int)dParam.StopCFM2, 0f); | 923 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.StopCFM2,0f); |
810 | d.JointSetAMotorParam(Amotor, (int)dParam.StopCFM3, 0f); | 924 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.StopCFM3,0f); |
811 | d.JointSetAMotorParam(Amotor, (int)dParam.StopERP, 0.8f); | 925 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.StopERP,0.8f); |
812 | d.JointSetAMotorParam(Amotor, (int)dParam.StopERP2, 0.8f); | 926 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.StopERP2,0.8f); |
813 | d.JointSetAMotorParam(Amotor, (int)dParam.StopERP3, 0.8f); | 927 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.StopERP3,0.8f); |
814 | 928 | ||
815 | // These lowstops and high stops are effectively (no wiggle room) | 929 | // These lowstops and high stops are effectively (no wiggle room) |
816 | d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -1e-5f); | 930 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.LowStop,-1e-5f); |
817 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 1e-5f); | 931 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.HiStop,1e-5f); |
818 | d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -1e-5f); | 932 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.LoStop2,-1e-5f); |
819 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 1e-5f); | 933 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.HiStop2,1e-5f); |
820 | d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -1e-5f); | 934 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.LoStop3,-1e-5f); |
821 | d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 1e-5f); | 935 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.HiStop3,1e-5f); |
822 | 936 | ||
823 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.Vel, 0); | 937 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)SafeNativeMethods.JointParam.Vel,0); |
824 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.Vel2, 0); | 938 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)SafeNativeMethods.JointParam.Vel2,0); |
825 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.Vel3, 0); | 939 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)SafeNativeMethods.JointParam.Vel3,0); |
826 | 940 | ||
827 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax, 5e8f); | 941 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.FMax,5e8f); |
828 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax2, 5e8f); | 942 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.FMax2,5e8f); |
829 | d.JointSetAMotorParam(Amotor, (int)dParam.FMax3, 5e8f); | 943 | SafeNativeMethods.JointSetAMotorParam(Amotor,(int)dParam.FMax3,5e8f); |
830 | } | 944 | } |
831 | 945 | ||
832 | /// <summary> | 946 | /// <summary> |
@@ -835,38 +949,38 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
835 | private void AvatarGeomAndBodyDestroy() | 949 | private void AvatarGeomAndBodyDestroy() |
836 | { | 950 | { |
837 | // Kill the Amotor | 951 | // Kill the Amotor |
838 | if (Amotor != IntPtr.Zero) | 952 | if(Amotor != IntPtr.Zero) |
839 | { | 953 | { |
840 | d.JointDestroy(Amotor); | 954 | SafeNativeMethods.JointDestroy(Amotor); |
841 | Amotor = IntPtr.Zero; | 955 | Amotor = IntPtr.Zero; |
842 | } | 956 | } |
843 | 957 | ||
844 | if (Body != IntPtr.Zero) | 958 | if(Body != IntPtr.Zero) |
845 | { | 959 | { |
846 | //kill the body | 960 | //kill the body |
847 | d.BodyDestroy(Body); | 961 | SafeNativeMethods.BodyDestroy(Body); |
848 | Body = IntPtr.Zero; | 962 | Body = IntPtr.Zero; |
849 | } | 963 | } |
850 | 964 | ||
851 | //kill the Geoms | 965 | //kill the Geoms |
852 | if (capsule != IntPtr.Zero) | 966 | if(capsule != IntPtr.Zero) |
853 | { | 967 | { |
854 | m_parent_scene.actor_name_map.Remove(capsule); | 968 | m_parent_scene.actor_name_map.Remove(capsule); |
855 | m_parent_scene.waitForSpaceUnlock(collider); | 969 | m_parent_scene.waitForSpaceUnlock(collider); |
856 | d.GeomDestroy(capsule); | 970 | SafeNativeMethods.GeomDestroy(capsule); |
857 | capsule = IntPtr.Zero; | 971 | capsule = IntPtr.Zero; |
858 | } | 972 | } |
859 | 973 | ||
860 | if (collider != IntPtr.Zero) | 974 | if(collider != IntPtr.Zero) |
861 | { | 975 | { |
862 | d.SpaceDestroy(collider); | 976 | SafeNativeMethods.SpaceDestroy(collider); |
863 | collider = IntPtr.Zero; | 977 | collider = IntPtr.Zero; |
864 | } | 978 | } |
865 | 979 | ||
866 | } | 980 | } |
867 | 981 | ||
868 | //in place 2D rotation around Z assuming rot is normalised and is a rotation around Z | 982 | //in place 2D rotation around Z assuming rot is normalised and is a rotation around Z |
869 | public void RotateXYonZ(ref float x, ref float y, ref Quaternion rot) | 983 | public void RotateXYonZ(ref float x,ref float y,ref Quaternion rot) |
870 | { | 984 | { |
871 | float sin = 2.0f * rot.Z * rot.W; | 985 | float sin = 2.0f * rot.Z * rot.W; |
872 | float cos = rot.W * rot.W - rot.Z * rot.Z; | 986 | float cos = rot.W * rot.W - rot.Z * rot.Z; |
@@ -875,22 +989,22 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
875 | x = tx * cos - y * sin; | 989 | x = tx * cos - y * sin; |
876 | y = tx * sin + y * cos; | 990 | y = tx * sin + y * cos; |
877 | } | 991 | } |
878 | public void RotateXYonZ(ref float x, ref float y, ref float sin, ref float cos) | 992 | public void RotateXYonZ(ref float x,ref float y,ref float sin,ref float cos) |
879 | { | 993 | { |
880 | float tx = x; | 994 | float tx = x; |
881 | x = tx * cos - y * sin; | 995 | x = tx * cos - y * sin; |
882 | y = tx * sin + y * cos; | 996 | y = tx * sin + y * cos; |
883 | } | 997 | } |
884 | public void invRotateXYonZ(ref float x, ref float y, ref float sin, ref float cos) | 998 | public void invRotateXYonZ(ref float x,ref float y,ref float sin,ref float cos) |
885 | { | 999 | { |
886 | float tx = x; | 1000 | float tx = x; |
887 | x = tx * cos + y * sin; | 1001 | x = tx * cos + y * sin; |
888 | y = -tx * sin + y * cos; | 1002 | y = -tx * sin + y * cos; |
889 | } | 1003 | } |
890 | 1004 | ||
891 | public void invRotateXYonZ(ref float x, ref float y, ref Quaternion rot) | 1005 | public void invRotateXYonZ(ref float x,ref float y,ref Quaternion rot) |
892 | { | 1006 | { |
893 | float sin = - 2.0f * rot.Z * rot.W; | 1007 | float sin = -2.0f * rot.Z * rot.W; |
894 | float cos = rot.W * rot.W - rot.Z * rot.Z; | 1008 | float cos = rot.W * rot.W - rot.Z * rot.Z; |
895 | float tx = x; | 1009 | float tx = x; |
896 | 1010 | ||
@@ -898,13 +1012,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
898 | y = tx * sin + y * cos; | 1012 | y = tx * sin + y * cos; |
899 | } | 1013 | } |
900 | 1014 | ||
901 | public bool Collide(IntPtr me, IntPtr other, bool reverse, ref d.ContactGeom contact, | 1015 | internal bool Collide(IntPtr me,IntPtr other,bool reverse,ref SafeNativeMethods.ContactGeom contact, |
902 | ref d.ContactGeom altContact , ref bool useAltcontact, ref bool feetcollision) | 1016 | ref SafeNativeMethods.ContactGeom altContact,ref bool useAltcontact,ref bool feetcollision) |
903 | { | 1017 | { |
904 | feetcollision = false; | 1018 | feetcollision = false; |
905 | useAltcontact = false; | 1019 | useAltcontact = false; |
906 | 1020 | ||
907 | if (me == capsule) | 1021 | if(me == capsule) |
908 | { | 1022 | { |
909 | Vector3 offset; | 1023 | Vector3 offset; |
910 | 1024 | ||
@@ -914,25 +1028,25 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
914 | offset.X = contact.pos.X - _position.X; | 1028 | offset.X = contact.pos.X - _position.X; |
915 | offset.Y = contact.pos.Y - _position.Y; | 1029 | offset.Y = contact.pos.Y - _position.Y; |
916 | 1030 | ||
917 | d.GeomClassID gtype = d.GeomGetClass(other); | 1031 | SafeNativeMethods.GeomClassID gtype = SafeNativeMethods.GeomGetClass(other); |
918 | if (gtype == d.GeomClassID.CapsuleClass) | 1032 | if(gtype == SafeNativeMethods.GeomClassID.CapsuleClass) |
919 | { | 1033 | { |
920 | Vector3 roff = offset * Quaternion.Inverse(m_orientation2D); | 1034 | Vector3 roff = offset * Quaternion.Inverse(m_orientation2D); |
921 | float r = roff.X *roff.X / AvaAvaSizeXsq; | 1035 | float r = roff.X *roff.X / AvaAvaSizeXsq; |
922 | r += (roff.Y * roff.Y) / AvaAvaSizeYsq; | 1036 | r += (roff.Y * roff.Y) / AvaAvaSizeYsq; |
923 | if (r > 1.0f) | 1037 | if(r > 1.0f) |
924 | return false; | 1038 | return false; |
925 | 1039 | ||
926 | float dp = 1.0f -(float)Math.Sqrt((double)r); | 1040 | float dp = 1.0f -(float)Math.Sqrt((double)r); |
927 | if (dp > 0.05f) | 1041 | if(dp > 0.05f) |
928 | dp = 0.05f; | 1042 | dp = 0.05f; |
929 | 1043 | ||
930 | contact.depth = dp; | 1044 | contact.depth = dp; |
931 | 1045 | ||
932 | if (offset.Z < 0) | 1046 | if(offset.Z < 0) |
933 | { | 1047 | { |
934 | feetcollision = true; | 1048 | feetcollision = true; |
935 | if (h < boneOff) | 1049 | if(h < boneOff) |
936 | { | 1050 | { |
937 | m_collideNormal.X = contact.normal.X; | 1051 | m_collideNormal.X = contact.normal.X; |
938 | m_collideNormal.Y = contact.normal.Y; | 1052 | m_collideNormal.Y = contact.normal.Y; |
@@ -943,18 +1057,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
943 | return true; | 1057 | return true; |
944 | } | 1058 | } |
945 | 1059 | ||
946 | if (gtype == d.GeomClassID.SphereClass && d.GeomGetBody(other) != IntPtr.Zero) | 1060 | if(gtype == SafeNativeMethods.GeomClassID.SphereClass && SafeNativeMethods.GeomGetBody(other) != IntPtr.Zero) |
947 | { | 1061 | { |
948 | if(d.GeomSphereGetRadius(other) < 0.5) | 1062 | if(SafeNativeMethods.GeomSphereGetRadius(other) < 0.5) |
949 | return true; | 1063 | return true; |
950 | } | 1064 | } |
951 | 1065 | ||
952 | if (offset.Z > 0 || contact.normal.Z > 0.35f) | 1066 | if(offset.Z > 0 || contact.normal.Z > 0.35f) |
953 | { | 1067 | { |
954 | if (offset.Z <= 0) | 1068 | if(offset.Z <= 0) |
955 | { | 1069 | { |
956 | feetcollision = true; | 1070 | feetcollision = true; |
957 | if (h < boneOff) | 1071 | if(h < boneOff) |
958 | { | 1072 | { |
959 | m_collideNormal.X = contact.normal.X; | 1073 | m_collideNormal.X = contact.normal.X; |
960 | m_collideNormal.Y = contact.normal.Y; | 1074 | m_collideNormal.Y = contact.normal.Y; |
@@ -969,7 +1083,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
969 | return true; | 1083 | return true; |
970 | 1084 | ||
971 | feetcollision = true; | 1085 | feetcollision = true; |
972 | if (h < boneOff) | 1086 | if(h < boneOff) |
973 | { | 1087 | { |
974 | m_collideNormal.X = contact.normal.X; | 1088 | m_collideNormal.X = contact.normal.X; |
975 | m_collideNormal.Y = contact.normal.Y; | 1089 | m_collideNormal.Y = contact.normal.Y; |
@@ -989,18 +1103,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
989 | t = Math.Abs(t); | 1103 | t = Math.Abs(t); |
990 | if(t > 1e-6) | 1104 | if(t > 1e-6) |
991 | { | 1105 | { |
992 | tdp /= t; | 1106 | tdp /= t; |
993 | tdp *= contact.normal.X; | 1107 | tdp *= contact.normal.X; |
994 | } | 1108 | } |
995 | else | 1109 | else |
996 | tdp *= 10; | 1110 | tdp *= 10; |
997 | 1111 | ||
998 | if (tdp > 0.25f) | 1112 | if(tdp > 0.25f) |
999 | tdp = 0.25f; | 1113 | tdp = 0.25f; |
1000 | 1114 | ||
1001 | altContact.depth = tdp; | 1115 | altContact.depth = tdp; |
1002 | 1116 | ||
1003 | if (reverse) | 1117 | if(reverse) |
1004 | { | 1118 | { |
1005 | altContact.normal.X = offset.X; | 1119 | altContact.normal.X = offset.X; |
1006 | altContact.normal.Y = offset.Y; | 1120 | altContact.normal.Y = offset.Y; |
@@ -1024,28 +1138,28 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1024 | /// <param name="timeStep"></param> | 1138 | /// <param name="timeStep"></param> |
1025 | public void Move(List<OdeCharacter> defects) | 1139 | public void Move(List<OdeCharacter> defects) |
1026 | { | 1140 | { |
1027 | if (Body == IntPtr.Zero) | 1141 | if(Body == IntPtr.Zero) |
1028 | return; | 1142 | return; |
1029 | 1143 | ||
1030 | d.Vector3 dtmp = d.BodyGetPosition(Body); | 1144 | SafeNativeMethods.Vector3 dtmp = SafeNativeMethods.BodyGetPosition(Body); |
1031 | Vector3 localpos = new Vector3(dtmp.X, dtmp.Y, dtmp.Z); | 1145 | Vector3 localpos = new Vector3(dtmp.X,dtmp.Y,dtmp.Z); |
1032 | 1146 | ||
1033 | // the Amotor still lets avatar rotation to drift during colisions | 1147 | // the Amotor still lets avatar rotation to drift during colisions |
1034 | // so force it back to identity | 1148 | // so force it back to identity |
1035 | 1149 | ||
1036 | d.Quaternion qtmp; | 1150 | SafeNativeMethods.Quaternion qtmp; |
1037 | qtmp.W = m_orientation2D.W; | 1151 | qtmp.W = m_orientation2D.W; |
1038 | qtmp.X = m_orientation2D.X; | 1152 | qtmp.X = m_orientation2D.X; |
1039 | qtmp.Y = m_orientation2D.Y; | 1153 | qtmp.Y = m_orientation2D.Y; |
1040 | qtmp.Z = m_orientation2D.Z; | 1154 | qtmp.Z = m_orientation2D.Z; |
1041 | d.BodySetQuaternion(Body, ref qtmp); | 1155 | SafeNativeMethods.BodySetQuaternion(Body,ref qtmp); |
1042 | 1156 | ||
1043 | if (m_pidControllerActive == false) | 1157 | if(m_pidControllerActive == false) |
1044 | { | 1158 | { |
1045 | _zeroPosition = localpos; | 1159 | _zeroPosition = localpos; |
1046 | } | 1160 | } |
1047 | 1161 | ||
1048 | if (!localpos.IsFinite()) | 1162 | if(!localpos.IsFinite()) |
1049 | { | 1163 | { |
1050 | m_log.Warn("[PHYSICS]: Avatar Position is non-finite!"); | 1164 | m_log.Warn("[PHYSICS]: Avatar Position is non-finite!"); |
1051 | defects.Add(this); | 1165 | defects.Add(this); |
@@ -1058,44 +1172,44 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1058 | 1172 | ||
1059 | // check outbounds forcing to be in world | 1173 | // check outbounds forcing to be in world |
1060 | bool fixbody = false; | 1174 | bool fixbody = false; |
1061 | if (localpos.X < 0.0f) | 1175 | if(localpos.X < 0.0f) |
1062 | { | 1176 | { |
1063 | fixbody = true; | 1177 | fixbody = true; |
1064 | localpos.X = 0.1f; | 1178 | localpos.X = 0.1f; |
1065 | } | 1179 | } |
1066 | else if (localpos.X > m_parent_scene.WorldExtents.X - 0.1f) | 1180 | else if(localpos.X > m_parent_scene.WorldExtents.X - 0.1f) |
1067 | { | 1181 | { |
1068 | fixbody = true; | 1182 | fixbody = true; |
1069 | localpos.X = m_parent_scene.WorldExtents.X - 0.1f; | 1183 | localpos.X = m_parent_scene.WorldExtents.X - 0.1f; |
1070 | } | 1184 | } |
1071 | if (localpos.Y < 0.0f) | 1185 | if(localpos.Y < 0.0f) |
1072 | { | 1186 | { |
1073 | fixbody = true; | 1187 | fixbody = true; |
1074 | localpos.Y = 0.1f; | 1188 | localpos.Y = 0.1f; |
1075 | } | 1189 | } |
1076 | else if (localpos.Y > m_parent_scene.WorldExtents.Y - 0.1) | 1190 | else if(localpos.Y > m_parent_scene.WorldExtents.Y - 0.1) |
1077 | { | 1191 | { |
1078 | fixbody = true; | 1192 | fixbody = true; |
1079 | localpos.Y = m_parent_scene.WorldExtents.Y - 0.1f; | 1193 | localpos.Y = m_parent_scene.WorldExtents.Y - 0.1f; |
1080 | } | 1194 | } |
1081 | if (fixbody) | 1195 | if(fixbody) |
1082 | { | 1196 | { |
1083 | m_freemove = false; | 1197 | m_freemove = false; |
1084 | d.BodySetPosition(Body, localpos.X, localpos.Y, localpos.Z); | 1198 | SafeNativeMethods.BodySetPosition(Body,localpos.X,localpos.Y,localpos.Z); |
1085 | } | 1199 | } |
1086 | 1200 | ||
1087 | float breakfactor; | 1201 | float breakfactor; |
1088 | 1202 | ||
1089 | Vector3 vec = Vector3.Zero; | 1203 | Vector3 vec = Vector3.Zero; |
1090 | dtmp = d.BodyGetLinearVel(Body); | 1204 | dtmp = SafeNativeMethods.BodyGetLinearVel(Body); |
1091 | Vector3 vel = new Vector3(dtmp.X, dtmp.Y, dtmp.Z); | 1205 | Vector3 vel = new Vector3(dtmp.X,dtmp.Y,dtmp.Z); |
1092 | float velLengthSquared = vel.LengthSquared(); | 1206 | float velLengthSquared = vel.LengthSquared(); |
1093 | 1207 | ||
1094 | Vector3 ctz = _target_velocity; | 1208 | Vector3 ctz = _target_velocity; |
1095 | 1209 | ||
1096 | float movementdivisor = 1f; | 1210 | float movementdivisor = 1f; |
1097 | //Ubit change divisions into multiplications below | 1211 | //Ubit change divisions into multiplications below |
1098 | if (!m_alwaysRun) | 1212 | if(!m_alwaysRun) |
1099 | movementdivisor = 1 / walkDivisor; | 1213 | movementdivisor = 1 / walkDivisor; |
1100 | else | 1214 | else |
1101 | movementdivisor = 1 / runDivisor; | 1215 | movementdivisor = 1 / runDivisor; |
@@ -1106,25 +1220,25 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1106 | //****************************************** | 1220 | //****************************************** |
1107 | // colide with land | 1221 | // colide with land |
1108 | 1222 | ||
1109 | d.AABB aabb; | 1223 | SafeNativeMethods.AABB aabb; |
1110 | // d.GeomGetAABB(feetbox, out aabb); | 1224 | // d.GeomGetAABB(feetbox, out aabb); |
1111 | d.GeomGetAABB(capsule, out aabb); | 1225 | SafeNativeMethods.GeomGetAABB(capsule,out aabb); |
1112 | float chrminZ = aabb.MinZ; // move up a bit | 1226 | float chrminZ = aabb.MinZ; // move up a bit |
1113 | Vector3 posch = localpos; | 1227 | Vector3 posch = localpos; |
1114 | 1228 | ||
1115 | float ftmp; | 1229 | float ftmp; |
1116 | 1230 | ||
1117 | if (m_flying) | 1231 | if(m_flying) |
1118 | { | 1232 | { |
1119 | ftmp = timeStep; | 1233 | ftmp = timeStep; |
1120 | posch.X += vel.X * ftmp; | 1234 | posch.X += vel.X * ftmp; |
1121 | posch.Y += vel.Y * ftmp; | 1235 | posch.Y += vel.Y * ftmp; |
1122 | } | 1236 | } |
1123 | 1237 | ||
1124 | float terrainheight = m_parent_scene.GetTerrainHeightAtXY(posch.X, posch.Y); | 1238 | float terrainheight = m_parent_scene.GetTerrainHeightAtXY(posch.X,posch.Y); |
1125 | if (chrminZ < terrainheight) | 1239 | if(chrminZ < terrainheight) |
1126 | { | 1240 | { |
1127 | if (ctz.Z < 0) | 1241 | if(ctz.Z < 0) |
1128 | ctz.Z = 0; | 1242 | ctz.Z = 0; |
1129 | 1243 | ||
1130 | if(!m_haveLastFallVel) | 1244 | if(!m_haveLastFallVel) |
@@ -1133,12 +1247,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1133 | m_haveLastFallVel = true; | 1247 | m_haveLastFallVel = true; |
1134 | } | 1248 | } |
1135 | 1249 | ||
1136 | Vector3 n = m_parent_scene.GetTerrainNormalAtXY(posch.X, posch.Y); | 1250 | Vector3 n = m_parent_scene.GetTerrainNormalAtXY(posch.X,posch.Y); |
1137 | float depth = terrainheight - chrminZ; | 1251 | float depth = terrainheight - chrminZ; |
1138 | 1252 | ||
1139 | vec.Z = depth * PID_P * 50; | 1253 | vec.Z = depth * PID_P * 50; |
1140 | 1254 | ||
1141 | if (!m_flying) | 1255 | if(!m_flying) |
1142 | { | 1256 | { |
1143 | vec.Z += -vel.Z * PID_D; | 1257 | vec.Z += -vel.Z * PID_D; |
1144 | if(n.Z < 0.4f) | 1258 | if(n.Z < 0.4f) |
@@ -1154,19 +1268,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1154 | n.X = 0f; | 1268 | n.X = 0f; |
1155 | n.Y = 0f; | 1269 | n.Y = 0f; |
1156 | n.Z = 1.0f; | 1270 | n.Z = 1.0f; |
1157 | } | 1271 | } |
1158 | } | 1272 | } |
1159 | } | 1273 | } |
1160 | 1274 | ||
1161 | if (depth < 0.2f) | 1275 | if(depth < 0.2f) |
1162 | { | 1276 | { |
1163 | m_colliderGroundfilter++; | 1277 | m_colliderGroundfilter++; |
1164 | if (m_colliderGroundfilter > 2) | 1278 | if(m_colliderGroundfilter > 2) |
1165 | { | 1279 | { |
1166 | m_iscolliding = true; | 1280 | m_iscolliding = true; |
1167 | m_colliderfilter = 2; | 1281 | m_colliderfilter = 2; |
1168 | 1282 | ||
1169 | if (m_colliderGroundfilter > 10) | 1283 | if(m_colliderGroundfilter > 10) |
1170 | { | 1284 | { |
1171 | m_colliderGroundfilter = 10; | 1285 | m_colliderGroundfilter = 10; |
1172 | m_freemove = false; | 1286 | m_freemove = false; |
@@ -1186,19 +1300,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1186 | contact.SurfaceNormal.X = -n.X; | 1300 | contact.SurfaceNormal.X = -n.X; |
1187 | contact.SurfaceNormal.Y = -n.Y; | 1301 | contact.SurfaceNormal.Y = -n.Y; |
1188 | contact.SurfaceNormal.Z = -n.Z; | 1302 | contact.SurfaceNormal.Z = -n.Z; |
1189 | contact.RelativeSpeed = Vector3.Dot(m_lastFallVel, n); | 1303 | contact.RelativeSpeed = Vector3.Dot(m_lastFallVel,n); |
1190 | contact.CharacterFeet = true; | 1304 | contact.CharacterFeet = true; |
1191 | AddCollisionEvent(0, contact); | 1305 | AddCollisionEvent(0,contact); |
1192 | m_lastFallVel = vel; | 1306 | m_lastFallVel = vel; |
1193 | 1307 | ||
1194 | // vec.Z *= 0.5f; | 1308 | // vec.Z *= 0.5f; |
1195 | } | 1309 | } |
1196 | } | 1310 | } |
1197 | 1311 | ||
1198 | else | 1312 | else |
1199 | { | 1313 | { |
1200 | m_colliderGroundfilter -= 5; | 1314 | m_colliderGroundfilter -= 5; |
1201 | if (m_colliderGroundfilter <= 0) | 1315 | if(m_colliderGroundfilter <= 0) |
1202 | { | 1316 | { |
1203 | m_colliderGroundfilter = 0; | 1317 | m_colliderGroundfilter = 0; |
1204 | m_iscollidingGround = false; | 1318 | m_iscollidingGround = false; |
@@ -1209,7 +1323,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1209 | { | 1323 | { |
1210 | m_haveLastFallVel = false; | 1324 | m_haveLastFallVel = false; |
1211 | m_colliderGroundfilter -= 5; | 1325 | m_colliderGroundfilter -= 5; |
1212 | if (m_colliderGroundfilter <= 0) | 1326 | if(m_colliderGroundfilter <= 0) |
1213 | { | 1327 | { |
1214 | m_colliderGroundfilter = 0; | 1328 | m_colliderGroundfilter = 0; |
1215 | m_iscollidingGround = false; | 1329 | m_iscollidingGround = false; |
@@ -1218,11 +1332,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1218 | 1332 | ||
1219 | bool hoverPIDActive = false; | 1333 | bool hoverPIDActive = false; |
1220 | 1334 | ||
1221 | if (m_useHoverPID && m_PIDHoverTau != 0 && m_PIDHoverHeight != 0) | 1335 | if(m_useHoverPID && m_PIDHoverTau != 0 && m_PIDHoverHeight != 0) |
1222 | { | 1336 | { |
1223 | hoverPIDActive = true; | 1337 | hoverPIDActive = true; |
1224 | 1338 | ||
1225 | switch (m_PIDHoverType) | 1339 | switch(m_PIDHoverType) |
1226 | { | 1340 | { |
1227 | case PIDHoverType.Ground: | 1341 | case PIDHoverType.Ground: |
1228 | m_targetHoverHeight = terrainheight + m_PIDHoverHeight; | 1342 | m_targetHoverHeight = terrainheight + m_PIDHoverHeight; |
@@ -1230,20 +1344,20 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1230 | 1344 | ||
1231 | case PIDHoverType.GroundAndWater: | 1345 | case PIDHoverType.GroundAndWater: |
1232 | float waterHeight = m_parent_scene.GetWaterLevel(); | 1346 | float waterHeight = m_parent_scene.GetWaterLevel(); |
1233 | if (terrainheight > waterHeight) | 1347 | if(terrainheight > waterHeight) |
1234 | m_targetHoverHeight = terrainheight + m_PIDHoverHeight; | 1348 | m_targetHoverHeight = terrainheight + m_PIDHoverHeight; |
1235 | else | 1349 | else |
1236 | m_targetHoverHeight = waterHeight + m_PIDHoverHeight; | 1350 | m_targetHoverHeight = waterHeight + m_PIDHoverHeight; |
1237 | break; | 1351 | break; |
1238 | } // end switch (m_PIDHoverType) | 1352 | } // end switch (m_PIDHoverType) |
1239 | 1353 | ||
1240 | // don't go underground | 1354 | // don't go underground |
1241 | if (m_targetHoverHeight > terrainheight + 0.5f * (aabb.MaxZ - aabb.MinZ)) | 1355 | if(m_targetHoverHeight > terrainheight + 0.5f * (aabb.MaxZ - aabb.MinZ)) |
1242 | { | 1356 | { |
1243 | float fz = (m_targetHoverHeight - localpos.Z); | 1357 | float fz = (m_targetHoverHeight - localpos.Z); |
1244 | 1358 | ||
1245 | // if error is zero, use position control; otherwise, velocity control | 1359 | // if error is zero, use position control; otherwise, velocity control |
1246 | if (Math.Abs(fz) < 0.01f) | 1360 | if(Math.Abs(fz) < 0.01f) |
1247 | { | 1361 | { |
1248 | ctz.Z = 0; | 1362 | ctz.Z = 0; |
1249 | } | 1363 | } |
@@ -1253,9 +1367,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1253 | fz /= m_PIDHoverTau; | 1367 | fz /= m_PIDHoverTau; |
1254 | 1368 | ||
1255 | float tmp = Math.Abs(fz); | 1369 | float tmp = Math.Abs(fz); |
1256 | if (tmp > 50) | 1370 | if(tmp > 50) |
1257 | fz = 50 * Math.Sign(fz); | 1371 | fz = 50 * Math.Sign(fz); |
1258 | else if (tmp < 0.1) | 1372 | else if(tmp < 0.1) |
1259 | fz = 0.1f * Math.Sign(fz); | 1373 | fz = 0.1f * Math.Sign(fz); |
1260 | 1374 | ||
1261 | ctz.Z = fz; | 1375 | ctz.Z = fz; |
@@ -1264,43 +1378,43 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1264 | } | 1378 | } |
1265 | 1379 | ||
1266 | //****************************************** | 1380 | //****************************************** |
1267 | if (!m_iscolliding) | 1381 | if(!m_iscolliding) |
1268 | m_collideNormal.Z = 0; | 1382 | m_collideNormal.Z = 0; |
1269 | 1383 | ||
1270 | bool tviszero = (ctz.X == 0.0f && ctz.Y == 0.0f && ctz.Z == 0.0f); | 1384 | bool tviszero = (ctz.X == 0.0f && ctz.Y == 0.0f && ctz.Z == 0.0f); |
1271 | 1385 | ||
1272 | if (!tviszero) | 1386 | if(!tviszero) |
1273 | { | 1387 | { |
1274 | m_freemove = false; | 1388 | m_freemove = false; |
1275 | 1389 | ||
1276 | // movement relative to surface if moving on it | 1390 | // movement relative to surface if moving on it |
1277 | // dont disturbe vertical movement, ie jumps | 1391 | // dont disturbe vertical movement, ie jumps |
1278 | if (m_iscolliding && !m_flying && ctz.Z == 0 && m_collideNormal.Z > 0.2f && m_collideNormal.Z < 0.94f) | 1392 | if(m_iscolliding && !m_flying && ctz.Z == 0 && m_collideNormal.Z > 0.2f && m_collideNormal.Z < 0.94f) |
1279 | { | 1393 | { |
1280 | float p = ctz.X * m_collideNormal.X + ctz.Y * m_collideNormal.Y; | 1394 | float p = ctz.X * m_collideNormal.X + ctz.Y * m_collideNormal.Y; |
1281 | ctz.X *= (float)Math.Sqrt(1 - m_collideNormal.X * m_collideNormal.X); | 1395 | ctz.X *= (float)Math.Sqrt(1 - m_collideNormal.X * m_collideNormal.X); |
1282 | ctz.Y *= (float)Math.Sqrt(1 - m_collideNormal.Y * m_collideNormal.Y); | 1396 | ctz.Y *= (float)Math.Sqrt(1 - m_collideNormal.Y * m_collideNormal.Y); |
1283 | ctz.Z -= p; | 1397 | ctz.Z -= p; |
1284 | if (ctz.Z < 0) | 1398 | if(ctz.Z < 0) |
1285 | ctz.Z *= 2; | 1399 | ctz.Z *= 2; |
1286 | 1400 | ||
1287 | } | 1401 | } |
1288 | 1402 | ||
1289 | } | 1403 | } |
1290 | 1404 | ||
1291 | if (!m_freemove) | 1405 | if(!m_freemove) |
1292 | { | 1406 | { |
1293 | 1407 | ||
1294 | // if velocity is zero, use position control; otherwise, velocity control | 1408 | // if velocity is zero, use position control; otherwise, velocity control |
1295 | if (tviszero && m_iscolliding && !m_flying) | 1409 | if(tviszero && m_iscolliding && !m_flying) |
1296 | { | 1410 | { |
1297 | // keep track of where we stopped. No more slippin' & slidin' | 1411 | // keep track of where we stopped. No more slippin' & slidin' |
1298 | if (!_zeroFlag) | 1412 | if(!_zeroFlag) |
1299 | { | 1413 | { |
1300 | _zeroFlag = true; | 1414 | _zeroFlag = true; |
1301 | _zeroPosition = localpos; | 1415 | _zeroPosition = localpos; |
1302 | } | 1416 | } |
1303 | if (m_pidControllerActive) | 1417 | if(m_pidControllerActive) |
1304 | { | 1418 | { |
1305 | // We only want to deactivate the PID Controller if we think we want to have our surrogate | 1419 | // We only want to deactivate the PID Controller if we think we want to have our surrogate |
1306 | // react to the physics scene by moving it's position. | 1420 | // react to the physics scene by moving it's position. |
@@ -1313,12 +1427,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1313 | vec.Z += -vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P; | 1427 | vec.Z += -vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P; |
1314 | else | 1428 | else |
1315 | vec.Z += (-vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P) * 0.2f; | 1429 | vec.Z += (-vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P) * 0.2f; |
1316 | /* | 1430 | /* |
1317 | if (flying) | 1431 | if (flying) |
1318 | { | 1432 | { |
1319 | vec.Z += -vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P; | 1433 | vec.Z += -vel.Z * PID_D + (_zeroPosition.Z - localpos.Z) * PID_P; |
1320 | } | 1434 | } |
1321 | */ | 1435 | */ |
1322 | } | 1436 | } |
1323 | //PidStatus = true; | 1437 | //PidStatus = true; |
1324 | } | 1438 | } |
@@ -1327,12 +1441,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1327 | m_pidControllerActive = true; | 1441 | m_pidControllerActive = true; |
1328 | _zeroFlag = false; | 1442 | _zeroFlag = false; |
1329 | 1443 | ||
1330 | if (m_iscolliding) | 1444 | if(m_iscolliding) |
1331 | { | 1445 | { |
1332 | if (!m_flying) | 1446 | if(!m_flying) |
1333 | { | 1447 | { |
1334 | // we are on a surface | 1448 | // we are on a surface |
1335 | if (ctz.Z > 0f) | 1449 | if(ctz.Z > 0f) |
1336 | { | 1450 | { |
1337 | // moving up or JUMPING | 1451 | // moving up or JUMPING |
1338 | vec.Z += (ctz.Z - vel.Z) * PID_D * 2f; | 1452 | vec.Z += (ctz.Z - vel.Z) * PID_D * 2f; |
@@ -1342,9 +1456,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1342 | else | 1456 | else |
1343 | { | 1457 | { |
1344 | // we are moving down on a surface | 1458 | // we are moving down on a surface |
1345 | if (ctz.Z == 0) | 1459 | if(ctz.Z == 0) |
1346 | { | 1460 | { |
1347 | if (vel.Z > 0) | 1461 | if(vel.Z > 0) |
1348 | vec.Z -= vel.Z * PID_D * 2f; | 1462 | vec.Z -= vel.Z * PID_D * 2f; |
1349 | vec.X += (ctz.X - vel.X) * (PID_D); | 1463 | vec.X += (ctz.X - vel.X) * (PID_D); |
1350 | vec.Y += (ctz.Y - vel.Y) * (PID_D); | 1464 | vec.Y += (ctz.Y - vel.Y) * (PID_D); |
@@ -1352,15 +1466,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1352 | // intencionally going down | 1466 | // intencionally going down |
1353 | else | 1467 | else |
1354 | { | 1468 | { |
1355 | if (ctz.Z < vel.Z) | 1469 | if(ctz.Z < vel.Z) |
1356 | vec.Z += (ctz.Z - vel.Z) * PID_D; | 1470 | vec.Z += (ctz.Z - vel.Z) * PID_D; |
1357 | else | 1471 | else |
1358 | { | 1472 | { |
1359 | } | 1473 | } |
1360 | 1474 | ||
1361 | if (Math.Abs(ctz.X) > Math.Abs(vel.X)) | 1475 | if(Math.Abs(ctz.X) > Math.Abs(vel.X)) |
1362 | vec.X += (ctz.X - vel.X) * (PID_D); | 1476 | vec.X += (ctz.X - vel.X) * (PID_D); |
1363 | if (Math.Abs(ctz.Y) > Math.Abs(vel.Y)) | 1477 | if(Math.Abs(ctz.Y) > Math.Abs(vel.Y)) |
1364 | vec.Y += (ctz.Y - vel.Y) * (PID_D); | 1478 | vec.Y += (ctz.Y - vel.Y) * (PID_D); |
1365 | } | 1479 | } |
1366 | } | 1480 | } |
@@ -1377,7 +1491,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1377 | } | 1491 | } |
1378 | else // ie not colliding | 1492 | else // ie not colliding |
1379 | { | 1493 | { |
1380 | if (m_flying || hoverPIDActive) //(!m_iscolliding && flying) | 1494 | if(m_flying || hoverPIDActive) //(!m_iscolliding && flying) |
1381 | { | 1495 | { |
1382 | // we're in mid air suspended | 1496 | // we're in mid air suspended |
1383 | vec.X += (ctz.X - vel.X) * (PID_D); | 1497 | vec.X += (ctz.X - vel.X) * (PID_D); |
@@ -1394,13 +1508,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1394 | vec.X += (ctz.X - vel.X) * PID_D * 0.833f; | 1508 | vec.X += (ctz.X - vel.X) * PID_D * 0.833f; |
1395 | vec.Y += (ctz.Y - vel.Y) * PID_D * 0.833f; | 1509 | vec.Y += (ctz.Y - vel.Y) * PID_D * 0.833f; |
1396 | // hack for breaking on fall | 1510 | // hack for breaking on fall |
1397 | if (ctz.Z == -9999f) | 1511 | if(ctz.Z == -9999f) |
1398 | vec.Z += -vel.Z * PID_D - m_parent_scene.gravityz * m_mass; | 1512 | vec.Z += -vel.Z * PID_D - m_parent_scene.gravityz * m_mass; |
1399 | } | 1513 | } |
1400 | } | 1514 | } |
1401 | } | 1515 | } |
1402 | 1516 | ||
1403 | if (velLengthSquared > 2500.0f) // 50m/s apply breaks | 1517 | if(velLengthSquared > 2500.0f) // 50m/s apply breaks |
1404 | { | 1518 | { |
1405 | breakfactor = 0.16f * m_mass; | 1519 | breakfactor = 0.16f * m_mass; |
1406 | vec.X -= breakfactor * vel.X; | 1520 | vec.X -= breakfactor * vel.X; |
@@ -1413,13 +1527,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1413 | breakfactor = m_mass; | 1527 | breakfactor = m_mass; |
1414 | vec.X -= breakfactor * vel.X; | 1528 | vec.X -= breakfactor * vel.X; |
1415 | vec.Y -= breakfactor * vel.Y; | 1529 | vec.Y -= breakfactor * vel.Y; |
1416 | if (m_flying) | 1530 | if(m_flying) |
1417 | vec.Z -= 0.5f * breakfactor * vel.Z; | 1531 | vec.Z -= 0.5f * breakfactor * vel.Z; |
1418 | else | 1532 | else |
1419 | vec.Z -= .16f* m_mass * vel.Z; | 1533 | vec.Z -= .16f* m_mass * vel.Z; |
1420 | } | 1534 | } |
1421 | 1535 | ||
1422 | if (m_flying || hoverPIDActive) | 1536 | if(m_flying || hoverPIDActive) |
1423 | { | 1537 | { |
1424 | vec.Z -= m_parent_scene.gravityz * m_mass; | 1538 | vec.Z -= m_parent_scene.gravityz * m_mass; |
1425 | 1539 | ||
@@ -1428,18 +1542,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1428 | //Added for auto fly height. Kitto Flora | 1542 | //Added for auto fly height. Kitto Flora |
1429 | float target_altitude = terrainheight + MinimumGroundFlightOffset; | 1543 | float target_altitude = terrainheight + MinimumGroundFlightOffset; |
1430 | 1544 | ||
1431 | if (localpos.Z < target_altitude) | 1545 | if(localpos.Z < target_altitude) |
1432 | { | 1546 | { |
1433 | vec.Z += (target_altitude - localpos.Z) * PID_P * 5.0f; | 1547 | vec.Z += (target_altitude - localpos.Z) * PID_P * 5.0f; |
1434 | } | 1548 | } |
1435 | // end add Kitto Flora | 1549 | // end add Kitto Flora |
1436 | } | 1550 | } |
1437 | } | 1551 | } |
1438 | 1552 | ||
1439 | if (vec.IsFinite()) | 1553 | if(vec.IsFinite()) |
1440 | { | 1554 | { |
1441 | if (vec.X != 0 || vec.Y !=0 || vec.Z !=0) | 1555 | if(vec.X != 0 || vec.Y !=0 || vec.Z !=0) |
1442 | d.BodyAddForce(Body, vec.X, vec.Y, vec.Z); | 1556 | SafeNativeMethods.BodyAddForce(Body,vec.X,vec.Y,vec.Z); |
1443 | } | 1557 | } |
1444 | else | 1558 | else |
1445 | { | 1559 | { |
@@ -1456,7 +1570,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1456 | // _position = localpos; | 1570 | // _position = localpos; |
1457 | _position = localpos; | 1571 | _position = localpos; |
1458 | 1572 | ||
1459 | if (_zeroFlag) | 1573 | if(_zeroFlag) |
1460 | { | 1574 | { |
1461 | _velocity = Vector3.Zero; | 1575 | _velocity = Vector3.Zero; |
1462 | _acceleration = Vector3.Zero; | 1576 | _acceleration = Vector3.Zero; |
@@ -1464,12 +1578,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1464 | } | 1578 | } |
1465 | else | 1579 | else |
1466 | { | 1580 | { |
1467 | Vector3 a =_velocity; // previus velocity | 1581 | Vector3 a = _velocity; // previus velocity |
1468 | SetSmooth(ref _velocity, ref vel, 2); | 1582 | SetSmooth(ref _velocity,ref vel,2); |
1469 | a = (_velocity - a) * invtimeStep; | 1583 | a = (_velocity - a) * invtimeStep; |
1470 | SetSmooth(ref _acceleration, ref a, 2); | 1584 | SetSmooth(ref _acceleration,ref a,2); |
1471 | 1585 | ||
1472 | dtmp = d.BodyGetAngularVel(Body); | 1586 | dtmp = SafeNativeMethods.BodyGetAngularVel(Body); |
1473 | m_rotationalVelocity.X = 0f; | 1587 | m_rotationalVelocity.X = 0f; |
1474 | m_rotationalVelocity.Y = 0f; | 1588 | m_rotationalVelocity.Y = 0f; |
1475 | m_rotationalVelocity.Z = dtmp.Z; | 1589 | m_rotationalVelocity.Z = dtmp.Z; |
@@ -1477,30 +1591,30 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1477 | } | 1591 | } |
1478 | } | 1592 | } |
1479 | 1593 | ||
1480 | public void round(ref Vector3 v, int digits) | 1594 | public void round(ref Vector3 v,int digits) |
1481 | { | 1595 | { |
1482 | v.X = (float)Math.Round(v.X, digits); | 1596 | v.X = (float)Math.Round(v.X,digits); |
1483 | v.Y = (float)Math.Round(v.Y, digits); | 1597 | v.Y = (float)Math.Round(v.Y,digits); |
1484 | v.Z = (float)Math.Round(v.Z, digits); | 1598 | v.Z = (float)Math.Round(v.Z,digits); |
1485 | } | 1599 | } |
1486 | 1600 | ||
1487 | public void SetSmooth(ref Vector3 dst, ref Vector3 value) | 1601 | public void SetSmooth(ref Vector3 dst,ref Vector3 value) |
1488 | { | 1602 | { |
1489 | dst.X = 0.1f * dst.X + 0.9f * value.X; | 1603 | dst.X = 0.1f * dst.X + 0.9f * value.X; |
1490 | dst.Y = 0.1f * dst.Y + 0.9f * value.Y; | 1604 | dst.Y = 0.1f * dst.Y + 0.9f * value.Y; |
1491 | dst.Z = 0.1f * dst.Z + 0.9f * value.Z; | 1605 | dst.Z = 0.1f * dst.Z + 0.9f * value.Z; |
1492 | } | 1606 | } |
1493 | 1607 | ||
1494 | public void SetSmooth(ref Vector3 dst, ref Vector3 value, int rounddigits) | 1608 | public void SetSmooth(ref Vector3 dst,ref Vector3 value,int rounddigits) |
1495 | { | 1609 | { |
1496 | dst.X = 0.4f * dst.X + 0.6f * value.X; | 1610 | dst.X = 0.4f * dst.X + 0.6f * value.X; |
1497 | dst.X = (float)Math.Round(dst.X, rounddigits); | 1611 | dst.X = (float)Math.Round(dst.X,rounddigits); |
1498 | 1612 | ||
1499 | dst.Y = 0.4f * dst.Y + 0.6f * value.Y; | 1613 | dst.Y = 0.4f * dst.Y + 0.6f * value.Y; |
1500 | dst.Y = (float)Math.Round(dst.Y, rounddigits); | 1614 | dst.Y = (float)Math.Round(dst.Y,rounddigits); |
1501 | 1615 | ||
1502 | dst.Z = 0.4f * dst.Z + 0.6f * value.Z; | 1616 | dst.Z = 0.4f * dst.Z + 0.6f * value.Z; |
1503 | dst.Z = (float)Math.Round(dst.Z, rounddigits); | 1617 | dst.Z = (float)Math.Round(dst.Z,rounddigits); |
1504 | } | 1618 | } |
1505 | 1619 | ||
1506 | 1620 | ||
@@ -1515,8 +1629,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1515 | { | 1629 | { |
1516 | return; | 1630 | return; |
1517 | 1631 | ||
1518 | // if (Body == IntPtr.Zero) | 1632 | // if (Body == IntPtr.Zero) |
1519 | // return; | 1633 | // return; |
1520 | 1634 | ||
1521 | } | 1635 | } |
1522 | 1636 | ||
@@ -1525,16 +1639,38 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1525 | /// </summary> | 1639 | /// </summary> |
1526 | public void Destroy() | 1640 | public void Destroy() |
1527 | { | 1641 | { |
1528 | AddChange(changes.Remove, null); | 1642 | AddChange(changes.Remove,null); |
1529 | } | 1643 | } |
1530 | 1644 | ||
1531 | public override void CrossingFailure() | 1645 | public override void CrossingFailure() |
1532 | { | 1646 | { |
1533 | } | 1647 | } |
1534 | 1648 | ||
1535 | public override Vector3 PIDTarget { set { return; } } | 1649 | public override Vector3 PIDTarget |
1536 | public override bool PIDActive {get {return m_pidControllerActive;} set { return; } } | 1650 | { |
1537 | public override float PIDTau { set { return; } } | 1651 | set |
1652 | { | ||
1653 | return; | ||
1654 | } | ||
1655 | } | ||
1656 | public override bool PIDActive | ||
1657 | { | ||
1658 | get | ||
1659 | { | ||
1660 | return m_pidControllerActive; | ||
1661 | } | ||
1662 | set | ||
1663 | { | ||
1664 | return; | ||
1665 | } | ||
1666 | } | ||
1667 | public override float PIDTau | ||
1668 | { | ||
1669 | set | ||
1670 | { | ||
1671 | return; | ||
1672 | } | ||
1673 | } | ||
1538 | 1674 | ||
1539 | public override float PIDHoverHeight | 1675 | public override float PIDHoverHeight |
1540 | { | 1676 | { |
@@ -1547,11 +1683,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1547 | { | 1683 | { |
1548 | get | 1684 | get |
1549 | { | 1685 | { |
1550 | return m_useHoverPID; | 1686 | return m_useHoverPID; |
1551 | } | 1687 | } |
1552 | set | 1688 | set |
1553 | { | 1689 | { |
1554 | AddChange(changes.PIDHoverActive, value); | 1690 | AddChange(changes.PIDHoverActive,value); |
1555 | } | 1691 | } |
1556 | } | 1692 | } |
1557 | 1693 | ||
@@ -1567,26 +1703,50 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1567 | { | 1703 | { |
1568 | set | 1704 | set |
1569 | { | 1705 | { |
1570 | float tmp =0; | 1706 | float tmp = 0; |
1571 | if (value > 0) | 1707 | if(value > 0) |
1572 | { | 1708 | { |
1573 | float mint = (0.05f > timeStep ? 0.05f : timeStep); | 1709 | float mint = (0.05f > timeStep ? 0.05f : timeStep); |
1574 | if (value < mint) | 1710 | if(value < mint) |
1575 | tmp = mint; | 1711 | tmp = mint; |
1576 | else | 1712 | else |
1577 | tmp = value; | 1713 | tmp = value; |
1578 | } | 1714 | } |
1579 | AddChange(changes.PIDHoverTau, tmp); | 1715 | AddChange(changes.PIDHoverTau,tmp); |
1580 | } | 1716 | } |
1581 | } | 1717 | } |
1582 | 1718 | ||
1583 | public override Quaternion APIDTarget { set { return; } } | 1719 | public override Quaternion APIDTarget |
1720 | { | ||
1721 | set | ||
1722 | { | ||
1723 | return; | ||
1724 | } | ||
1725 | } | ||
1584 | 1726 | ||
1585 | public override bool APIDActive { set { return; } } | 1727 | public override bool APIDActive |
1728 | { | ||
1729 | set | ||
1730 | { | ||
1731 | return; | ||
1732 | } | ||
1733 | } | ||
1586 | 1734 | ||
1587 | public override float APIDStrength { set { return; } } | 1735 | public override float APIDStrength |
1736 | { | ||
1737 | set | ||
1738 | { | ||
1739 | return; | ||
1740 | } | ||
1741 | } | ||
1588 | 1742 | ||
1589 | public override float APIDDamping { set { return; } } | 1743 | public override float APIDDamping |
1744 | { | ||
1745 | set | ||
1746 | { | ||
1747 | return; | ||
1748 | } | ||
1749 | } | ||
1590 | 1750 | ||
1591 | public override void SubscribeEvents(int ms) | 1751 | public override void SubscribeEvents(int ms) |
1592 | { | 1752 | { |
@@ -1604,34 +1764,34 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1604 | CollisionEventsThisFrame.Clear(); | 1764 | CollisionEventsThisFrame.Clear(); |
1605 | } | 1765 | } |
1606 | 1766 | ||
1607 | public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact) | 1767 | public override void AddCollisionEvent(uint CollidedWith,ContactPoint contact) |
1608 | { | 1768 | { |
1609 | lock(CollisionEventsThisFrame) | 1769 | lock(CollisionEventsThisFrame) |
1610 | CollisionEventsThisFrame.AddCollider(CollidedWith, contact); | 1770 | CollisionEventsThisFrame.AddCollider(CollidedWith,contact); |
1611 | m_parent_scene.AddCollisionEventReporting(this); | 1771 | m_parent_scene.AddCollisionEventReporting(this); |
1612 | } | 1772 | } |
1613 | 1773 | ||
1614 | public void SendCollisions(int timestep) | 1774 | public void SendCollisions(int timestep) |
1615 | { | 1775 | { |
1616 | if (m_cureventsubscription < 50000) | 1776 | if(m_cureventsubscription < 50000) |
1617 | m_cureventsubscription += timestep; | 1777 | m_cureventsubscription += timestep; |
1618 | 1778 | ||
1619 | if (m_cureventsubscription < m_eventsubscription) | 1779 | if(m_cureventsubscription < m_eventsubscription) |
1620 | return; | 1780 | return; |
1621 | 1781 | ||
1622 | lock(CollisionEventsThisFrame) | 1782 | lock(CollisionEventsThisFrame) |
1623 | { | 1783 | { |
1624 | int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; | 1784 | int ncolisions = CollisionEventsThisFrame.m_objCollisionList.Count; |
1625 | 1785 | ||
1626 | if (!SentEmptyCollisionsEvent || ncolisions > 0) | 1786 | if(!SentEmptyCollisionsEvent || ncolisions > 0) |
1627 | { | 1787 | { |
1628 | base.SendCollisionUpdate(CollisionEventsThisFrame); | 1788 | base.SendCollisionUpdate(CollisionEventsThisFrame); |
1629 | m_cureventsubscription = 0; | 1789 | m_cureventsubscription = 0; |
1630 | 1790 | ||
1631 | if (ncolisions == 0) | 1791 | if(ncolisions == 0) |
1632 | { | 1792 | { |
1633 | SentEmptyCollisionsEvent = true; | 1793 | SentEmptyCollisionsEvent = true; |
1634 | // _parent_scene.RemoveCollisionEventReporting(this); | 1794 | // _parent_scene.RemoveCollisionEventReporting(this); |
1635 | } | 1795 | } |
1636 | else | 1796 | else |
1637 | { | 1797 | { |
@@ -1644,20 +1804,20 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1644 | 1804 | ||
1645 | public override bool SubscribedEvents() | 1805 | public override bool SubscribedEvents() |
1646 | { | 1806 | { |
1647 | if (m_eventsubscription > 0) | 1807 | if(m_eventsubscription > 0) |
1648 | return true; | 1808 | return true; |
1649 | return false; | 1809 | return false; |
1650 | } | 1810 | } |
1651 | 1811 | ||
1652 | private void changePhysicsStatus(bool NewStatus) | 1812 | private void changePhysicsStatus(bool NewStatus) |
1653 | { | 1813 | { |
1654 | if (NewStatus != m_isPhysical) | 1814 | if(NewStatus != m_isPhysical) |
1655 | { | 1815 | { |
1656 | if (NewStatus) | 1816 | if(NewStatus) |
1657 | { | 1817 | { |
1658 | AvatarGeomAndBodyDestroy(); | 1818 | AvatarGeomAndBodyDestroy(); |
1659 | 1819 | ||
1660 | AvatarGeomAndBodyCreation(_position.X, _position.Y, _position.Z); | 1820 | AvatarGeomAndBodyCreation(_position.X,_position.Y,_position.Z); |
1661 | 1821 | ||
1662 | m_parent_scene.actor_name_map[collider] = (PhysicsActor)this; | 1822 | m_parent_scene.actor_name_map[collider] = (PhysicsActor)this; |
1663 | m_parent_scene.actor_name_map[capsule] = (PhysicsActor)this; | 1823 | m_parent_scene.actor_name_map[capsule] = (PhysicsActor)this; |
@@ -1697,20 +1857,20 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1697 | 1857 | ||
1698 | private void changeSize(Vector3 pSize) | 1858 | private void changeSize(Vector3 pSize) |
1699 | { | 1859 | { |
1700 | if (pSize.IsFinite()) | 1860 | if(pSize.IsFinite()) |
1701 | { | 1861 | { |
1702 | // for now only look to Z changes since viewers also don't change X and Y | 1862 | // for now only look to Z changes since viewers also don't change X and Y |
1703 | if (pSize.Z != m_size.Z) | 1863 | if(pSize.Z != m_size.Z) |
1704 | { | 1864 | { |
1705 | AvatarGeomAndBodyDestroy(); | 1865 | AvatarGeomAndBodyDestroy(); |
1706 | 1866 | ||
1707 | float oldsz = m_size.Z; | 1867 | float oldsz = m_size.Z; |
1708 | m_size = pSize; | 1868 | m_size = pSize; |
1709 | 1869 | ||
1710 | AvatarGeomAndBodyCreation(_position.X, _position.Y, | 1870 | AvatarGeomAndBodyCreation(_position.X,_position.Y, |
1711 | _position.Z + (m_size.Z - oldsz) * 0.5f); | 1871 | _position.Z + (m_size.Z - oldsz) * 0.5f); |
1712 | 1872 | ||
1713 | // Velocity = Vector3.Zero; | 1873 | // Velocity = Vector3.Zero; |
1714 | m_targetVelocity = Vector3.Zero; | 1874 | m_targetVelocity = Vector3.Zero; |
1715 | 1875 | ||
1716 | m_parent_scene.actor_name_map[collider] = (PhysicsActor)this; | 1876 | m_parent_scene.actor_name_map[collider] = (PhysicsActor)this; |
@@ -1725,18 +1885,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1725 | } | 1885 | } |
1726 | } | 1886 | } |
1727 | 1887 | ||
1728 | private void changePosition( Vector3 newPos) | 1888 | private void changePosition(Vector3 newPos) |
1729 | { | 1889 | { |
1730 | if (Body != IntPtr.Zero) | 1890 | if(Body != IntPtr.Zero) |
1731 | d.BodySetPosition(Body, newPos.X, newPos.Y, newPos.Z); | 1891 | SafeNativeMethods.BodySetPosition(Body,newPos.X,newPos.Y,newPos.Z); |
1732 | _position = newPos; | 1892 | _position = newPos; |
1733 | m_freemove = false; | 1893 | m_freemove = false; |
1734 | m_pidControllerActive = true; | 1894 | m_pidControllerActive = true; |
1735 | } | 1895 | } |
1736 | 1896 | ||
1737 | private void changeOrientation(Quaternion newOri) | 1897 | private void changeOrientation(Quaternion newOri) |
1738 | { | 1898 | { |
1739 | if (m_orientation != newOri) | 1899 | if(m_orientation != newOri) |
1740 | { | 1900 | { |
1741 | m_orientation = newOri; // keep a copy for core use | 1901 | m_orientation = newOri; // keep a copy for core use |
1742 | // but only use rotations around Z | 1902 | // but only use rotations around Z |
@@ -1745,7 +1905,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1745 | m_orientation2D.Z = newOri.Z; | 1905 | m_orientation2D.Z = newOri.Z; |
1746 | 1906 | ||
1747 | float t = m_orientation2D.W * m_orientation2D.W + m_orientation2D.Z * m_orientation2D.Z; | 1907 | float t = m_orientation2D.W * m_orientation2D.W + m_orientation2D.Z * m_orientation2D.Z; |
1748 | if (t > 0) | 1908 | if(t > 0) |
1749 | { | 1909 | { |
1750 | t = 1.0f / (float)Math.Sqrt(t); | 1910 | t = 1.0f / (float)Math.Sqrt(t); |
1751 | m_orientation2D.W *= t; | 1911 | m_orientation2D.W *= t; |
@@ -1759,12 +1919,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1759 | m_orientation2D.Y = 0f; | 1919 | m_orientation2D.Y = 0f; |
1760 | m_orientation2D.X = 0f; | 1920 | m_orientation2D.X = 0f; |
1761 | 1921 | ||
1762 | d.Quaternion myrot = new d.Quaternion(); | 1922 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
1763 | myrot.X = m_orientation2D.X; | 1923 | myrot.X = m_orientation2D.X; |
1764 | myrot.Y = m_orientation2D.Y; | 1924 | myrot.Y = m_orientation2D.Y; |
1765 | myrot.Z = m_orientation2D.Z; | 1925 | myrot.Z = m_orientation2D.Z; |
1766 | myrot.W = m_orientation2D.W; | 1926 | myrot.W = m_orientation2D.W; |
1767 | d.BodySetQuaternion(Body, ref myrot); | 1927 | SafeNativeMethods.BodySetQuaternion(Body,ref myrot); |
1768 | } | 1928 | } |
1769 | } | 1929 | } |
1770 | 1930 | ||
@@ -1773,8 +1933,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1773 | _velocity = newVel; | 1933 | _velocity = newVel; |
1774 | setFreeMove(); | 1934 | setFreeMove(); |
1775 | 1935 | ||
1776 | if (Body != IntPtr.Zero) | 1936 | if(Body != IntPtr.Zero) |
1777 | d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); | 1937 | SafeNativeMethods.BodySetLinearVel(Body,newVel.X,newVel.Y,newVel.Z); |
1778 | } | 1938 | } |
1779 | 1939 | ||
1780 | private void changeTargetVelocity(Vector3 newVel) | 1940 | private void changeTargetVelocity(Vector3 newVel) |
@@ -1841,10 +2001,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1841 | { | 2001 | { |
1842 | setFreeMove(); | 2002 | setFreeMove(); |
1843 | 2003 | ||
1844 | if (Body != IntPtr.Zero) | 2004 | if(Body != IntPtr.Zero) |
1845 | { | 2005 | { |
1846 | if (newForce.X != 0f || newForce.Y != 0f || newForce.Z != 0) | 2006 | if(newForce.X != 0f || newForce.Y != 0f || newForce.Z != 0) |
1847 | d.BodyAddForce(Body, newForce.X, newForce.Y, newForce.Z); | 2007 | SafeNativeMethods.BodyAddForce(Body,newForce.X,newForce.Y,newForce.Z); |
1848 | } | 2008 | } |
1849 | } | 2009 | } |
1850 | 2010 | ||
@@ -1854,15 +2014,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1854 | _velocity = newmomentum; | 2014 | _velocity = newmomentum; |
1855 | setFreeMove(); | 2015 | setFreeMove(); |
1856 | 2016 | ||
1857 | if (Body != IntPtr.Zero) | 2017 | if(Body != IntPtr.Zero) |
1858 | d.BodySetLinearVel(Body, newmomentum.X, newmomentum.Y, newmomentum.Z); | 2018 | SafeNativeMethods.BodySetLinearVel(Body,newmomentum.X,newmomentum.Y,newmomentum.Z); |
1859 | } | 2019 | } |
1860 | 2020 | ||
1861 | private void changePIDHoverHeight(float val) | 2021 | private void changePIDHoverHeight(float val) |
1862 | { | 2022 | { |
1863 | m_PIDHoverHeight = val; | 2023 | m_PIDHoverHeight = val; |
1864 | if (val == 0) | 2024 | if(val == 0) |
1865 | m_useHoverPID = false; | 2025 | m_useHoverPID = false; |
1866 | } | 2026 | } |
1867 | 2027 | ||
1868 | private void changePIDHoverType(PIDHoverType type) | 2028 | private void changePIDHoverType(PIDHoverType type) |
@@ -1884,15 +2044,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1884 | { | 2044 | { |
1885 | } | 2045 | } |
1886 | 2046 | ||
1887 | public bool DoAChange(changes what, object arg) | 2047 | public bool DoAChange(changes what,object arg) |
1888 | { | 2048 | { |
1889 | if (collider == IntPtr.Zero && what != changes.Add && what != changes.Remove) | 2049 | if(collider == IntPtr.Zero && what != changes.Add && what != changes.Remove) |
1890 | { | 2050 | { |
1891 | return false; | 2051 | return false; |
1892 | } | 2052 | } |
1893 | 2053 | ||
1894 | // nasty switch | 2054 | // nasty switch |
1895 | switch (what) | 2055 | switch(what) |
1896 | { | 2056 | { |
1897 | case changes.Add: | 2057 | case changes.Add: |
1898 | changeAdd(); | 2058 | changeAdd(); |
@@ -1980,35 +2140,35 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1980 | changePIDHoverActive((bool)arg); | 2140 | changePIDHoverActive((bool)arg); |
1981 | break; | 2141 | break; |
1982 | 2142 | ||
1983 | /* not in use for now | 2143 | /* not in use for now |
1984 | case changes.Shape: | 2144 | case changes.Shape: |
1985 | changeShape((PrimitiveBaseShape)arg); | 2145 | changeShape((PrimitiveBaseShape)arg); |
1986 | break; | 2146 | break; |
1987 | 2147 | ||
1988 | case changes.CollidesWater: | 2148 | case changes.CollidesWater: |
1989 | changeFloatOnWater((bool)arg); | 2149 | changeFloatOnWater((bool)arg); |
1990 | break; | 2150 | break; |
1991 | 2151 | ||
1992 | case changes.VolumeDtc: | 2152 | case changes.VolumeDtc: |
1993 | changeVolumedetetion((bool)arg); | 2153 | changeVolumedetetion((bool)arg); |
1994 | break; | 2154 | break; |
1995 | 2155 | ||
1996 | case changes.Physical: | 2156 | case changes.Physical: |
1997 | changePhysicsStatus((bool)arg); | 2157 | changePhysicsStatus((bool)arg); |
1998 | break; | 2158 | break; |
1999 | 2159 | ||
2000 | case changes.Selected: | 2160 | case changes.Selected: |
2001 | changeSelectedStatus((bool)arg); | 2161 | changeSelectedStatus((bool)arg); |
2002 | break; | 2162 | break; |
2003 | 2163 | ||
2004 | case changes.disabled: | 2164 | case changes.disabled: |
2005 | changeDisable((bool)arg); | 2165 | changeDisable((bool)arg); |
2006 | break; | 2166 | break; |
2007 | 2167 | ||
2008 | case changes.building: | 2168 | case changes.building: |
2009 | changeBuilding((bool)arg); | 2169 | changeBuilding((bool)arg); |
2010 | break; | 2170 | break; |
2011 | */ | 2171 | */ |
2012 | case changes.Null: | 2172 | case changes.Null: |
2013 | donullchange(); | 2173 | donullchange(); |
2014 | break; | 2174 | break; |
@@ -2020,9 +2180,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2020 | return false; | 2180 | return false; |
2021 | } | 2181 | } |
2022 | 2182 | ||
2023 | public void AddChange(changes what, object arg) | 2183 | public void AddChange(changes what,object arg) |
2024 | { | 2184 | { |
2025 | m_parent_scene.AddChange((PhysicsActor)this, what, arg); | 2185 | m_parent_scene.AddChange((PhysicsActor)this,what,arg); |
2026 | } | 2186 | } |
2027 | 2187 | ||
2028 | private struct strAvatarSize | 2188 | private struct strAvatarSize |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs index ce10065..23b1192 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs | |||
@@ -41,13 +41,7 @@ | |||
41 | // Extensive change Ubit 2012 | 41 | // Extensive change Ubit 2012 |
42 | 42 | ||
43 | using System; | 43 | using System; |
44 | using System.Collections.Generic; | ||
45 | using System.Reflection; | ||
46 | using System.Runtime.InteropServices; | ||
47 | using log4net; | ||
48 | using OpenMetaverse; | 44 | using OpenMetaverse; |
49 | using OdeAPI; | ||
50 | using OpenSim.Framework; | ||
51 | using OpenSim.Region.PhysicsModules.SharedBase; | 45 | using OpenSim.Region.PhysicsModules.SharedBase; |
52 | 46 | ||
53 | namespace OpenSim.Region.PhysicsModule.ubOde | 47 | namespace OpenSim.Region.PhysicsModule.ubOde |
@@ -342,9 +336,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
342 | m_amEfect = 1.0f ; // turn it on | 336 | m_amEfect = 1.0f ; // turn it on |
343 | m_amDecay = 1.0f - 1.0f / m_angularMotorDecayTimescale; | 337 | m_amDecay = 1.0f - 1.0f / m_angularMotorDecayTimescale; |
344 | 338 | ||
345 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) | 339 | if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) |
346 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) | 340 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) |
347 | d.BodyEnable(rootPrim.Body); | 341 | SafeNativeMethods.BodyEnable(rootPrim.Body); |
348 | 342 | ||
349 | break; | 343 | break; |
350 | case Vehicle.LINEAR_FRICTION_TIMESCALE: | 344 | case Vehicle.LINEAR_FRICTION_TIMESCALE: |
@@ -361,9 +355,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
361 | m_lmEfect = 1.0f; // turn it on | 355 | m_lmEfect = 1.0f; // turn it on |
362 | 356 | ||
363 | m_ffactor = 0.0f; | 357 | m_ffactor = 0.0f; |
364 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) | 358 | if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) |
365 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) | 359 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) |
366 | d.BodyEnable(rootPrim.Body); | 360 | SafeNativeMethods.BodyEnable(rootPrim.Body); |
367 | break; | 361 | break; |
368 | case Vehicle.LINEAR_MOTOR_OFFSET: | 362 | case Vehicle.LINEAR_MOTOR_OFFSET: |
369 | m_linearMotorOffset = new Vector3(pValue, pValue, pValue); | 363 | m_linearMotorOffset = new Vector3(pValue, pValue, pValue); |
@@ -399,9 +393,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
399 | m_amEfect = 1.0f; // turn it on | 393 | m_amEfect = 1.0f; // turn it on |
400 | m_amDecay = 1.0f - 1.0f / m_angularMotorDecayTimescale; | 394 | m_amDecay = 1.0f - 1.0f / m_angularMotorDecayTimescale; |
401 | 395 | ||
402 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) | 396 | if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) |
403 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) | 397 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) |
404 | d.BodyEnable(rootPrim.Body); | 398 | SafeNativeMethods.BodyEnable(rootPrim.Body); |
405 | break; | 399 | break; |
406 | case Vehicle.LINEAR_FRICTION_TIMESCALE: | 400 | case Vehicle.LINEAR_FRICTION_TIMESCALE: |
407 | if (pValue.X < m_timestep) pValue.X = m_timestep; | 401 | if (pValue.X < m_timestep) pValue.X = m_timestep; |
@@ -419,9 +413,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
419 | m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale; | 413 | m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale; |
420 | 414 | ||
421 | m_ffactor = 0.0f; | 415 | m_ffactor = 0.0f; |
422 | if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) | 416 | if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) |
423 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) | 417 | && !rootPrim.m_isSelected && !rootPrim.m_disabled) |
424 | d.BodyEnable(rootPrim.Body); | 418 | SafeNativeMethods.BodyEnable(rootPrim.Body); |
425 | break; | 419 | break; |
426 | case Vehicle.LINEAR_MOTOR_OFFSET: | 420 | case Vehicle.LINEAR_MOTOR_OFFSET: |
427 | m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); | 421 | m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); |
@@ -772,30 +766,30 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
772 | { | 766 | { |
773 | IntPtr Body = rootPrim.Body; | 767 | IntPtr Body = rootPrim.Body; |
774 | 768 | ||
775 | d.Mass dmass; | 769 | SafeNativeMethods.Mass dmass; |
776 | d.BodyGetMass(Body, out dmass); | 770 | SafeNativeMethods.BodyGetMass(Body, out dmass); |
777 | 771 | ||
778 | d.Quaternion rot = d.BodyGetQuaternion(Body); | 772 | SafeNativeMethods.Quaternion rot = SafeNativeMethods.BodyGetQuaternion(Body); |
779 | Quaternion objrotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object | 773 | Quaternion objrotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object |
780 | Quaternion rotq = objrotq; // rotq = rotation of object | 774 | Quaternion rotq = objrotq; // rotq = rotation of object |
781 | rotq *= m_referenceFrame; // rotq is now rotation in vehicle reference frame | 775 | rotq *= m_referenceFrame; // rotq is now rotation in vehicle reference frame |
782 | Quaternion irotq = Quaternion.Inverse(rotq); | 776 | Quaternion irotq = Quaternion.Inverse(rotq); |
783 | 777 | ||
784 | d.Vector3 dvtmp; | 778 | SafeNativeMethods.Vector3 dvtmp; |
785 | Vector3 tmpV; | 779 | Vector3 tmpV; |
786 | Vector3 curVel; // velocity in world | 780 | Vector3 curVel; // velocity in world |
787 | Vector3 curAngVel; // angular velocity in world | 781 | Vector3 curAngVel; // angular velocity in world |
788 | Vector3 force = Vector3.Zero; // actually linear aceleration until mult by mass in world frame | 782 | Vector3 force = Vector3.Zero; // actually linear aceleration until mult by mass in world frame |
789 | Vector3 torque = Vector3.Zero;// actually angular aceleration until mult by Inertia in vehicle frame | 783 | Vector3 torque = Vector3.Zero;// actually angular aceleration until mult by Inertia in vehicle frame |
790 | d.Vector3 dtorque = new d.Vector3(); | 784 | SafeNativeMethods.Vector3 dtorque = new SafeNativeMethods.Vector3(); |
791 | 785 | ||
792 | dvtmp = d.BodyGetLinearVel(Body); | 786 | dvtmp = SafeNativeMethods.BodyGetLinearVel(Body); |
793 | curVel.X = dvtmp.X; | 787 | curVel.X = dvtmp.X; |
794 | curVel.Y = dvtmp.Y; | 788 | curVel.Y = dvtmp.Y; |
795 | curVel.Z = dvtmp.Z; | 789 | curVel.Z = dvtmp.Z; |
796 | Vector3 curLocalVel = curVel * irotq; // current velocity in local | 790 | Vector3 curLocalVel = curVel * irotq; // current velocity in local |
797 | 791 | ||
798 | dvtmp = d.BodyGetAngularVel(Body); | 792 | dvtmp = SafeNativeMethods.BodyGetAngularVel(Body); |
799 | curAngVel.X = dvtmp.X; | 793 | curAngVel.X = dvtmp.X; |
800 | curAngVel.Y = dvtmp.Y; | 794 | curAngVel.Y = dvtmp.Y; |
801 | curAngVel.Z = dvtmp.Z; | 795 | curAngVel.Z = dvtmp.Z; |
@@ -839,7 +833,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
839 | { | 833 | { |
840 | // have offset, do it now | 834 | // have offset, do it now |
841 | tmpV *= dmass.mass; | 835 | tmpV *= dmass.mass; |
842 | d.BodyAddForceAtRelPos(Body, tmpV.X, tmpV.Y, tmpV.Z, m_linearMotorOffset.X, m_linearMotorOffset.Y, m_linearMotorOffset.Z); | 836 | SafeNativeMethods.BodyAddForceAtRelPos(Body, tmpV.X, tmpV.Y, tmpV.Z, m_linearMotorOffset.X, m_linearMotorOffset.Y, m_linearMotorOffset.Z); |
843 | } | 837 | } |
844 | else | 838 | else |
845 | { | 839 | { |
@@ -862,7 +856,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
862 | if (m_VhoverTimescale < 300 && rootPrim.prim_geom != IntPtr.Zero) | 856 | if (m_VhoverTimescale < 300 && rootPrim.prim_geom != IntPtr.Zero) |
863 | { | 857 | { |
864 | // d.Vector3 pos = d.BodyGetPosition(Body); | 858 | // d.Vector3 pos = d.BodyGetPosition(Body); |
865 | d.Vector3 pos = d.GeomGetPosition(rootPrim.prim_geom); | 859 | SafeNativeMethods.Vector3 pos = SafeNativeMethods.GeomGetPosition(rootPrim.prim_geom); |
866 | pos.Z -= 0.21f; // minor offset that seems to be always there in sl | 860 | pos.Z -= 0.21f; // minor offset that seems to be always there in sl |
867 | 861 | ||
868 | float t = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y); | 862 | float t = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y); |
@@ -1181,7 +1175,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1181 | 1175 | ||
1182 | if (force.X != 0 || force.Y != 0 || force.Z != 0) | 1176 | if (force.X != 0 || force.Y != 0 || force.Z != 0) |
1183 | { | 1177 | { |
1184 | d.BodyAddForce(Body, force.X, force.Y, force.Z); | 1178 | SafeNativeMethods.BodyAddForce(Body, force.X, force.Y, force.Z); |
1185 | } | 1179 | } |
1186 | 1180 | ||
1187 | if (torque.X != 0 || torque.Y != 0 || torque.Z != 0) | 1181 | if (torque.X != 0 || torque.Y != 0 || torque.Z != 0) |
@@ -1191,15 +1185,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1191 | dtorque.Y = torque.Y; | 1185 | dtorque.Y = torque.Y; |
1192 | dtorque.Z = torque.Z; | 1186 | dtorque.Z = torque.Z; |
1193 | 1187 | ||
1194 | d.MultiplyM3V3(out dvtmp, ref dmass.I, ref dtorque); | 1188 | SafeNativeMethods.MultiplyM3V3(out dvtmp, ref dmass.I, ref dtorque); |
1195 | d.BodyAddRelTorque(Body, dvtmp.X, dvtmp.Y, dvtmp.Z); // add torque in object frame | 1189 | SafeNativeMethods.BodyAddRelTorque(Body, dvtmp.X, dvtmp.Y, dvtmp.Z); // add torque in object frame |
1196 | } | 1190 | } |
1197 | 1191 | ||
1198 | torque = rootPrim.m_torque; | 1192 | torque = rootPrim.m_torque; |
1199 | torque += rootPrim.m_angularForceacc; | 1193 | torque += rootPrim.m_angularForceacc; |
1200 | rootPrim.m_angularForceacc = Vector3.Zero; | 1194 | rootPrim.m_angularForceacc = Vector3.Zero; |
1201 | if (torque.X != 0 || torque.Y != 0 || torque.Z != 0) | 1195 | if (torque.X != 0 || torque.Y != 0 || torque.Z != 0) |
1202 | d.BodyAddTorque(Body,torque.X, torque.Y, torque.Z); | 1196 | SafeNativeMethods.BodyAddTorque(Body,torque.X, torque.Y, torque.Z); |
1203 | } | 1197 | } |
1204 | } | 1198 | } |
1205 | } | 1199 | } |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs index 5465035..f4e2b1f 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEMeshWorker.cs | |||
@@ -4,14 +4,8 @@ | |||
4 | 4 | ||
5 | using System; | 5 | using System; |
6 | using System.Threading; | 6 | using System.Threading; |
7 | using System.Collections.Generic; | ||
8 | using System.IO; | ||
9 | using System.Reflection; | ||
10 | using System.Runtime.InteropServices; | ||
11 | using System.Text; | ||
12 | using OpenSim.Framework; | 7 | using OpenSim.Framework; |
13 | using OpenSim.Region.PhysicsModules.SharedBase; | 8 | using OpenSim.Region.PhysicsModules.SharedBase; |
14 | using OdeAPI; | ||
15 | using log4net; | 9 | using log4net; |
16 | using Nini.Config; | 10 | using Nini.Config; |
17 | using OpenMetaverse; | 11 | using OpenMetaverse; |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs index 4cb1736..90560fd 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs | |||
@@ -4,7 +4,6 @@ using System.Reflection; | |||
4 | using log4net; | 4 | using log4net; |
5 | using Nini.Config; | 5 | using Nini.Config; |
6 | using Mono.Addins; | 6 | using Mono.Addins; |
7 | using OdeAPI; | ||
8 | using OpenSim.Framework; | 7 | using OpenSim.Framework; |
9 | using OpenSim.Region.Framework.Scenes; | 8 | using OpenSim.Region.Framework.Scenes; |
10 | using OpenSim.Region.Framework.Interfaces; | 9 | using OpenSim.Region.Framework.Interfaces; |
@@ -53,9 +52,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
53 | if (Util.IsWindows()) | 52 | if (Util.IsWindows()) |
54 | Util.LoadArchSpecificWindowsDll("ode.dll"); | 53 | Util.LoadArchSpecificWindowsDll("ode.dll"); |
55 | 54 | ||
56 | d.InitODE(); | 55 | SafeNativeMethods.InitODE(); |
57 | 56 | ||
58 | string ode_config = d.GetConfiguration(); | 57 | string ode_config = SafeNativeMethods.GetConfiguration(); |
59 | if (ode_config != null && ode_config != "") | 58 | if (ode_config != null && ode_config != "") |
60 | { | 59 | { |
61 | m_log.InfoFormat("[ubODE] ode library configuration: {0}", ode_config); | 60 | m_log.InfoFormat("[ubODE] ode library configuration: {0}", ode_config); |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index e080b18..4e18522 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | |||
@@ -44,11 +44,8 @@ | |||
44 | using System; | 44 | using System; |
45 | using System.Collections.Generic; | 45 | using System.Collections.Generic; |
46 | using System.Reflection; | 46 | using System.Reflection; |
47 | using System.Runtime.InteropServices; | ||
48 | using System.Threading; | ||
49 | using log4net; | 47 | using log4net; |
50 | using OpenMetaverse; | 48 | using OpenMetaverse; |
51 | using OdeAPI; | ||
52 | using OpenSim.Framework; | 49 | using OpenSim.Framework; |
53 | using OpenSim.Region.PhysicsModules.SharedBase; | 50 | using OpenSim.Region.PhysicsModules.SharedBase; |
54 | 51 | ||
@@ -182,7 +179,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
182 | private float m_physCost; | 179 | private float m_physCost; |
183 | private float m_streamCost; | 180 | private float m_streamCost; |
184 | 181 | ||
185 | public d.Mass primdMass; // prim inertia information on it's own referencial | 182 | internal SafeNativeMethods.Mass primdMass; // prim inertia information on it's own referencial |
186 | private PhysicsInertiaData m_InertiaOverride; | 183 | private PhysicsInertiaData m_InertiaOverride; |
187 | float primMass; // prim own mass | 184 | float primMass; // prim own mass |
188 | float primVolume; // prim own volume; | 185 | float primVolume; // prim own volume; |
@@ -489,7 +486,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
489 | // double buffering | 486 | // double buffering |
490 | if(m_fakeInertiaOverride != null) | 487 | if(m_fakeInertiaOverride != null) |
491 | { | 488 | { |
492 | d.Mass objdmass = new d.Mass(); | 489 | SafeNativeMethods.Mass objdmass = new SafeNativeMethods.Mass(); |
493 | objdmass.I.M00 = m_fakeInertiaOverride.Inertia.X; | 490 | objdmass.I.M00 = m_fakeInertiaOverride.Inertia.X; |
494 | objdmass.I.M11 = m_fakeInertiaOverride.Inertia.Y; | 491 | objdmass.I.M11 = m_fakeInertiaOverride.Inertia.Y; |
495 | objdmass.I.M22 = m_fakeInertiaOverride.Inertia.Z; | 492 | objdmass.I.M22 = m_fakeInertiaOverride.Inertia.Z; |
@@ -498,15 +495,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
498 | 495 | ||
499 | if(Math.Abs(m_fakeInertiaOverride.InertiaRotation.W) < 0.999) | 496 | if(Math.Abs(m_fakeInertiaOverride.InertiaRotation.W) < 0.999) |
500 | { | 497 | { |
501 | d.Matrix3 inertiarotmat = new d.Matrix3(); | 498 | SafeNativeMethods.Matrix3 inertiarotmat = new SafeNativeMethods.Matrix3(); |
502 | d.Quaternion inertiarot = new d.Quaternion(); | 499 | SafeNativeMethods.Quaternion inertiarot = new SafeNativeMethods.Quaternion(); |
503 | 500 | ||
504 | inertiarot.X = m_fakeInertiaOverride.InertiaRotation.X; | 501 | inertiarot.X = m_fakeInertiaOverride.InertiaRotation.X; |
505 | inertiarot.Y = m_fakeInertiaOverride.InertiaRotation.Y; | 502 | inertiarot.Y = m_fakeInertiaOverride.InertiaRotation.Y; |
506 | inertiarot.Z = m_fakeInertiaOverride.InertiaRotation.Z; | 503 | inertiarot.Z = m_fakeInertiaOverride.InertiaRotation.Z; |
507 | inertiarot.W = m_fakeInertiaOverride.InertiaRotation.W; | 504 | inertiarot.W = m_fakeInertiaOverride.InertiaRotation.W; |
508 | d.RfromQ(out inertiarotmat, ref inertiarot); | 505 | SafeNativeMethods.RfromQ(out inertiarotmat, ref inertiarot); |
509 | d.MassRotate(ref objdmass, ref inertiarotmat); | 506 | SafeNativeMethods.MassRotate(ref objdmass, ref inertiarotmat); |
510 | } | 507 | } |
511 | 508 | ||
512 | inertia.TotalMass = m_fakeInertiaOverride.TotalMass; | 509 | inertia.TotalMass = m_fakeInertiaOverride.TotalMass; |
@@ -530,13 +527,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
530 | return inertia; | 527 | return inertia; |
531 | } | 528 | } |
532 | 529 | ||
533 | d.Vector3 dtmp; | 530 | SafeNativeMethods.Vector3 dtmp; |
534 | d.Mass m = new d.Mass(); | 531 | SafeNativeMethods.Mass m = new SafeNativeMethods.Mass(); |
535 | lock(_parent_scene.OdeLock) | 532 | lock(_parent_scene.OdeLock) |
536 | { | 533 | { |
537 | d.AllocateODEDataForThread(0); | 534 | SafeNativeMethods.AllocateODEDataForThread(0); |
538 | dtmp = d.GeomGetOffsetPosition(prim_geom); | 535 | dtmp = SafeNativeMethods.GeomGetOffsetPosition(prim_geom); |
539 | d.BodyGetMass(Body, out m); | 536 | SafeNativeMethods.BodyGetMass(Body, out m); |
540 | } | 537 | } |
541 | 538 | ||
542 | Vector3 cm = new Vector3(-dtmp.X, -dtmp.Y, -dtmp.Z); | 539 | Vector3 cm = new Vector3(-dtmp.X, -dtmp.Y, -dtmp.Z); |
@@ -572,18 +569,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
572 | { | 569 | { |
573 | lock (_parent_scene.OdeLock) | 570 | lock (_parent_scene.OdeLock) |
574 | { | 571 | { |
575 | d.AllocateODEDataForThread(0); | 572 | SafeNativeMethods.AllocateODEDataForThread(0); |
576 | 573 | ||
577 | d.Vector3 dtmp; | 574 | SafeNativeMethods.Vector3 dtmp; |
578 | if (!childPrim && Body != IntPtr.Zero) | 575 | if (!childPrim && Body != IntPtr.Zero) |
579 | { | 576 | { |
580 | dtmp = d.BodyGetPosition(Body); | 577 | dtmp = SafeNativeMethods.BodyGetPosition(Body); |
581 | return new Vector3(dtmp.X, dtmp.Y, dtmp.Z); | 578 | return new Vector3(dtmp.X, dtmp.Y, dtmp.Z); |
582 | } | 579 | } |
583 | else if (prim_geom != IntPtr.Zero) | 580 | else if (prim_geom != IntPtr.Zero) |
584 | { | 581 | { |
585 | d.Quaternion dq; | 582 | SafeNativeMethods.Quaternion dq; |
586 | d.GeomCopyQuaternion(prim_geom, out dq); | 583 | SafeNativeMethods.GeomCopyQuaternion(prim_geom, out dq); |
587 | Quaternion q; | 584 | Quaternion q; |
588 | q.X = dq.X; | 585 | q.X = dq.X; |
589 | q.Y = dq.Y; | 586 | q.Y = dq.Y; |
@@ -591,7 +588,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
591 | q.W = dq.W; | 588 | q.W = dq.W; |
592 | 589 | ||
593 | Vector3 Ptot = m_OBBOffset * q; | 590 | Vector3 Ptot = m_OBBOffset * q; |
594 | dtmp = d.GeomGetPosition(prim_geom); | 591 | dtmp = SafeNativeMethods.GeomGetPosition(prim_geom); |
595 | Ptot.X += dtmp.X; | 592 | Ptot.X += dtmp.X; |
596 | Ptot.Y += dtmp.Y; | 593 | Ptot.Y += dtmp.Y; |
597 | Ptot.Z += dtmp.Z; | 594 | Ptot.Z += dtmp.Z; |
@@ -997,16 +994,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
997 | _velocity.Y = 0; | 994 | _velocity.Y = 0; |
998 | _velocity.Z = 0; | 995 | _velocity.Z = 0; |
999 | 996 | ||
1000 | d.AllocateODEDataForThread(0); | 997 | SafeNativeMethods.AllocateODEDataForThread(0); |
1001 | 998 | ||
1002 | m_lastVelocity = _velocity; | 999 | m_lastVelocity = _velocity; |
1003 | if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) | 1000 | if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) |
1004 | m_vehicle.Stop(); | 1001 | m_vehicle.Stop(); |
1005 | 1002 | ||
1006 | if(Body != IntPtr.Zero) | 1003 | if(Body != IntPtr.Zero) |
1007 | d.BodySetLinearVel(Body, 0, 0, 0); // stop it | 1004 | SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it |
1008 | if (prim_geom != IntPtr.Zero) | 1005 | if (prim_geom != IntPtr.Zero) |
1009 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); | 1006 | SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); |
1010 | 1007 | ||
1011 | m_outbounds = false; | 1008 | m_outbounds = false; |
1012 | changeDisable(false); | 1009 | changeDisable(false); |
@@ -1027,24 +1024,24 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1027 | m_lastposition = _position; | 1024 | m_lastposition = _position; |
1028 | m_lastorientation = _orientation; | 1025 | m_lastorientation = _orientation; |
1029 | 1026 | ||
1030 | d.AllocateODEDataForThread(0); | 1027 | SafeNativeMethods.AllocateODEDataForThread(0); |
1031 | if(Body != IntPtr.Zero) | 1028 | if(Body != IntPtr.Zero) |
1032 | { | 1029 | { |
1033 | d.Vector3 dtmp = d.BodyGetAngularVel(Body); | 1030 | SafeNativeMethods.Vector3 dtmp = SafeNativeMethods.BodyGetAngularVel(Body); |
1034 | m_rotationalVelocity.X = dtmp.X; | 1031 | m_rotationalVelocity.X = dtmp.X; |
1035 | m_rotationalVelocity.Y = dtmp.Y; | 1032 | m_rotationalVelocity.Y = dtmp.Y; |
1036 | m_rotationalVelocity.Z = dtmp.Z; | 1033 | m_rotationalVelocity.Z = dtmp.Z; |
1037 | 1034 | ||
1038 | dtmp = d.BodyGetLinearVel(Body); | 1035 | dtmp = SafeNativeMethods.BodyGetLinearVel(Body); |
1039 | _velocity.X = dtmp.X; | 1036 | _velocity.X = dtmp.X; |
1040 | _velocity.Y = dtmp.Y; | 1037 | _velocity.Y = dtmp.Y; |
1041 | _velocity.Z = dtmp.Z; | 1038 | _velocity.Z = dtmp.Z; |
1042 | 1039 | ||
1043 | d.BodySetLinearVel(Body, 0, 0, 0); // stop it | 1040 | SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it |
1044 | d.BodySetAngularVel(Body, 0, 0, 0); | 1041 | SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); |
1045 | } | 1042 | } |
1046 | if(prim_geom != IntPtr.Zero) | 1043 | if(prim_geom != IntPtr.Zero) |
1047 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); | 1044 | SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); |
1048 | disableBodySoft(); // stop collisions | 1045 | disableBodySoft(); // stop collisions |
1049 | UnSubscribeEvents(); | 1046 | UnSubscribeEvents(); |
1050 | } | 1047 | } |
@@ -1241,7 +1238,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1241 | SentEmptyCollisionsEvent = true; | 1238 | SentEmptyCollisionsEvent = true; |
1242 | // _parent_scene.RemoveCollisionEventReporting(this); | 1239 | // _parent_scene.RemoveCollisionEventReporting(this); |
1243 | } | 1240 | } |
1244 | else if(Body == IntPtr.Zero || (d.BodyIsEnabled(Body) && m_bodydisablecontrol >= 0 )) | 1241 | else if(Body == IntPtr.Zero || (SafeNativeMethods.BodyIsEnabled(Body) && m_bodydisablecontrol >= 0 )) |
1245 | { | 1242 | { |
1246 | SentEmptyCollisionsEvent = false; | 1243 | SentEmptyCollisionsEvent = false; |
1247 | CollisionEvents.Clear(); | 1244 | CollisionEvents.Clear(); |
@@ -1450,16 +1447,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1450 | { | 1447 | { |
1451 | if (prm.m_NoColide) | 1448 | if (prm.m_NoColide) |
1452 | { | 1449 | { |
1453 | d.GeomSetCategoryBits(prm.prim_geom, 0); | 1450 | SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, 0); |
1454 | if (m_isphysical) | 1451 | if (m_isphysical) |
1455 | d.GeomSetCollideBits(prm.prim_geom, (int)CollisionCategories.Land); | 1452 | SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, (int)CollisionCategories.Land); |
1456 | else | 1453 | else |
1457 | d.GeomSetCollideBits(prm.prim_geom, 0); | 1454 | SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, 0); |
1458 | } | 1455 | } |
1459 | else | 1456 | else |
1460 | { | 1457 | { |
1461 | d.GeomSetCategoryBits(prm.prim_geom, (uint)prm.m_collisionCategories); | 1458 | SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, (uint)prm.m_collisionCategories); |
1462 | d.GeomSetCollideBits(prm.prim_geom, (uint)prm.m_collisionFlags); | 1459 | SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, (uint)prm.m_collisionFlags); |
1463 | } | 1460 | } |
1464 | } | 1461 | } |
1465 | } | 1462 | } |
@@ -1467,22 +1464,22 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1467 | 1464 | ||
1468 | if (m_NoColide) | 1465 | if (m_NoColide) |
1469 | { | 1466 | { |
1470 | d.GeomSetCategoryBits(prim_geom, 0); | 1467 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); |
1471 | d.GeomSetCollideBits(prim_geom, (uint)CollisionCategories.Land); | 1468 | SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)CollisionCategories.Land); |
1472 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) | 1469 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) |
1473 | { | 1470 | { |
1474 | d.GeomSetCategoryBits(collide_geom, 0); | 1471 | SafeNativeMethods.GeomSetCategoryBits(collide_geom, 0); |
1475 | d.GeomSetCollideBits(collide_geom, (uint)CollisionCategories.Land); | 1472 | SafeNativeMethods.GeomSetCollideBits(collide_geom, (uint)CollisionCategories.Land); |
1476 | } | 1473 | } |
1477 | } | 1474 | } |
1478 | else | 1475 | else |
1479 | { | 1476 | { |
1480 | d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); | 1477 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); |
1481 | d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); | 1478 | SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); |
1482 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) | 1479 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) |
1483 | { | 1480 | { |
1484 | d.GeomSetCategoryBits(collide_geom, (uint)m_collisionCategories); | 1481 | SafeNativeMethods.GeomSetCategoryBits(collide_geom, (uint)m_collisionCategories); |
1485 | d.GeomSetCollideBits(collide_geom, (uint)m_collisionFlags); | 1482 | SafeNativeMethods.GeomSetCollideBits(collide_geom, (uint)m_collisionFlags); |
1486 | } | 1483 | } |
1487 | } | 1484 | } |
1488 | } | 1485 | } |
@@ -1495,7 +1492,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1495 | 1492 | ||
1496 | if (Amotor != IntPtr.Zero) | 1493 | if (Amotor != IntPtr.Zero) |
1497 | { | 1494 | { |
1498 | d.JointDestroy(Amotor); | 1495 | SafeNativeMethods.JointDestroy(Amotor); |
1499 | Amotor = IntPtr.Zero; | 1496 | Amotor = IntPtr.Zero; |
1500 | } | 1497 | } |
1501 | 1498 | ||
@@ -1522,19 +1519,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1522 | if(axisnum == 0) | 1519 | if(axisnum == 0) |
1523 | return; | 1520 | return; |
1524 | // stop it | 1521 | // stop it |
1525 | d.BodySetTorque(Body, 0, 0, 0); | 1522 | SafeNativeMethods.BodySetTorque(Body, 0, 0, 0); |
1526 | d.BodySetAngularVel(Body, 0, 0, 0); | 1523 | SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); |
1527 | 1524 | ||
1528 | Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); | 1525 | Amotor = SafeNativeMethods.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); |
1529 | d.JointAttach(Amotor, Body, IntPtr.Zero); | 1526 | SafeNativeMethods.JointAttach(Amotor, Body, IntPtr.Zero); |
1530 | 1527 | ||
1531 | d.JointSetAMotorMode(Amotor, 0); | 1528 | SafeNativeMethods.JointSetAMotorMode(Amotor, 0); |
1532 | 1529 | ||
1533 | d.JointSetAMotorNumAxes(Amotor, axisnum); | 1530 | SafeNativeMethods.JointSetAMotorNumAxes(Amotor, axisnum); |
1534 | 1531 | ||
1535 | // get current orientation to lock | 1532 | // get current orientation to lock |
1536 | 1533 | ||
1537 | d.Quaternion dcur = d.BodyGetQuaternion(Body); | 1534 | SafeNativeMethods.Quaternion dcur = SafeNativeMethods.BodyGetQuaternion(Body); |
1538 | Quaternion curr; // crap convertion between identical things | 1535 | Quaternion curr; // crap convertion between identical things |
1539 | curr.X = dcur.X; | 1536 | curr.X = dcur.X; |
1540 | curr.Y = dcur.Y; | 1537 | curr.Y = dcur.Y; |
@@ -1547,17 +1544,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1547 | if (axisX) | 1544 | if (axisX) |
1548 | { | 1545 | { |
1549 | ax = (new Vector3(1, 0, 0)) * curr; // rotate world X to current local X | 1546 | ax = (new Vector3(1, 0, 0)) * curr; // rotate world X to current local X |
1550 | d.JointSetAMotorAxis(Amotor, 0, 0, ax.X, ax.Y, ax.Z); | 1547 | SafeNativeMethods.JointSetAMotorAxis(Amotor, 0, 0, ax.X, ax.Y, ax.Z); |
1551 | d.JointSetAMotorAngle(Amotor, 0, 0); | 1548 | SafeNativeMethods.JointSetAMotorAngle(Amotor, 0, 0); |
1552 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.LoStop, 0f); | 1549 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.LoStop, 0f); |
1553 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.HiStop, 0f); | 1550 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.HiStop, 0f); |
1554 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.Vel, 0); | 1551 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Vel, 0); |
1555 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.FudgeFactor, 0.0001f); | 1552 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); |
1556 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.Bounce, 0f); | 1553 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Bounce, 0f); |
1557 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.CFM, 0f); | 1554 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.CFM, 0f); |
1558 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.FMax, 5e8f); | 1555 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.FMax, 5e8f); |
1559 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.StopCFM, 0f); | 1556 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.StopCFM, 0f); |
1560 | d.JointSetAMotorParam(Amotor, (int)d.JointParam.StopERP, 0.8f); | 1557 | SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.StopERP, 0.8f); |
1561 | i++; | 1558 | i++; |
1562 | j = 256; // move to next axis set | 1559 | j = 256; // move to next axis set |
1563 | } | 1560 | } |
@@ -1565,17 +1562,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1565 | if (axisY) | 1562 | if (axisY) |
1566 | { | 1563 | { |
1567 | ax = (new Vector3(0, 1, 0)) * curr; | 1564 | ax = (new Vector3(0, 1, 0)) * curr; |
1568 | d.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); | 1565 | SafeNativeMethods.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); |
1569 | d.JointSetAMotorAngle(Amotor, i, 0); | 1566 | SafeNativeMethods.JointSetAMotorAngle(Amotor, i, 0); |
1570 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.LoStop, 0f); | 1567 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.LoStop, 0f); |
1571 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.HiStop, 0f); | 1568 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.HiStop, 0f); |
1572 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.Vel, 0); | 1569 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Vel, 0); |
1573 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.FudgeFactor, 0.0001f); | 1570 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); |
1574 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.Bounce, 0f); | 1571 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Bounce, 0f); |
1575 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.CFM, 0f); | 1572 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.CFM, 0f); |
1576 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.FMax, 5e8f); | 1573 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FMax, 5e8f); |
1577 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.StopCFM, 0f); | 1574 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopCFM, 0f); |
1578 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.StopERP, 0.8f); | 1575 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopERP, 0.8f); |
1579 | i++; | 1576 | i++; |
1580 | j += 256; | 1577 | j += 256; |
1581 | } | 1578 | } |
@@ -1583,17 +1580,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1583 | if (axisZ) | 1580 | if (axisZ) |
1584 | { | 1581 | { |
1585 | ax = (new Vector3(0, 0, 1)) * curr; | 1582 | ax = (new Vector3(0, 0, 1)) * curr; |
1586 | d.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); | 1583 | SafeNativeMethods.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); |
1587 | d.JointSetAMotorAngle(Amotor, i, 0); | 1584 | SafeNativeMethods.JointSetAMotorAngle(Amotor, i, 0); |
1588 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.LoStop, 0f); | 1585 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.LoStop, 0f); |
1589 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.HiStop, 0f); | 1586 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.HiStop, 0f); |
1590 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.Vel, 0); | 1587 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Vel, 0); |
1591 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.FudgeFactor, 0.0001f); | 1588 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); |
1592 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.Bounce, 0f); | 1589 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Bounce, 0f); |
1593 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.CFM, 0f); | 1590 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.CFM, 0f); |
1594 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.FMax, 5e8f); | 1591 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FMax, 5e8f); |
1595 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.StopCFM, 0f); | 1592 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopCFM, 0f); |
1596 | d.JointSetAMotorParam(Amotor, j + (int)d.JointParam.StopERP, 0.8f); | 1593 | SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopERP, 0.8f); |
1597 | } | 1594 | } |
1598 | } | 1595 | } |
1599 | 1596 | ||
@@ -1607,21 +1604,21 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1607 | 1604 | ||
1608 | if (m_NoColide) | 1605 | if (m_NoColide) |
1609 | { | 1606 | { |
1610 | d.GeomSetCategoryBits(prim_geom, 0); | 1607 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); |
1611 | if (m_isphysical) | 1608 | if (m_isphysical) |
1612 | { | 1609 | { |
1613 | d.GeomSetCollideBits(prim_geom, (uint)CollisionCategories.Land); | 1610 | SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)CollisionCategories.Land); |
1614 | } | 1611 | } |
1615 | else | 1612 | else |
1616 | { | 1613 | { |
1617 | d.GeomSetCollideBits(prim_geom, 0); | 1614 | SafeNativeMethods.GeomSetCollideBits(prim_geom, 0); |
1618 | d.GeomDisable(prim_geom); | 1615 | SafeNativeMethods.GeomDisable(prim_geom); |
1619 | } | 1616 | } |
1620 | } | 1617 | } |
1621 | else | 1618 | else |
1622 | { | 1619 | { |
1623 | d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); | 1620 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); |
1624 | d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); | 1621 | SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); |
1625 | } | 1622 | } |
1626 | 1623 | ||
1627 | UpdatePrimBodyData(); | 1624 | UpdatePrimBodyData(); |
@@ -1689,12 +1686,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1689 | 1686 | ||
1690 | try | 1687 | try |
1691 | { | 1688 | { |
1692 | _triMeshData = d.GeomTriMeshDataCreate(); | 1689 | _triMeshData = SafeNativeMethods.GeomTriMeshDataCreate(); |
1693 | 1690 | ||
1694 | d.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); | 1691 | SafeNativeMethods.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); |
1695 | d.GeomTriMeshDataPreprocess(_triMeshData); | 1692 | SafeNativeMethods.GeomTriMeshDataPreprocess(_triMeshData); |
1696 | 1693 | ||
1697 | geo = d.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null); | 1694 | geo = SafeNativeMethods.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null); |
1698 | } | 1695 | } |
1699 | 1696 | ||
1700 | catch (Exception e) | 1697 | catch (Exception e) |
@@ -1704,7 +1701,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1704 | { | 1701 | { |
1705 | try | 1702 | try |
1706 | { | 1703 | { |
1707 | d.GeomTriMeshDataDestroy(_triMeshData); | 1704 | SafeNativeMethods.GeomTriMeshDataDestroy(_triMeshData); |
1708 | } | 1705 | } |
1709 | catch | 1706 | catch |
1710 | { | 1707 | { |
@@ -1760,7 +1757,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1760 | { // it's a sphere | 1757 | { // it's a sphere |
1761 | try | 1758 | try |
1762 | { | 1759 | { |
1763 | geo = d.CreateSphere(m_targetSpace, _size.X * 0.5f); | 1760 | geo = SafeNativeMethods.CreateSphere(m_targetSpace, _size.X * 0.5f); |
1764 | } | 1761 | } |
1765 | catch (Exception e) | 1762 | catch (Exception e) |
1766 | { | 1763 | { |
@@ -1772,7 +1769,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1772 | {// do it as a box | 1769 | {// do it as a box |
1773 | try | 1770 | try |
1774 | { | 1771 | { |
1775 | geo = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z); | 1772 | geo = SafeNativeMethods.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z); |
1776 | } | 1773 | } |
1777 | catch (Exception e) | 1774 | catch (Exception e) |
1778 | { | 1775 | { |
@@ -1794,10 +1791,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1794 | 1791 | ||
1795 | try | 1792 | try |
1796 | { | 1793 | { |
1797 | d.GeomDestroy(prim_geom); | 1794 | SafeNativeMethods.GeomDestroy(prim_geom); |
1798 | if (_triMeshData != IntPtr.Zero) | 1795 | if (_triMeshData != IntPtr.Zero) |
1799 | { | 1796 | { |
1800 | d.GeomTriMeshDataDestroy(_triMeshData); | 1797 | SafeNativeMethods.GeomTriMeshDataDestroy(_triMeshData); |
1801 | _triMeshData = IntPtr.Zero; | 1798 | _triMeshData = IntPtr.Zero; |
1802 | } | 1799 | } |
1803 | } | 1800 | } |
@@ -1848,8 +1845,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1848 | ApplyCollisionCatFlags(); | 1845 | ApplyCollisionCatFlags(); |
1849 | 1846 | ||
1850 | _zeroFlag = true; | 1847 | _zeroFlag = true; |
1851 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 1848 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
1852 | d.BodyEnable(Body); | 1849 | SafeNativeMethods.BodyEnable(Body); |
1853 | } | 1850 | } |
1854 | } | 1851 | } |
1855 | resetCollisionAccounting(); | 1852 | resetCollisionAccounting(); |
@@ -1868,7 +1865,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1868 | m_collisionCategories = 0; | 1865 | m_collisionCategories = 0; |
1869 | m_collisionFlags = 0; | 1866 | m_collisionFlags = 0; |
1870 | ApplyCollisionCatFlags(); | 1867 | ApplyCollisionCatFlags(); |
1871 | d.BodyDisable(Body); | 1868 | SafeNativeMethods.BodyDisable(Body); |
1872 | } | 1869 | } |
1873 | } | 1870 | } |
1874 | } | 1871 | } |
@@ -1896,41 +1893,41 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1896 | m_log.Warn("[PHYSICS]: MakeBody called having a body"); | 1893 | m_log.Warn("[PHYSICS]: MakeBody called having a body"); |
1897 | } | 1894 | } |
1898 | 1895 | ||
1899 | if (d.GeomGetBody(prim_geom) != IntPtr.Zero) | 1896 | if (SafeNativeMethods.GeomGetBody(prim_geom) != IntPtr.Zero) |
1900 | { | 1897 | { |
1901 | d.GeomSetBody(prim_geom, IntPtr.Zero); | 1898 | SafeNativeMethods.GeomSetBody(prim_geom, IntPtr.Zero); |
1902 | m_log.Warn("[PHYSICS]: MakeBody root geom already had a body"); | 1899 | m_log.Warn("[PHYSICS]: MakeBody root geom already had a body"); |
1903 | } | 1900 | } |
1904 | 1901 | ||
1905 | bool noInertiaOverride = (m_InertiaOverride == null); | 1902 | bool noInertiaOverride = (m_InertiaOverride == null); |
1906 | 1903 | ||
1907 | Body = d.BodyCreate(_parent_scene.world); | 1904 | Body = SafeNativeMethods.BodyCreate(_parent_scene.world); |
1908 | 1905 | ||
1909 | d.Matrix3 mymat = new d.Matrix3(); | 1906 | SafeNativeMethods.Matrix3 mymat = new SafeNativeMethods.Matrix3(); |
1910 | d.Quaternion myrot = new d.Quaternion(); | 1907 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
1911 | d.Mass objdmass = new d.Mass { }; | 1908 | SafeNativeMethods.Mass objdmass = new SafeNativeMethods.Mass { }; |
1912 | 1909 | ||
1913 | myrot.X = _orientation.X; | 1910 | myrot.X = _orientation.X; |
1914 | myrot.Y = _orientation.Y; | 1911 | myrot.Y = _orientation.Y; |
1915 | myrot.Z = _orientation.Z; | 1912 | myrot.Z = _orientation.Z; |
1916 | myrot.W = _orientation.W; | 1913 | myrot.W = _orientation.W; |
1917 | d.RfromQ(out mymat, ref myrot); | 1914 | SafeNativeMethods.RfromQ(out mymat, ref myrot); |
1918 | 1915 | ||
1919 | // set the body rotation | 1916 | // set the body rotation |
1920 | d.BodySetRotation(Body, ref mymat); | 1917 | SafeNativeMethods.BodySetRotation(Body, ref mymat); |
1921 | 1918 | ||
1922 | if(noInertiaOverride) | 1919 | if(noInertiaOverride) |
1923 | { | 1920 | { |
1924 | objdmass = primdMass; | 1921 | objdmass = primdMass; |
1925 | d.MassRotate(ref objdmass, ref mymat); | 1922 | SafeNativeMethods.MassRotate(ref objdmass, ref mymat); |
1926 | } | 1923 | } |
1927 | 1924 | ||
1928 | // recompute full object inertia if needed | 1925 | // recompute full object inertia if needed |
1929 | if (childrenPrim.Count > 0) | 1926 | if (childrenPrim.Count > 0) |
1930 | { | 1927 | { |
1931 | d.Matrix3 mat = new d.Matrix3(); | 1928 | SafeNativeMethods.Matrix3 mat = new SafeNativeMethods.Matrix3(); |
1932 | d.Quaternion quat = new d.Quaternion(); | 1929 | SafeNativeMethods.Quaternion quat = new SafeNativeMethods.Quaternion(); |
1933 | d.Mass tmpdmass = new d.Mass { }; | 1930 | SafeNativeMethods.Mass tmpdmass = new SafeNativeMethods.Mass { }; |
1934 | Vector3 rcm; | 1931 | Vector3 rcm; |
1935 | 1932 | ||
1936 | rcm.X = _position.X; | 1933 | rcm.X = _position.X; |
@@ -1951,70 +1948,70 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1951 | quat.Y = prm._orientation.Y; | 1948 | quat.Y = prm._orientation.Y; |
1952 | quat.Z = prm._orientation.Z; | 1949 | quat.Z = prm._orientation.Z; |
1953 | quat.W = prm._orientation.W; | 1950 | quat.W = prm._orientation.W; |
1954 | d.RfromQ(out mat, ref quat); | 1951 | SafeNativeMethods.RfromQ(out mat, ref quat); |
1955 | 1952 | ||
1956 | // fix prim colision cats | 1953 | // fix prim colision cats |
1957 | 1954 | ||
1958 | if (d.GeomGetBody(prm.prim_geom) != IntPtr.Zero) | 1955 | if (SafeNativeMethods.GeomGetBody(prm.prim_geom) != IntPtr.Zero) |
1959 | { | 1956 | { |
1960 | d.GeomSetBody(prm.prim_geom, IntPtr.Zero); | 1957 | SafeNativeMethods.GeomSetBody(prm.prim_geom, IntPtr.Zero); |
1961 | m_log.Warn("[PHYSICS]: MakeBody child geom already had a body"); | 1958 | m_log.Warn("[PHYSICS]: MakeBody child geom already had a body"); |
1962 | } | 1959 | } |
1963 | 1960 | ||
1964 | d.GeomClearOffset(prm.prim_geom); | 1961 | SafeNativeMethods.GeomClearOffset(prm.prim_geom); |
1965 | d.GeomSetBody(prm.prim_geom, Body); | 1962 | SafeNativeMethods.GeomSetBody(prm.prim_geom, Body); |
1966 | prm.Body = Body; | 1963 | prm.Body = Body; |
1967 | d.GeomSetOffsetWorldRotation(prm.prim_geom, ref mat); // set relative rotation | 1964 | SafeNativeMethods.GeomSetOffsetWorldRotation(prm.prim_geom, ref mat); // set relative rotation |
1968 | 1965 | ||
1969 | if(noInertiaOverride) | 1966 | if(noInertiaOverride) |
1970 | { | 1967 | { |
1971 | tmpdmass = prm.primdMass; | 1968 | tmpdmass = prm.primdMass; |
1972 | 1969 | ||
1973 | d.MassRotate(ref tmpdmass, ref mat); | 1970 | SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); |
1974 | Vector3 ppos = prm._position; | 1971 | Vector3 ppos = prm._position; |
1975 | ppos.X -= rcm.X; | 1972 | ppos.X -= rcm.X; |
1976 | ppos.Y -= rcm.Y; | 1973 | ppos.Y -= rcm.Y; |
1977 | ppos.Z -= rcm.Z; | 1974 | ppos.Z -= rcm.Z; |
1978 | // refer inertia to root prim center of mass position | 1975 | // refer inertia to root prim center of mass position |
1979 | d.MassTranslate(ref tmpdmass, | 1976 | SafeNativeMethods.MassTranslate(ref tmpdmass, |
1980 | ppos.X, | 1977 | ppos.X, |
1981 | ppos.Y, | 1978 | ppos.Y, |
1982 | ppos.Z); | 1979 | ppos.Z); |
1983 | 1980 | ||
1984 | d.MassAdd(ref objdmass, ref tmpdmass); // add to total object inertia | 1981 | SafeNativeMethods.MassAdd(ref objdmass, ref tmpdmass); // add to total object inertia |
1985 | } | 1982 | } |
1986 | } | 1983 | } |
1987 | } | 1984 | } |
1988 | } | 1985 | } |
1989 | 1986 | ||
1990 | d.GeomClearOffset(prim_geom); // make sure we don't have a hidden offset | 1987 | SafeNativeMethods.GeomClearOffset(prim_geom); // make sure we don't have a hidden offset |
1991 | // associate root geom with body | 1988 | // associate root geom with body |
1992 | d.GeomSetBody(prim_geom, Body); | 1989 | SafeNativeMethods.GeomSetBody(prim_geom, Body); |
1993 | 1990 | ||
1994 | if(noInertiaOverride) | 1991 | if(noInertiaOverride) |
1995 | d.BodySetPosition(Body, _position.X + objdmass.c.X, _position.Y + objdmass.c.Y, _position.Z + objdmass.c.Z); | 1992 | SafeNativeMethods.BodySetPosition(Body, _position.X + objdmass.c.X, _position.Y + objdmass.c.Y, _position.Z + objdmass.c.Z); |
1996 | else | 1993 | else |
1997 | { | 1994 | { |
1998 | Vector3 ncm = m_InertiaOverride.CenterOfMass * _orientation; | 1995 | Vector3 ncm = m_InertiaOverride.CenterOfMass * _orientation; |
1999 | d.BodySetPosition(Body, | 1996 | SafeNativeMethods.BodySetPosition(Body, |
2000 | _position.X + ncm.X, | 1997 | _position.X + ncm.X, |
2001 | _position.Y + ncm.Y, | 1998 | _position.Y + ncm.Y, |
2002 | _position.Z + ncm.Z); | 1999 | _position.Z + ncm.Z); |
2003 | } | 2000 | } |
2004 | 2001 | ||
2005 | d.GeomSetOffsetWorldPosition(prim_geom, _position.X, _position.Y, _position.Z); | 2002 | SafeNativeMethods.GeomSetOffsetWorldPosition(prim_geom, _position.X, _position.Y, _position.Z); |
2006 | 2003 | ||
2007 | if(noInertiaOverride) | 2004 | if(noInertiaOverride) |
2008 | { | 2005 | { |
2009 | d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body | 2006 | SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body |
2010 | myrot.X = -myrot.X; | 2007 | myrot.X = -myrot.X; |
2011 | myrot.Y = -myrot.Y; | 2008 | myrot.Y = -myrot.Y; |
2012 | myrot.Z = -myrot.Z; | 2009 | myrot.Z = -myrot.Z; |
2013 | 2010 | ||
2014 | d.RfromQ(out mymat, ref myrot); | 2011 | SafeNativeMethods.RfromQ(out mymat, ref myrot); |
2015 | d.MassRotate(ref objdmass, ref mymat); | 2012 | SafeNativeMethods.MassRotate(ref objdmass, ref mymat); |
2016 | 2013 | ||
2017 | d.BodySetMass(Body, ref objdmass); | 2014 | SafeNativeMethods.BodySetMass(Body, ref objdmass); |
2018 | m_mass = objdmass.mass; | 2015 | m_mass = objdmass.mass; |
2019 | } | 2016 | } |
2020 | else | 2017 | else |
@@ -2031,35 +2028,35 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2031 | 2028 | ||
2032 | if(Math.Abs(m_InertiaOverride.InertiaRotation.W) < 0.999) | 2029 | if(Math.Abs(m_InertiaOverride.InertiaRotation.W) < 0.999) |
2033 | { | 2030 | { |
2034 | d.Matrix3 inertiarotmat = new d.Matrix3(); | 2031 | SafeNativeMethods.Matrix3 inertiarotmat = new SafeNativeMethods.Matrix3(); |
2035 | d.Quaternion inertiarot = new d.Quaternion(); | 2032 | SafeNativeMethods.Quaternion inertiarot = new SafeNativeMethods.Quaternion(); |
2036 | 2033 | ||
2037 | inertiarot.X = m_InertiaOverride.InertiaRotation.X; | 2034 | inertiarot.X = m_InertiaOverride.InertiaRotation.X; |
2038 | inertiarot.Y = m_InertiaOverride.InertiaRotation.Y; | 2035 | inertiarot.Y = m_InertiaOverride.InertiaRotation.Y; |
2039 | inertiarot.Z = m_InertiaOverride.InertiaRotation.Z; | 2036 | inertiarot.Z = m_InertiaOverride.InertiaRotation.Z; |
2040 | inertiarot.W = m_InertiaOverride.InertiaRotation.W; | 2037 | inertiarot.W = m_InertiaOverride.InertiaRotation.W; |
2041 | d.RfromQ(out inertiarotmat, ref inertiarot); | 2038 | SafeNativeMethods.RfromQ(out inertiarotmat, ref inertiarot); |
2042 | d.MassRotate(ref objdmass, ref inertiarotmat); | 2039 | SafeNativeMethods.MassRotate(ref objdmass, ref inertiarotmat); |
2043 | } | 2040 | } |
2044 | d.BodySetMass(Body, ref objdmass); | 2041 | SafeNativeMethods.BodySetMass(Body, ref objdmass); |
2045 | 2042 | ||
2046 | m_mass = objdmass.mass; | 2043 | m_mass = objdmass.mass; |
2047 | } | 2044 | } |
2048 | 2045 | ||
2049 | // disconnect from world gravity so we can apply buoyancy | 2046 | // disconnect from world gravity so we can apply buoyancy |
2050 | d.BodySetGravityMode(Body, false); | 2047 | SafeNativeMethods.BodySetGravityMode(Body, false); |
2051 | 2048 | ||
2052 | d.BodySetAutoDisableFlag(Body, true); | 2049 | SafeNativeMethods.BodySetAutoDisableFlag(Body, true); |
2053 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 2050 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
2054 | d.BodySetAutoDisableAngularThreshold(Body, 0.05f); | 2051 | SafeNativeMethods.BodySetAutoDisableAngularThreshold(Body, 0.05f); |
2055 | d.BodySetAutoDisableLinearThreshold(Body, 0.05f); | 2052 | SafeNativeMethods.BodySetAutoDisableLinearThreshold(Body, 0.05f); |
2056 | d.BodySetDamping(Body, .004f, .001f); | 2053 | SafeNativeMethods.BodySetDamping(Body, .004f, .001f); |
2057 | 2054 | ||
2058 | if (m_targetSpace != IntPtr.Zero) | 2055 | if (m_targetSpace != IntPtr.Zero) |
2059 | { | 2056 | { |
2060 | _parent_scene.waitForSpaceUnlock(m_targetSpace); | 2057 | _parent_scene.waitForSpaceUnlock(m_targetSpace); |
2061 | if (d.SpaceQuery(m_targetSpace, prim_geom)) | 2058 | if (SafeNativeMethods.SpaceQuery(m_targetSpace, prim_geom)) |
2062 | d.SpaceRemove(m_targetSpace, prim_geom); | 2059 | SafeNativeMethods.SpaceRemove(m_targetSpace, prim_geom); |
2063 | } | 2060 | } |
2064 | 2061 | ||
2065 | if (childrenPrim.Count == 0) | 2062 | if (childrenPrim.Count == 0) |
@@ -2069,20 +2066,23 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2069 | } | 2066 | } |
2070 | else | 2067 | else |
2071 | { | 2068 | { |
2072 | m_targetSpace = d.SimpleSpaceCreate(_parent_scene.ActiveSpace); | 2069 | m_targetSpace = SafeNativeMethods.SimpleSpaceCreate(_parent_scene.ActiveSpace); |
2073 | d.SpaceSetSublevel(m_targetSpace, 3); | 2070 | SafeNativeMethods.SpaceSetSublevel(m_targetSpace, 3); |
2074 | d.SpaceSetCleanup(m_targetSpace, false); | 2071 | SafeNativeMethods.SpaceSetCleanup(m_targetSpace, false); |
2075 | 2072 | ||
2076 | d.GeomSetCategoryBits(m_targetSpace, (uint)(CollisionCategories.Space | | 2073 | SafeNativeMethods.GeomSetCategoryBits(m_targetSpace, (uint)(CollisionCategories.Space | |
2077 | CollisionCategories.Geom | | 2074 | CollisionCategories.Geom | |
2078 | CollisionCategories.Phantom | | 2075 | CollisionCategories.Phantom | |
2079 | CollisionCategories.VolumeDtc | 2076 | CollisionCategories.VolumeDtc |
2080 | )); | 2077 | )); |
2081 | d.GeomSetCollideBits(m_targetSpace, 0); | 2078 | SafeNativeMethods.GeomSetCollideBits(m_targetSpace, 0); |
2082 | collide_geom = m_targetSpace; | 2079 | collide_geom = m_targetSpace; |
2083 | } | 2080 | } |
2084 | 2081 | ||
2085 | d.SpaceAdd(m_targetSpace, prim_geom); | 2082 | if (SafeNativeMethods.SpaceQuery(m_targetSpace, prim_geom)) |
2083 | m_log.Debug("[PRIM]: parent already in target space"); | ||
2084 | else | ||
2085 | SafeNativeMethods.SpaceAdd(m_targetSpace, prim_geom); | ||
2086 | 2086 | ||
2087 | if (m_delaySelect) | 2087 | if (m_delaySelect) |
2088 | { | 2088 | { |
@@ -2101,22 +2101,27 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2101 | { | 2101 | { |
2102 | foreach (OdePrim prm in childrenPrim) | 2102 | foreach (OdePrim prm in childrenPrim) |
2103 | { | 2103 | { |
2104 | if (prm.prim_geom == IntPtr.Zero) | 2104 | IntPtr prmgeom = prm.prim_geom; |
2105 | if (prmgeom == IntPtr.Zero) | ||
2105 | continue; | 2106 | continue; |
2106 | 2107 | ||
2107 | Vector3 ppos = prm._position; | 2108 | Vector3 ppos = prm._position; |
2108 | d.GeomSetOffsetWorldPosition(prm.prim_geom, ppos.X, ppos.Y, ppos.Z); // set relative position | 2109 | SafeNativeMethods.GeomSetOffsetWorldPosition(prm.prim_geom, ppos.X, ppos.Y, ppos.Z); // set relative position |
2109 | 2110 | ||
2110 | if (prm.m_targetSpace != m_targetSpace) | 2111 | IntPtr prmspace = prm.m_targetSpace; |
2112 | if (prmspace != m_targetSpace) | ||
2111 | { | 2113 | { |
2112 | if (prm.m_targetSpace != IntPtr.Zero) | 2114 | if (prmspace != IntPtr.Zero) |
2113 | { | 2115 | { |
2114 | _parent_scene.waitForSpaceUnlock(prm.m_targetSpace); | 2116 | _parent_scene.waitForSpaceUnlock(prmspace); |
2115 | if (d.SpaceQuery(prm.m_targetSpace, prm.prim_geom)) | 2117 | if (SafeNativeMethods.SpaceQuery(prmspace, prmgeom)) |
2116 | d.SpaceRemove(prm.m_targetSpace, prm.prim_geom); | 2118 | SafeNativeMethods.SpaceRemove(prmspace, prmgeom); |
2117 | } | 2119 | } |
2118 | prm.m_targetSpace = m_targetSpace; | 2120 | prm.m_targetSpace = m_targetSpace; |
2119 | d.SpaceAdd(m_targetSpace, prm.prim_geom); | 2121 | if (SafeNativeMethods.SpaceQuery(m_targetSpace, prmgeom)) |
2122 | m_log.Debug("[PRIM]: child already in target space"); | ||
2123 | else | ||
2124 | SafeNativeMethods.SpaceAdd(m_targetSpace, prmgeom); | ||
2120 | } | 2125 | } |
2121 | 2126 | ||
2122 | prm.m_collisionscore = 0; | 2127 | prm.m_collisionscore = 0; |
@@ -2136,13 +2141,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2136 | 2141 | ||
2137 | if (m_isSelected || m_disabled) | 2142 | if (m_isSelected || m_disabled) |
2138 | { | 2143 | { |
2139 | d.BodyDisable(Body); | 2144 | SafeNativeMethods.BodyDisable(Body); |
2140 | _zeroFlag = true; | 2145 | _zeroFlag = true; |
2141 | } | 2146 | } |
2142 | else | 2147 | else |
2143 | { | 2148 | { |
2144 | d.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z); | 2149 | SafeNativeMethods.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z); |
2145 | d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z); | 2150 | SafeNativeMethods.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z); |
2146 | 2151 | ||
2147 | _zeroFlag = false; | 2152 | _zeroFlag = false; |
2148 | m_bodydisablecontrol = 0; | 2153 | m_bodydisablecontrol = 0; |
@@ -2175,16 +2180,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2175 | { | 2180 | { |
2176 | if (m_NoColide) | 2181 | if (m_NoColide) |
2177 | { | 2182 | { |
2178 | d.GeomSetCategoryBits(prim_geom, 0); | 2183 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); |
2179 | d.GeomSetCollideBits(prim_geom, 0); | 2184 | SafeNativeMethods.GeomSetCollideBits(prim_geom, 0); |
2180 | } | 2185 | } |
2181 | else | 2186 | else |
2182 | { | 2187 | { |
2183 | d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); | 2188 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); |
2184 | d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); | 2189 | SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); |
2185 | } | 2190 | } |
2186 | UpdateDataFromGeom(); | 2191 | UpdateDataFromGeom(); |
2187 | d.GeomSetBody(prim_geom, IntPtr.Zero); | 2192 | SafeNativeMethods.GeomSetBody(prim_geom, IntPtr.Zero); |
2188 | SetInStaticSpace(this); | 2193 | SetInStaticSpace(this); |
2189 | } | 2194 | } |
2190 | 2195 | ||
@@ -2211,13 +2216,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2211 | { | 2216 | { |
2212 | if (prm.m_NoColide) | 2217 | if (prm.m_NoColide) |
2213 | { | 2218 | { |
2214 | d.GeomSetCategoryBits(prm.prim_geom, 0); | 2219 | SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, 0); |
2215 | d.GeomSetCollideBits(prm.prim_geom, 0); | 2220 | SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, 0); |
2216 | } | 2221 | } |
2217 | else | 2222 | else |
2218 | { | 2223 | { |
2219 | d.GeomSetCategoryBits(prm.prim_geom, (uint)prm.m_collisionCategories); | 2224 | SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, (uint)prm.m_collisionCategories); |
2220 | d.GeomSetCollideBits(prm.prim_geom, (uint)prm.m_collisionFlags); | 2225 | SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, (uint)prm.m_collisionFlags); |
2221 | } | 2226 | } |
2222 | prm.UpdateDataFromGeom(); | 2227 | prm.UpdateDataFromGeom(); |
2223 | SetInStaticSpace(prm); | 2228 | SetInStaticSpace(prm); |
@@ -2229,11 +2234,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2229 | } | 2234 | } |
2230 | if (Amotor != IntPtr.Zero) | 2235 | if (Amotor != IntPtr.Zero) |
2231 | { | 2236 | { |
2232 | d.JointDestroy(Amotor); | 2237 | SafeNativeMethods.JointDestroy(Amotor); |
2233 | Amotor = IntPtr.Zero; | 2238 | Amotor = IntPtr.Zero; |
2234 | } | 2239 | } |
2235 | _parent_scene.remActiveGroup(this); | 2240 | _parent_scene.remActiveGroup(this); |
2236 | d.BodyDestroy(Body); | 2241 | SafeNativeMethods.BodyDestroy(Body); |
2237 | } | 2242 | } |
2238 | Body = IntPtr.Zero; | 2243 | Body = IntPtr.Zero; |
2239 | } | 2244 | } |
@@ -2243,30 +2248,30 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2243 | 2248 | ||
2244 | private void FixInertia(Vector3 NewPos,Quaternion newrot) | 2249 | private void FixInertia(Vector3 NewPos,Quaternion newrot) |
2245 | { | 2250 | { |
2246 | d.Matrix3 mat = new d.Matrix3(); | 2251 | SafeNativeMethods.Matrix3 mat = new SafeNativeMethods.Matrix3(); |
2247 | d.Quaternion quat = new d.Quaternion(); | 2252 | SafeNativeMethods.Quaternion quat = new SafeNativeMethods.Quaternion(); |
2248 | 2253 | ||
2249 | d.Mass tmpdmass = new d.Mass { }; | 2254 | SafeNativeMethods.Mass tmpdmass = new SafeNativeMethods.Mass { }; |
2250 | d.Mass objdmass = new d.Mass { }; | 2255 | SafeNativeMethods.Mass objdmass = new SafeNativeMethods.Mass { }; |
2251 | 2256 | ||
2252 | d.BodyGetMass(Body, out tmpdmass); | 2257 | SafeNativeMethods.BodyGetMass(Body, out tmpdmass); |
2253 | objdmass = tmpdmass; | 2258 | objdmass = tmpdmass; |
2254 | 2259 | ||
2255 | d.Vector3 dobjpos; | 2260 | SafeNativeMethods.Vector3 dobjpos; |
2256 | d.Vector3 thispos; | 2261 | SafeNativeMethods.Vector3 thispos; |
2257 | 2262 | ||
2258 | // get current object position and rotation | 2263 | // get current object position and rotation |
2259 | dobjpos = d.BodyGetPosition(Body); | 2264 | dobjpos = SafeNativeMethods.BodyGetPosition(Body); |
2260 | 2265 | ||
2261 | // get prim own inertia in its local frame | 2266 | // get prim own inertia in its local frame |
2262 | tmpdmass = primdMass; | 2267 | tmpdmass = primdMass; |
2263 | 2268 | ||
2264 | // transform to object frame | 2269 | // transform to object frame |
2265 | mat = d.GeomGetOffsetRotation(prim_geom); | 2270 | mat = SafeNativeMethods.GeomGetOffsetRotation(prim_geom); |
2266 | d.MassRotate(ref tmpdmass, ref mat); | 2271 | SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); |
2267 | 2272 | ||
2268 | thispos = d.GeomGetOffsetPosition(prim_geom); | 2273 | thispos = SafeNativeMethods.GeomGetOffsetPosition(prim_geom); |
2269 | d.MassTranslate(ref tmpdmass, | 2274 | SafeNativeMethods.MassTranslate(ref tmpdmass, |
2270 | thispos.X, | 2275 | thispos.X, |
2271 | thispos.Y, | 2276 | thispos.Y, |
2272 | thispos.Z); | 2277 | thispos.Z); |
@@ -2279,66 +2284,66 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2279 | 2284 | ||
2280 | // update to new position and orientation | 2285 | // update to new position and orientation |
2281 | _position = NewPos; | 2286 | _position = NewPos; |
2282 | d.GeomSetOffsetWorldPosition(prim_geom, NewPos.X, NewPos.Y, NewPos.Z); | 2287 | SafeNativeMethods.GeomSetOffsetWorldPosition(prim_geom, NewPos.X, NewPos.Y, NewPos.Z); |
2283 | _orientation = newrot; | 2288 | _orientation = newrot; |
2284 | quat.X = newrot.X; | 2289 | quat.X = newrot.X; |
2285 | quat.Y = newrot.Y; | 2290 | quat.Y = newrot.Y; |
2286 | quat.Z = newrot.Z; | 2291 | quat.Z = newrot.Z; |
2287 | quat.W = newrot.W; | 2292 | quat.W = newrot.W; |
2288 | d.GeomSetOffsetWorldQuaternion(prim_geom, ref quat); | 2293 | SafeNativeMethods.GeomSetOffsetWorldQuaternion(prim_geom, ref quat); |
2289 | 2294 | ||
2290 | mat = d.GeomGetOffsetRotation(prim_geom); | 2295 | mat = SafeNativeMethods.GeomGetOffsetRotation(prim_geom); |
2291 | d.MassRotate(ref tmpdmass, ref mat); | 2296 | SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); |
2292 | 2297 | ||
2293 | thispos = d.GeomGetOffsetPosition(prim_geom); | 2298 | thispos = SafeNativeMethods.GeomGetOffsetPosition(prim_geom); |
2294 | d.MassTranslate(ref tmpdmass, | 2299 | SafeNativeMethods.MassTranslate(ref tmpdmass, |
2295 | thispos.X, | 2300 | thispos.X, |
2296 | thispos.Y, | 2301 | thispos.Y, |
2297 | thispos.Z); | 2302 | thispos.Z); |
2298 | 2303 | ||
2299 | d.MassAdd(ref objdmass, ref tmpdmass); | 2304 | SafeNativeMethods.MassAdd(ref objdmass, ref tmpdmass); |
2300 | 2305 | ||
2301 | // fix all positions | 2306 | // fix all positions |
2302 | IntPtr g = d.BodyGetFirstGeom(Body); | 2307 | IntPtr g = SafeNativeMethods.BodyGetFirstGeom(Body); |
2303 | while (g != IntPtr.Zero) | 2308 | while (g != IntPtr.Zero) |
2304 | { | 2309 | { |
2305 | thispos = d.GeomGetOffsetPosition(g); | 2310 | thispos = SafeNativeMethods.GeomGetOffsetPosition(g); |
2306 | thispos.X -= objdmass.c.X; | 2311 | thispos.X -= objdmass.c.X; |
2307 | thispos.Y -= objdmass.c.Y; | 2312 | thispos.Y -= objdmass.c.Y; |
2308 | thispos.Z -= objdmass.c.Z; | 2313 | thispos.Z -= objdmass.c.Z; |
2309 | d.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); | 2314 | SafeNativeMethods.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); |
2310 | g = d.dBodyGetNextGeom(g); | 2315 | g = SafeNativeMethods.dBodyGetNextGeom(g); |
2311 | } | 2316 | } |
2312 | d.BodyVectorToWorld(Body,objdmass.c.X, objdmass.c.Y, objdmass.c.Z,out thispos); | 2317 | SafeNativeMethods.BodyVectorToWorld(Body,objdmass.c.X, objdmass.c.Y, objdmass.c.Z,out thispos); |
2313 | 2318 | ||
2314 | d.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); | 2319 | SafeNativeMethods.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); |
2315 | d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body | 2320 | SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body |
2316 | d.BodySetMass(Body, ref objdmass); | 2321 | SafeNativeMethods.BodySetMass(Body, ref objdmass); |
2317 | m_mass = objdmass.mass; | 2322 | m_mass = objdmass.mass; |
2318 | } | 2323 | } |
2319 | 2324 | ||
2320 | private void FixInertia(Vector3 NewPos) | 2325 | private void FixInertia(Vector3 NewPos) |
2321 | { | 2326 | { |
2322 | d.Matrix3 primmat = new d.Matrix3(); | 2327 | SafeNativeMethods.Matrix3 primmat = new SafeNativeMethods.Matrix3(); |
2323 | d.Mass tmpdmass = new d.Mass { }; | 2328 | SafeNativeMethods.Mass tmpdmass = new SafeNativeMethods.Mass { }; |
2324 | d.Mass objdmass = new d.Mass { }; | 2329 | SafeNativeMethods.Mass objdmass = new SafeNativeMethods.Mass { }; |
2325 | d.Mass primmass = new d.Mass { }; | 2330 | SafeNativeMethods.Mass primmass = new SafeNativeMethods.Mass { }; |
2326 | 2331 | ||
2327 | d.Vector3 dobjpos; | 2332 | SafeNativeMethods.Vector3 dobjpos; |
2328 | d.Vector3 thispos; | 2333 | SafeNativeMethods.Vector3 thispos; |
2329 | 2334 | ||
2330 | d.BodyGetMass(Body, out objdmass); | 2335 | SafeNativeMethods.BodyGetMass(Body, out objdmass); |
2331 | 2336 | ||
2332 | // get prim own inertia in its local frame | 2337 | // get prim own inertia in its local frame |
2333 | primmass = primdMass; | 2338 | primmass = primdMass; |
2334 | // transform to object frame | 2339 | // transform to object frame |
2335 | primmat = d.GeomGetOffsetRotation(prim_geom); | 2340 | primmat = SafeNativeMethods.GeomGetOffsetRotation(prim_geom); |
2336 | d.MassRotate(ref primmass, ref primmat); | 2341 | SafeNativeMethods.MassRotate(ref primmass, ref primmat); |
2337 | 2342 | ||
2338 | tmpdmass = primmass; | 2343 | tmpdmass = primmass; |
2339 | 2344 | ||
2340 | thispos = d.GeomGetOffsetPosition(prim_geom); | 2345 | thispos = SafeNativeMethods.GeomGetOffsetPosition(prim_geom); |
2341 | d.MassTranslate(ref tmpdmass, | 2346 | SafeNativeMethods.MassTranslate(ref tmpdmass, |
2342 | thispos.X, | 2347 | thispos.X, |
2343 | thispos.Y, | 2348 | thispos.Y, |
2344 | thispos.Z); | 2349 | thispos.Z); |
@@ -2348,58 +2353,58 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2348 | 2353 | ||
2349 | // update to new position | 2354 | // update to new position |
2350 | _position = NewPos; | 2355 | _position = NewPos; |
2351 | d.GeomSetOffsetWorldPosition(prim_geom, NewPos.X, NewPos.Y, NewPos.Z); | 2356 | SafeNativeMethods.GeomSetOffsetWorldPosition(prim_geom, NewPos.X, NewPos.Y, NewPos.Z); |
2352 | 2357 | ||
2353 | thispos = d.GeomGetOffsetPosition(prim_geom); | 2358 | thispos = SafeNativeMethods.GeomGetOffsetPosition(prim_geom); |
2354 | d.MassTranslate(ref primmass, | 2359 | SafeNativeMethods.MassTranslate(ref primmass, |
2355 | thispos.X, | 2360 | thispos.X, |
2356 | thispos.Y, | 2361 | thispos.Y, |
2357 | thispos.Z); | 2362 | thispos.Z); |
2358 | 2363 | ||
2359 | d.MassAdd(ref objdmass, ref primmass); | 2364 | SafeNativeMethods.MassAdd(ref objdmass, ref primmass); |
2360 | 2365 | ||
2361 | // fix all positions | 2366 | // fix all positions |
2362 | IntPtr g = d.BodyGetFirstGeom(Body); | 2367 | IntPtr g = SafeNativeMethods.BodyGetFirstGeom(Body); |
2363 | while (g != IntPtr.Zero) | 2368 | while (g != IntPtr.Zero) |
2364 | { | 2369 | { |
2365 | thispos = d.GeomGetOffsetPosition(g); | 2370 | thispos = SafeNativeMethods.GeomGetOffsetPosition(g); |
2366 | thispos.X -= objdmass.c.X; | 2371 | thispos.X -= objdmass.c.X; |
2367 | thispos.Y -= objdmass.c.Y; | 2372 | thispos.Y -= objdmass.c.Y; |
2368 | thispos.Z -= objdmass.c.Z; | 2373 | thispos.Z -= objdmass.c.Z; |
2369 | d.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); | 2374 | SafeNativeMethods.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); |
2370 | g = d.dBodyGetNextGeom(g); | 2375 | g = SafeNativeMethods.dBodyGetNextGeom(g); |
2371 | } | 2376 | } |
2372 | 2377 | ||
2373 | d.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); | 2378 | SafeNativeMethods.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); |
2374 | 2379 | ||
2375 | // get current object position and rotation | 2380 | // get current object position and rotation |
2376 | dobjpos = d.BodyGetPosition(Body); | 2381 | dobjpos = SafeNativeMethods.BodyGetPosition(Body); |
2377 | 2382 | ||
2378 | d.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); | 2383 | SafeNativeMethods.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); |
2379 | d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body | 2384 | SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body |
2380 | d.BodySetMass(Body, ref objdmass); | 2385 | SafeNativeMethods.BodySetMass(Body, ref objdmass); |
2381 | m_mass = objdmass.mass; | 2386 | m_mass = objdmass.mass; |
2382 | } | 2387 | } |
2383 | 2388 | ||
2384 | private void FixInertia(Quaternion newrot) | 2389 | private void FixInertia(Quaternion newrot) |
2385 | { | 2390 | { |
2386 | d.Matrix3 mat = new d.Matrix3(); | 2391 | SafeNativeMethods.Matrix3 mat = new SafeNativeMethods.Matrix3(); |
2387 | d.Quaternion quat = new d.Quaternion(); | 2392 | SafeNativeMethods.Quaternion quat = new SafeNativeMethods.Quaternion(); |
2388 | 2393 | ||
2389 | d.Mass tmpdmass = new d.Mass { }; | 2394 | SafeNativeMethods.Mass tmpdmass = new SafeNativeMethods.Mass { }; |
2390 | d.Mass objdmass = new d.Mass { }; | 2395 | SafeNativeMethods.Mass objdmass = new SafeNativeMethods.Mass { }; |
2391 | d.Vector3 dobjpos; | 2396 | SafeNativeMethods.Vector3 dobjpos; |
2392 | d.Vector3 thispos; | 2397 | SafeNativeMethods.Vector3 thispos; |
2393 | 2398 | ||
2394 | d.BodyGetMass(Body, out objdmass); | 2399 | SafeNativeMethods.BodyGetMass(Body, out objdmass); |
2395 | 2400 | ||
2396 | // get prim own inertia in its local frame | 2401 | // get prim own inertia in its local frame |
2397 | tmpdmass = primdMass; | 2402 | tmpdmass = primdMass; |
2398 | mat = d.GeomGetOffsetRotation(prim_geom); | 2403 | mat = SafeNativeMethods.GeomGetOffsetRotation(prim_geom); |
2399 | d.MassRotate(ref tmpdmass, ref mat); | 2404 | SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); |
2400 | // transform to object frame | 2405 | // transform to object frame |
2401 | thispos = d.GeomGetOffsetPosition(prim_geom); | 2406 | thispos = SafeNativeMethods.GeomGetOffsetPosition(prim_geom); |
2402 | d.MassTranslate(ref tmpdmass, | 2407 | SafeNativeMethods.MassTranslate(ref tmpdmass, |
2403 | thispos.X, | 2408 | thispos.X, |
2404 | thispos.Y, | 2409 | thispos.Y, |
2405 | thispos.Z); | 2410 | thispos.Z); |
@@ -2413,37 +2418,37 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2413 | quat.Y = newrot.Y; | 2418 | quat.Y = newrot.Y; |
2414 | quat.Z = newrot.Z; | 2419 | quat.Z = newrot.Z; |
2415 | quat.W = newrot.W; | 2420 | quat.W = newrot.W; |
2416 | d.GeomSetOffsetWorldQuaternion(prim_geom, ref quat); | 2421 | SafeNativeMethods.GeomSetOffsetWorldQuaternion(prim_geom, ref quat); |
2417 | 2422 | ||
2418 | tmpdmass = primdMass; | 2423 | tmpdmass = primdMass; |
2419 | mat = d.GeomGetOffsetRotation(prim_geom); | 2424 | mat = SafeNativeMethods.GeomGetOffsetRotation(prim_geom); |
2420 | d.MassRotate(ref tmpdmass, ref mat); | 2425 | SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); |
2421 | d.MassTranslate(ref tmpdmass, | 2426 | SafeNativeMethods.MassTranslate(ref tmpdmass, |
2422 | thispos.X, | 2427 | thispos.X, |
2423 | thispos.Y, | 2428 | thispos.Y, |
2424 | thispos.Z); | 2429 | thispos.Z); |
2425 | 2430 | ||
2426 | d.MassAdd(ref objdmass, ref tmpdmass); | 2431 | SafeNativeMethods.MassAdd(ref objdmass, ref tmpdmass); |
2427 | 2432 | ||
2428 | // fix all positions | 2433 | // fix all positions |
2429 | IntPtr g = d.BodyGetFirstGeom(Body); | 2434 | IntPtr g = SafeNativeMethods.BodyGetFirstGeom(Body); |
2430 | while (g != IntPtr.Zero) | 2435 | while (g != IntPtr.Zero) |
2431 | { | 2436 | { |
2432 | thispos = d.GeomGetOffsetPosition(g); | 2437 | thispos = SafeNativeMethods.GeomGetOffsetPosition(g); |
2433 | thispos.X -= objdmass.c.X; | 2438 | thispos.X -= objdmass.c.X; |
2434 | thispos.Y -= objdmass.c.Y; | 2439 | thispos.Y -= objdmass.c.Y; |
2435 | thispos.Z -= objdmass.c.Z; | 2440 | thispos.Z -= objdmass.c.Z; |
2436 | d.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); | 2441 | SafeNativeMethods.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); |
2437 | g = d.dBodyGetNextGeom(g); | 2442 | g = SafeNativeMethods.dBodyGetNextGeom(g); |
2438 | } | 2443 | } |
2439 | 2444 | ||
2440 | d.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); | 2445 | SafeNativeMethods.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); |
2441 | // get current object position and rotation | 2446 | // get current object position and rotation |
2442 | dobjpos = d.BodyGetPosition(Body); | 2447 | dobjpos = SafeNativeMethods.BodyGetPosition(Body); |
2443 | 2448 | ||
2444 | d.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); | 2449 | SafeNativeMethods.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); |
2445 | d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body | 2450 | SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body |
2446 | d.BodySetMass(Body, ref objdmass); | 2451 | SafeNativeMethods.BodySetMass(Body, ref objdmass); |
2447 | m_mass = objdmass.mass; | 2452 | m_mass = objdmass.mass; |
2448 | } | 2453 | } |
2449 | 2454 | ||
@@ -2461,9 +2466,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2461 | 2466 | ||
2462 | m_mass = primMass; // just in case | 2467 | m_mass = primMass; // just in case |
2463 | 2468 | ||
2464 | d.MassSetBoxTotal(out primdMass, primMass, 2.0f * m_OBB.X, 2.0f * m_OBB.Y, 2.0f * m_OBB.Z); | 2469 | SafeNativeMethods.MassSetBoxTotal(out primdMass, primMass, 2.0f * m_OBB.X, 2.0f * m_OBB.Y, 2.0f * m_OBB.Z); |
2465 | 2470 | ||
2466 | d.MassTranslate(ref primdMass, | 2471 | SafeNativeMethods.MassTranslate(ref primdMass, |
2467 | m_OBBOffset.X, | 2472 | m_OBBOffset.X, |
2468 | m_OBBOffset.Y, | 2473 | m_OBBOffset.Y, |
2469 | m_OBBOffset.Z); | 2474 | m_OBBOffset.Z); |
@@ -2518,7 +2523,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2518 | if (prm.Body != IntPtr.Zero) | 2523 | if (prm.Body != IntPtr.Zero) |
2519 | { | 2524 | { |
2520 | if (prm.prim_geom != IntPtr.Zero) | 2525 | if (prm.prim_geom != IntPtr.Zero) |
2521 | d.GeomSetBody(prm.prim_geom, IntPtr.Zero); | 2526 | SafeNativeMethods.GeomSetBody(prm.prim_geom, IntPtr.Zero); |
2522 | if (prm.Body != prim.Body) | 2527 | if (prm.Body != prim.Body) |
2523 | prm.DestroyBody(); // don't loose bodies around | 2528 | prm.DestroyBody(); // don't loose bodies around |
2524 | prm.Body = IntPtr.Zero; | 2529 | prm.Body = IntPtr.Zero; |
@@ -2535,7 +2540,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2535 | if (prim.Body != IntPtr.Zero) | 2540 | if (prim.Body != IntPtr.Zero) |
2536 | { | 2541 | { |
2537 | if (prim.prim_geom != IntPtr.Zero) | 2542 | if (prim.prim_geom != IntPtr.Zero) |
2538 | d.GeomSetBody(prim.prim_geom, IntPtr.Zero); | 2543 | SafeNativeMethods.GeomSetBody(prim.prim_geom, IntPtr.Zero); |
2539 | prim.DestroyBody(); // don't loose bodies around | 2544 | prim.DestroyBody(); // don't loose bodies around |
2540 | prim.Body = IntPtr.Zero; | 2545 | prim.Body = IntPtr.Zero; |
2541 | } | 2546 | } |
@@ -2560,8 +2565,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2560 | { | 2565 | { |
2561 | if (prim_geom != IntPtr.Zero) | 2566 | if (prim_geom != IntPtr.Zero) |
2562 | { | 2567 | { |
2563 | d.Quaternion qtmp; | 2568 | SafeNativeMethods.Quaternion qtmp; |
2564 | d.GeomCopyQuaternion(prim_geom, out qtmp); | 2569 | SafeNativeMethods.GeomCopyQuaternion(prim_geom, out qtmp); |
2565 | _orientation.X = qtmp.X; | 2570 | _orientation.X = qtmp.X; |
2566 | _orientation.Y = qtmp.Y; | 2571 | _orientation.Y = qtmp.Y; |
2567 | _orientation.Z = qtmp.Z; | 2572 | _orientation.Z = qtmp.Z; |
@@ -2575,7 +2580,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2575 | */ | 2580 | */ |
2576 | _orientation.Normalize(); | 2581 | _orientation.Normalize(); |
2577 | 2582 | ||
2578 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); | 2583 | SafeNativeMethods.Vector3 lpos = SafeNativeMethods.GeomGetPosition(prim_geom); |
2579 | _position.X = lpos.X; | 2584 | _position.X = lpos.X; |
2580 | _position.Y = lpos.Y; | 2585 | _position.Y = lpos.Y; |
2581 | _position.Z = lpos.Z; | 2586 | _position.Z = lpos.Z; |
@@ -2704,7 +2709,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2704 | { | 2709 | { |
2705 | if (Amotor != IntPtr.Zero) | 2710 | if (Amotor != IntPtr.Zero) |
2706 | { | 2711 | { |
2707 | d.JointDestroy(Amotor); | 2712 | SafeNativeMethods.JointDestroy(Amotor); |
2708 | Amotor = IntPtr.Zero; | 2713 | Amotor = IntPtr.Zero; |
2709 | } | 2714 | } |
2710 | } | 2715 | } |
@@ -2761,10 +2766,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2761 | 2766 | ||
2762 | if (Body != IntPtr.Zero) | 2767 | if (Body != IntPtr.Zero) |
2763 | { | 2768 | { |
2764 | d.BodySetForce(Body, 0f, 0f, 0f); | 2769 | SafeNativeMethods.BodySetForce(Body, 0f, 0f, 0f); |
2765 | d.BodySetTorque(Body, 0f, 0f, 0f); | 2770 | SafeNativeMethods.BodySetTorque(Body, 0f, 0f, 0f); |
2766 | d.BodySetLinearVel(Body, 0f, 0f, 0f); | 2771 | SafeNativeMethods.BodySetLinearVel(Body, 0f, 0f, 0f); |
2767 | d.BodySetAngularVel(Body, 0f, 0f, 0f); | 2772 | SafeNativeMethods.BodySetAngularVel(Body, 0f, 0f, 0f); |
2768 | } | 2773 | } |
2769 | } | 2774 | } |
2770 | 2775 | ||
@@ -2826,7 +2831,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2826 | if (newval) | 2831 | if (newval) |
2827 | { | 2832 | { |
2828 | if (!childPrim && Body != IntPtr.Zero) | 2833 | if (!childPrim && Body != IntPtr.Zero) |
2829 | d.BodyDisable(Body); | 2834 | SafeNativeMethods.BodyDisable(Body); |
2830 | 2835 | ||
2831 | if (m_delaySelect || m_isphysical) | 2836 | if (m_delaySelect || m_isphysical) |
2832 | { | 2837 | { |
@@ -2845,13 +2850,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2845 | 2850 | ||
2846 | if (prm.m_NoColide) | 2851 | if (prm.m_NoColide) |
2847 | { | 2852 | { |
2848 | d.GeomSetCategoryBits(prm.prim_geom, 0); | 2853 | SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, 0); |
2849 | d.GeomSetCollideBits(prm.prim_geom, 0); | 2854 | SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, 0); |
2850 | } | 2855 | } |
2851 | else | 2856 | else |
2852 | { | 2857 | { |
2853 | d.GeomSetCategoryBits(prm.prim_geom, (uint)m_collisionCategories); | 2858 | SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, (uint)m_collisionCategories); |
2854 | d.GeomSetCollideBits(prm.prim_geom, (uint)m_collisionFlags); | 2859 | SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, (uint)m_collisionFlags); |
2855 | } | 2860 | } |
2856 | } | 2861 | } |
2857 | prm.m_delaySelect = false; | 2862 | prm.m_delaySelect = false; |
@@ -2865,23 +2870,23 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2865 | { | 2870 | { |
2866 | if (m_NoColide) | 2871 | if (m_NoColide) |
2867 | { | 2872 | { |
2868 | d.GeomSetCategoryBits(prim_geom, 0); | 2873 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); |
2869 | d.GeomSetCollideBits(prim_geom, 0); | 2874 | SafeNativeMethods.GeomSetCollideBits(prim_geom, 0); |
2870 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) | 2875 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) |
2871 | { | 2876 | { |
2872 | d.GeomSetCategoryBits(collide_geom, 0); | 2877 | SafeNativeMethods.GeomSetCategoryBits(collide_geom, 0); |
2873 | d.GeomSetCollideBits(collide_geom, 0); | 2878 | SafeNativeMethods.GeomSetCollideBits(collide_geom, 0); |
2874 | } | 2879 | } |
2875 | 2880 | ||
2876 | } | 2881 | } |
2877 | else | 2882 | else |
2878 | { | 2883 | { |
2879 | d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); | 2884 | SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); |
2880 | d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); | 2885 | SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); |
2881 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) | 2886 | if (collide_geom != prim_geom && collide_geom != IntPtr.Zero) |
2882 | { | 2887 | { |
2883 | d.GeomSetCategoryBits(collide_geom, (uint)m_collisionCategories); | 2888 | SafeNativeMethods.GeomSetCategoryBits(collide_geom, (uint)m_collisionCategories); |
2884 | d.GeomSetCollideBits(collide_geom, (uint)m_collisionFlags); | 2889 | SafeNativeMethods.GeomSetCollideBits(collide_geom, (uint)m_collisionFlags); |
2885 | } | 2890 | } |
2886 | } | 2891 | } |
2887 | } | 2892 | } |
@@ -2900,8 +2905,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2900 | if (Body != IntPtr.Zero && !m_disabled) | 2905 | if (Body != IntPtr.Zero && !m_disabled) |
2901 | { | 2906 | { |
2902 | _zeroFlag = true; | 2907 | _zeroFlag = true; |
2903 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 2908 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
2904 | d.BodyEnable(Body); | 2909 | SafeNativeMethods.BodyEnable(Body); |
2905 | } | 2910 | } |
2906 | } | 2911 | } |
2907 | // else if (_parent != null) | 2912 | // else if (_parent != null) |
@@ -2931,11 +2936,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2931 | else if (m_forcePosOrRotation && _position != newPos && Body != IntPtr.Zero) | 2936 | else if (m_forcePosOrRotation && _position != newPos && Body != IntPtr.Zero) |
2932 | { | 2937 | { |
2933 | FixInertia(newPos); | 2938 | FixInertia(newPos); |
2934 | if (!d.BodyIsEnabled(Body)) | 2939 | if (!SafeNativeMethods.BodyIsEnabled(Body)) |
2935 | { | 2940 | { |
2936 | _zeroFlag = true; | 2941 | _zeroFlag = true; |
2937 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 2942 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
2938 | d.BodyEnable(Body); | 2943 | SafeNativeMethods.BodyEnable(Body); |
2939 | } | 2944 | } |
2940 | } | 2945 | } |
2941 | } | 2946 | } |
@@ -2943,14 +2948,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2943 | { | 2948 | { |
2944 | if (_position != newPos) | 2949 | if (_position != newPos) |
2945 | { | 2950 | { |
2946 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); | 2951 | SafeNativeMethods.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); |
2947 | _position = newPos; | 2952 | _position = newPos; |
2948 | } | 2953 | } |
2949 | if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) | 2954 | if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) |
2950 | { | 2955 | { |
2951 | _zeroFlag = true; | 2956 | _zeroFlag = true; |
2952 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 2957 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
2953 | d.BodyEnable(Body); | 2958 | SafeNativeMethods.BodyEnable(Body); |
2954 | } | 2959 | } |
2955 | } | 2960 | } |
2956 | } | 2961 | } |
@@ -2960,7 +2965,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2960 | { | 2965 | { |
2961 | if (newPos != _position) | 2966 | if (newPos != _position) |
2962 | { | 2967 | { |
2963 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); | 2968 | SafeNativeMethods.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); |
2964 | _position = newPos; | 2969 | _position = newPos; |
2965 | 2970 | ||
2966 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, m_targetSpace); | 2971 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, m_targetSpace); |
@@ -2998,12 +3003,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2998 | { | 3003 | { |
2999 | if (newOri != _orientation) | 3004 | if (newOri != _orientation) |
3000 | { | 3005 | { |
3001 | d.Quaternion myrot = new d.Quaternion(); | 3006 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
3002 | myrot.X = newOri.X; | 3007 | myrot.X = newOri.X; |
3003 | myrot.Y = newOri.Y; | 3008 | myrot.Y = newOri.Y; |
3004 | myrot.Z = newOri.Z; | 3009 | myrot.Z = newOri.Z; |
3005 | myrot.W = newOri.W; | 3010 | myrot.W = newOri.W; |
3006 | d.GeomSetQuaternion(prim_geom, ref myrot); | 3011 | SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); |
3007 | _orientation = newOri; | 3012 | _orientation = newOri; |
3008 | 3013 | ||
3009 | if (Body != IntPtr.Zero) | 3014 | if (Body != IntPtr.Zero) |
@@ -3012,11 +3017,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3012 | createAMotor(m_angularlocks); | 3017 | createAMotor(m_angularlocks); |
3013 | } | 3018 | } |
3014 | } | 3019 | } |
3015 | if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) | 3020 | if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) |
3016 | { | 3021 | { |
3017 | _zeroFlag = true; | 3022 | _zeroFlag = true; |
3018 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3023 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3019 | d.BodyEnable(Body); | 3024 | SafeNativeMethods.BodyEnable(Body); |
3020 | } | 3025 | } |
3021 | } | 3026 | } |
3022 | } | 3027 | } |
@@ -3026,12 +3031,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3026 | { | 3031 | { |
3027 | if (newOri != _orientation) | 3032 | if (newOri != _orientation) |
3028 | { | 3033 | { |
3029 | d.Quaternion myrot = new d.Quaternion(); | 3034 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
3030 | myrot.X = newOri.X; | 3035 | myrot.X = newOri.X; |
3031 | myrot.Y = newOri.Y; | 3036 | myrot.Y = newOri.Y; |
3032 | myrot.Z = newOri.Z; | 3037 | myrot.Z = newOri.Z; |
3033 | myrot.W = newOri.W; | 3038 | myrot.W = newOri.W; |
3034 | d.GeomSetQuaternion(prim_geom, ref myrot); | 3039 | SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); |
3035 | _orientation = newOri; | 3040 | _orientation = newOri; |
3036 | } | 3041 | } |
3037 | } | 3042 | } |
@@ -3056,26 +3061,26 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3056 | { | 3061 | { |
3057 | if (newOri != _orientation) | 3062 | if (newOri != _orientation) |
3058 | { | 3063 | { |
3059 | d.Quaternion myrot = new d.Quaternion(); | 3064 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
3060 | myrot.X = newOri.X; | 3065 | myrot.X = newOri.X; |
3061 | myrot.Y = newOri.Y; | 3066 | myrot.Y = newOri.Y; |
3062 | myrot.Z = newOri.Z; | 3067 | myrot.Z = newOri.Z; |
3063 | myrot.W = newOri.W; | 3068 | myrot.W = newOri.W; |
3064 | d.GeomSetQuaternion(prim_geom, ref myrot); | 3069 | SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); |
3065 | _orientation = newOri; | 3070 | _orientation = newOri; |
3066 | if (Body != IntPtr.Zero && m_angularlocks != 0) | 3071 | if (Body != IntPtr.Zero && m_angularlocks != 0) |
3067 | createAMotor(m_angularlocks); | 3072 | createAMotor(m_angularlocks); |
3068 | } | 3073 | } |
3069 | if (_position != newPos) | 3074 | if (_position != newPos) |
3070 | { | 3075 | { |
3071 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); | 3076 | SafeNativeMethods.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); |
3072 | _position = newPos; | 3077 | _position = newPos; |
3073 | } | 3078 | } |
3074 | if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) | 3079 | if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) |
3075 | { | 3080 | { |
3076 | _zeroFlag = true; | 3081 | _zeroFlag = true; |
3077 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3082 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3078 | d.BodyEnable(Body); | 3083 | SafeNativeMethods.BodyEnable(Body); |
3079 | } | 3084 | } |
3080 | } | 3085 | } |
3081 | } | 3086 | } |
@@ -3088,18 +3093,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3088 | { | 3093 | { |
3089 | if (newOri != _orientation) | 3094 | if (newOri != _orientation) |
3090 | { | 3095 | { |
3091 | d.Quaternion myrot = new d.Quaternion(); | 3096 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
3092 | myrot.X = newOri.X; | 3097 | myrot.X = newOri.X; |
3093 | myrot.Y = newOri.Y; | 3098 | myrot.Y = newOri.Y; |
3094 | myrot.Z = newOri.Z; | 3099 | myrot.Z = newOri.Z; |
3095 | myrot.W = newOri.W; | 3100 | myrot.W = newOri.W; |
3096 | d.GeomSetQuaternion(prim_geom, ref myrot); | 3101 | SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); |
3097 | _orientation = newOri; | 3102 | _orientation = newOri; |
3098 | } | 3103 | } |
3099 | 3104 | ||
3100 | if (newPos != _position) | 3105 | if (newPos != _position) |
3101 | { | 3106 | { |
3102 | d.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); | 3107 | SafeNativeMethods.GeomSetPosition(prim_geom, newPos.X, newPos.Y, newPos.Z); |
3103 | _position = newPos; | 3108 | _position = newPos; |
3104 | 3109 | ||
3105 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, m_targetSpace); | 3110 | m_targetSpace = _parent_scene.MoveGeomToStaticSpace(prim_geom, m_targetSpace); |
@@ -3183,13 +3188,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3183 | 3188 | ||
3184 | if (prim_geom != IntPtr.Zero) | 3189 | if (prim_geom != IntPtr.Zero) |
3185 | { | 3190 | { |
3186 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); | 3191 | SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); |
3187 | d.Quaternion myrot = new d.Quaternion(); | 3192 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
3188 | myrot.X = _orientation.X; | 3193 | myrot.X = _orientation.X; |
3189 | myrot.Y = _orientation.Y; | 3194 | myrot.Y = _orientation.Y; |
3190 | myrot.Z = _orientation.Z; | 3195 | myrot.Z = _orientation.Z; |
3191 | myrot.W = _orientation.W; | 3196 | myrot.W = _orientation.W; |
3192 | d.GeomSetQuaternion(prim_geom, ref myrot); | 3197 | SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); |
3193 | } | 3198 | } |
3194 | 3199 | ||
3195 | if (!m_isphysical) | 3200 | if (!m_isphysical) |
@@ -3259,13 +3264,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3259 | 3264 | ||
3260 | if (prim_geom != IntPtr.Zero) | 3265 | if (prim_geom != IntPtr.Zero) |
3261 | { | 3266 | { |
3262 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); | 3267 | SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); |
3263 | d.Quaternion myrot = new d.Quaternion(); | 3268 | SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); |
3264 | myrot.X = _orientation.X; | 3269 | myrot.X = _orientation.X; |
3265 | myrot.Y = _orientation.Y; | 3270 | myrot.Y = _orientation.Y; |
3266 | myrot.Z = _orientation.Z; | 3271 | myrot.Z = _orientation.Z; |
3267 | myrot.W = _orientation.W; | 3272 | myrot.W = _orientation.W; |
3268 | d.GeomSetQuaternion(prim_geom, ref myrot); | 3273 | SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); |
3269 | } | 3274 | } |
3270 | 3275 | ||
3271 | if (m_isphysical) | 3276 | if (m_isphysical) |
@@ -3316,10 +3321,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3316 | { | 3321 | { |
3317 | if (m_disabled) | 3322 | if (m_disabled) |
3318 | enableBodySoft(); | 3323 | enableBodySoft(); |
3319 | else if (!d.BodyIsEnabled(Body)) | 3324 | else if (!SafeNativeMethods.BodyIsEnabled(Body)) |
3320 | { | 3325 | { |
3321 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3326 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3322 | d.BodyEnable(Body); | 3327 | SafeNativeMethods.BodyEnable(Body); |
3323 | } | 3328 | } |
3324 | } | 3329 | } |
3325 | m_torque = newtorque; | 3330 | m_torque = newtorque; |
@@ -3329,10 +3334,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3329 | private void changeForce(Vector3 force) | 3334 | private void changeForce(Vector3 force) |
3330 | { | 3335 | { |
3331 | m_force = force; | 3336 | m_force = force; |
3332 | if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) | 3337 | if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) |
3333 | { | 3338 | { |
3334 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3339 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3335 | d.BodyEnable(Body); | 3340 | SafeNativeMethods.BodyEnable(Body); |
3336 | } | 3341 | } |
3337 | } | 3342 | } |
3338 | 3343 | ||
@@ -3348,10 +3353,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3348 | { | 3353 | { |
3349 | if (m_disabled) | 3354 | if (m_disabled) |
3350 | enableBodySoft(); | 3355 | enableBodySoft(); |
3351 | else if (!d.BodyIsEnabled(Body)) | 3356 | else if (!SafeNativeMethods.BodyIsEnabled(Body)) |
3352 | { | 3357 | { |
3353 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3358 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3354 | d.BodyEnable(Body); | 3359 | SafeNativeMethods.BodyEnable(Body); |
3355 | } | 3360 | } |
3356 | } | 3361 | } |
3357 | } | 3362 | } |
@@ -3371,10 +3376,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3371 | { | 3376 | { |
3372 | if (m_disabled) | 3377 | if (m_disabled) |
3373 | enableBodySoft(); | 3378 | enableBodySoft(); |
3374 | else if (!d.BodyIsEnabled(Body)) | 3379 | else if (!SafeNativeMethods.BodyIsEnabled(Body)) |
3375 | { | 3380 | { |
3376 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3381 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3377 | d.BodyEnable(Body); | 3382 | SafeNativeMethods.BodyEnable(Body); |
3378 | } | 3383 | } |
3379 | } | 3384 | } |
3380 | } | 3385 | } |
@@ -3397,12 +3402,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3397 | { | 3402 | { |
3398 | if (m_disabled) | 3403 | if (m_disabled) |
3399 | enableBodySoft(); | 3404 | enableBodySoft(); |
3400 | else if (!d.BodyIsEnabled(Body)) | 3405 | else if (!SafeNativeMethods.BodyIsEnabled(Body)) |
3401 | { | 3406 | { |
3402 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3407 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3403 | d.BodyEnable(Body); | 3408 | SafeNativeMethods.BodyEnable(Body); |
3404 | } | 3409 | } |
3405 | d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); | 3410 | SafeNativeMethods.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); |
3406 | } | 3411 | } |
3407 | //resetCollisionAccounting(); | 3412 | //resetCollisionAccounting(); |
3408 | } | 3413 | } |
@@ -3424,12 +3429,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3424 | { | 3429 | { |
3425 | if (m_disabled) | 3430 | if (m_disabled) |
3426 | enableBodySoft(); | 3431 | enableBodySoft(); |
3427 | else if (!d.BodyIsEnabled(Body)) | 3432 | else if (!SafeNativeMethods.BodyIsEnabled(Body)) |
3428 | { | 3433 | { |
3429 | d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); | 3434 | SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); |
3430 | d.BodyEnable(Body); | 3435 | SafeNativeMethods.BodyEnable(Body); |
3431 | } | 3436 | } |
3432 | d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z); | 3437 | SafeNativeMethods.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z); |
3433 | } | 3438 | } |
3434 | //resetCollisionAccounting(); | 3439 | //resetCollisionAccounting(); |
3435 | } | 3440 | } |
@@ -3580,7 +3585,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3580 | if (!childPrim && m_isphysical && Body != IntPtr.Zero && | 3585 | if (!childPrim && m_isphysical && Body != IntPtr.Zero && |
3581 | !m_disabled && !m_isSelected && !m_building && !m_outbounds) | 3586 | !m_disabled && !m_isSelected && !m_building && !m_outbounds) |
3582 | { | 3587 | { |
3583 | if (!d.BodyIsEnabled(Body)) | 3588 | if (!SafeNativeMethods.BodyIsEnabled(Body)) |
3584 | { | 3589 | { |
3585 | // let vehicles sleep | 3590 | // let vehicles sleep |
3586 | if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) | 3591 | if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) |
@@ -3590,18 +3595,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3590 | return; | 3595 | return; |
3591 | 3596 | ||
3592 | // clear residuals | 3597 | // clear residuals |
3593 | d.BodySetAngularVel(Body,0f,0f,0f); | 3598 | SafeNativeMethods.BodySetAngularVel(Body,0f,0f,0f); |
3594 | d.BodySetLinearVel(Body,0f,0f,0f); | 3599 | SafeNativeMethods.BodySetLinearVel(Body,0f,0f,0f); |
3595 | _zeroFlag = true; | 3600 | _zeroFlag = true; |
3596 | d.BodySetAutoDisableSteps(Body, 1); | 3601 | SafeNativeMethods.BodySetAutoDisableSteps(Body, 1); |
3597 | d.BodyEnable(Body); | 3602 | SafeNativeMethods.BodyEnable(Body); |
3598 | m_bodydisablecontrol = -3; | 3603 | m_bodydisablecontrol = -3; |
3599 | } | 3604 | } |
3600 | 3605 | ||
3601 | if(m_bodydisablecontrol < 0) | 3606 | if(m_bodydisablecontrol < 0) |
3602 | m_bodydisablecontrol++; | 3607 | m_bodydisablecontrol++; |
3603 | 3608 | ||
3604 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); // root position that is seem by rest of simulator | 3609 | SafeNativeMethods.Vector3 lpos = SafeNativeMethods.GeomGetPosition(prim_geom); // root position that is seem by rest of simulator |
3605 | 3610 | ||
3606 | if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) | 3611 | if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) |
3607 | { | 3612 | { |
@@ -3628,8 +3633,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3628 | 3633 | ||
3629 | if (_target_velocity.ApproxEquals(Vector3.Zero, 0.02f)) | 3634 | if (_target_velocity.ApproxEquals(Vector3.Zero, 0.02f)) |
3630 | { | 3635 | { |
3631 | d.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); | 3636 | SafeNativeMethods.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); |
3632 | d.BodySetLinearVel(Body, 0, 0, 0); | 3637 | SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); |
3633 | return; | 3638 | return; |
3634 | } | 3639 | } |
3635 | else | 3640 | else |
@@ -3652,7 +3657,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3652 | _target_velocity *= tmp; | 3657 | _target_velocity *= tmp; |
3653 | } | 3658 | } |
3654 | 3659 | ||
3655 | d.Vector3 vel = d.BodyGetLinearVel(Body); | 3660 | SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); |
3656 | fx = (_target_velocity.X - vel.X) * m_invTimeStep; | 3661 | fx = (_target_velocity.X - vel.X) * m_invTimeStep; |
3657 | fy = (_target_velocity.Y - vel.Y) * m_invTimeStep; | 3662 | fy = (_target_velocity.Y - vel.Y) * m_invTimeStep; |
3658 | fz = (_target_velocity.Z - vel.Z) * m_invTimeStep; | 3663 | fz = (_target_velocity.Z - vel.Z) * m_invTimeStep; |
@@ -3688,15 +3693,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3688 | 3693 | ||
3689 | if (m_targetHoverHeight > m_groundHeight || m_isVolumeDetect) | 3694 | if (m_targetHoverHeight > m_groundHeight || m_isVolumeDetect) |
3690 | { | 3695 | { |
3691 | d.Vector3 vel = d.BodyGetLinearVel(Body); | 3696 | SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); |
3692 | 3697 | ||
3693 | fz = (m_targetHoverHeight - lpos.Z); | 3698 | fz = (m_targetHoverHeight - lpos.Z); |
3694 | 3699 | ||
3695 | // if error is zero, use position control; otherwise, velocity control | 3700 | // if error is zero, use position control; otherwise, velocity control |
3696 | if (Math.Abs(fz) < 0.01f) | 3701 | if (Math.Abs(fz) < 0.01f) |
3697 | { | 3702 | { |
3698 | d.BodySetPosition(Body, lpos.X, lpos.Y, m_targetHoverHeight); | 3703 | SafeNativeMethods.BodySetPosition(Body, lpos.X, lpos.Y, m_targetHoverHeight); |
3699 | d.BodySetLinearVel(Body, vel.X, vel.Y, 0); | 3704 | SafeNativeMethods.BodySetLinearVel(Body, vel.X, vel.Y, 0); |
3700 | } | 3705 | } |
3701 | else | 3706 | else |
3702 | { | 3707 | { |
@@ -3739,7 +3744,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3739 | //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); | 3744 | //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); |
3740 | if (fx != 0 || fy != 0 || fz != 0) | 3745 | if (fx != 0 || fy != 0 || fz != 0) |
3741 | { | 3746 | { |
3742 | d.BodyAddForce(Body, fx, fy, fz); | 3747 | SafeNativeMethods.BodyAddForce(Body, fx, fy, fz); |
3743 | //Console.WriteLine("AddForce " + fx + "," + fy + "," + fz); | 3748 | //Console.WriteLine("AddForce " + fx + "," + fy + "," + fz); |
3744 | } | 3749 | } |
3745 | 3750 | ||
@@ -3750,7 +3755,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3750 | m_angularForceacc = Vector3.Zero; | 3755 | m_angularForceacc = Vector3.Zero; |
3751 | if (trq.X != 0 || trq.Y != 0 || trq.Z != 0) | 3756 | if (trq.X != 0 || trq.Y != 0 || trq.Z != 0) |
3752 | { | 3757 | { |
3753 | d.BodyAddTorque(Body, trq.X, trq.Y, trq.Z); | 3758 | SafeNativeMethods.BodyAddTorque(Body, trq.X, trq.Y, trq.Z); |
3754 | } | 3759 | } |
3755 | } | 3760 | } |
3756 | else | 3761 | else |
@@ -3769,12 +3774,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3769 | if(m_bodydisablecontrol < 0) | 3774 | if(m_bodydisablecontrol < 0) |
3770 | return; | 3775 | return; |
3771 | 3776 | ||
3772 | bool bodyenabled = d.BodyIsEnabled(Body); | 3777 | bool bodyenabled = SafeNativeMethods.BodyIsEnabled(Body); |
3773 | if (bodyenabled || !_zeroFlag) | 3778 | if (bodyenabled || !_zeroFlag) |
3774 | { | 3779 | { |
3775 | bool lastZeroFlag = _zeroFlag; | 3780 | bool lastZeroFlag = _zeroFlag; |
3776 | 3781 | ||
3777 | d.Vector3 lpos = d.GeomGetPosition(prim_geom); | 3782 | SafeNativeMethods.Vector3 lpos = SafeNativeMethods.GeomGetPosition(prim_geom); |
3778 | 3783 | ||
3779 | // check outside region | 3784 | // check outside region |
3780 | if (lpos.Z < -100 || lpos.Z > 100000f) | 3785 | if (lpos.Z < -100 || lpos.Z > 100000f) |
@@ -3793,9 +3798,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3793 | m_rotationalVelocity.Y = 0; | 3798 | m_rotationalVelocity.Y = 0; |
3794 | m_rotationalVelocity.Z = 0; | 3799 | m_rotationalVelocity.Z = 0; |
3795 | 3800 | ||
3796 | d.BodySetLinearVel(Body, 0, 0, 0); // stop it | 3801 | SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it |
3797 | d.BodySetAngularVel(Body, 0, 0, 0); // stop it | 3802 | SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); // stop it |
3798 | d.BodySetPosition(Body, lpos.X, lpos.Y, lpos.Z); // put it somewhere | 3803 | SafeNativeMethods.BodySetPosition(Body, lpos.X, lpos.Y, lpos.Z); // put it somewhere |
3799 | m_lastposition = _position; | 3804 | m_lastposition = _position; |
3800 | m_lastorientation = _orientation; | 3805 | m_lastorientation = _orientation; |
3801 | 3806 | ||
@@ -3835,19 +3840,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3835 | m_lastposition = _position; | 3840 | m_lastposition = _position; |
3836 | m_lastorientation = _orientation; | 3841 | m_lastorientation = _orientation; |
3837 | 3842 | ||
3838 | d.Vector3 dtmp = d.BodyGetAngularVel(Body); | 3843 | SafeNativeMethods.Vector3 dtmp = SafeNativeMethods.BodyGetAngularVel(Body); |
3839 | m_rotationalVelocity.X = dtmp.X; | 3844 | m_rotationalVelocity.X = dtmp.X; |
3840 | m_rotationalVelocity.Y = dtmp.Y; | 3845 | m_rotationalVelocity.Y = dtmp.Y; |
3841 | m_rotationalVelocity.Z = dtmp.Z; | 3846 | m_rotationalVelocity.Z = dtmp.Z; |
3842 | 3847 | ||
3843 | dtmp = d.BodyGetLinearVel(Body); | 3848 | dtmp = SafeNativeMethods.BodyGetLinearVel(Body); |
3844 | _velocity.X = dtmp.X; | 3849 | _velocity.X = dtmp.X; |
3845 | _velocity.Y = dtmp.Y; | 3850 | _velocity.Y = dtmp.Y; |
3846 | _velocity.Z = dtmp.Z; | 3851 | _velocity.Z = dtmp.Z; |
3847 | 3852 | ||
3848 | d.BodySetLinearVel(Body, 0, 0, 0); // stop it | 3853 | SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it |
3849 | d.BodySetAngularVel(Body, 0, 0, 0); | 3854 | SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); |
3850 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); | 3855 | SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); |
3851 | disableBodySoft(); // stop collisions | 3856 | disableBodySoft(); // stop collisions |
3852 | UnSubscribeEvents(); | 3857 | UnSubscribeEvents(); |
3853 | 3858 | ||
@@ -3855,8 +3860,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3855 | return; | 3860 | return; |
3856 | } | 3861 | } |
3857 | 3862 | ||
3858 | d.Quaternion ori; | 3863 | SafeNativeMethods.Quaternion ori; |
3859 | d.GeomCopyQuaternion(prim_geom, out ori); | 3864 | SafeNativeMethods.GeomCopyQuaternion(prim_geom, out ori); |
3860 | 3865 | ||
3861 | // decide if moving | 3866 | // decide if moving |
3862 | // use positions since this are integrated quantities | 3867 | // use positions since this are integrated quantities |
@@ -3917,7 +3922,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3917 | } | 3922 | } |
3918 | else | 3923 | else |
3919 | { | 3924 | { |
3920 | d.Vector3 vel = d.BodyGetLinearVel(Body); | 3925 | SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); |
3921 | 3926 | ||
3922 | m_acceleration = _velocity; | 3927 | m_acceleration = _velocity; |
3923 | 3928 | ||
@@ -3944,7 +3949,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3944 | m_acceleration = Vector3.Zero; | 3949 | m_acceleration = Vector3.Zero; |
3945 | } | 3950 | } |
3946 | 3951 | ||
3947 | vel = d.BodyGetAngularVel(Body); | 3952 | vel = SafeNativeMethods.BodyGetAngularVel(Body); |
3948 | if ((Math.Abs(vel.X) < 0.0001) && | 3953 | if ((Math.Abs(vel.X) < 0.0001) && |
3949 | (Math.Abs(vel.Y) < 0.0001) && | 3954 | (Math.Abs(vel.Y) < 0.0001) && |
3950 | (Math.Abs(vel.Z) < 0.0001) | 3955 | (Math.Abs(vel.Z) < 0.0001) |
@@ -3990,7 +3995,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
3990 | return true; | 3995 | return true; |
3991 | } | 3996 | } |
3992 | 3997 | ||
3993 | internal static void DMassSubPartFromObj(ref d.Mass part, ref d.Mass theobj) | 3998 | internal static void DMassSubPartFromObj(ref SafeNativeMethods.Mass part, ref SafeNativeMethods.Mass theobj) |
3994 | { | 3999 | { |
3995 | // assumes object center of mass is zero | 4000 | // assumes object center of mass is zero |
3996 | float smass = part.mass; | 4001 | float smass = part.mass; |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs index f671722..2e3a197 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs | |||
@@ -29,10 +29,8 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
32 | using System.Text; | ||
33 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
34 | using OpenSim.Region.PhysicsModules.SharedBase; | 33 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using OdeAPI; | ||
36 | using log4net; | 34 | using log4net; |
37 | using OpenMetaverse; | 35 | using OpenMetaverse; |
38 | 36 | ||
@@ -67,7 +65,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
67 | /// <summary> | 65 | /// <summary> |
68 | /// ODE near callback delegate | 66 | /// ODE near callback delegate |
69 | /// </summary> | 67 | /// </summary> |
70 | private d.NearCallback nearCallback; | 68 | private SafeNativeMethods.NearCallback nearCallback; |
71 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 69 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
72 | private List<ContactResult> m_contactResults = new List<ContactResult>(); | 70 | private List<ContactResult> m_contactResults = new List<ContactResult>(); |
73 | private RayFilterFlags CurrentRayFilter; | 71 | private RayFilterFlags CurrentRayFilter; |
@@ -77,14 +75,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
77 | { | 75 | { |
78 | m_scene = pScene; | 76 | m_scene = pScene; |
79 | nearCallback = near; | 77 | nearCallback = near; |
80 | ray = d.CreateRay(IntPtr.Zero, 1.0f); | 78 | ray = SafeNativeMethods.CreateRay(IntPtr.Zero, 1.0f); |
81 | d.GeomSetCategoryBits(ray, 0); | 79 | SafeNativeMethods.GeomSetCategoryBits(ray, 0); |
82 | Box = d.CreateBox(IntPtr.Zero, 1.0f, 1.0f, 1.0f); | 80 | Box = SafeNativeMethods.CreateBox(IntPtr.Zero, 1.0f, 1.0f, 1.0f); |
83 | d.GeomSetCategoryBits(Box, 0); | 81 | SafeNativeMethods.GeomSetCategoryBits(Box, 0); |
84 | Sphere = d.CreateSphere(IntPtr.Zero,1.0f); | 82 | Sphere = SafeNativeMethods.CreateSphere(IntPtr.Zero,1.0f); |
85 | d.GeomSetCategoryBits(Sphere, 0); | 83 | SafeNativeMethods.GeomSetCategoryBits(Sphere, 0); |
86 | Plane = d.CreatePlane(IntPtr.Zero, 0f,0f,1f,1f); | 84 | Plane = SafeNativeMethods.CreatePlane(IntPtr.Zero, 0f,0f,1f,1f); |
87 | d.GeomSetCategoryBits(Sphere, 0); | 85 | SafeNativeMethods.GeomSetCategoryBits(Sphere, 0); |
88 | } | 86 | } |
89 | 87 | ||
90 | public void QueueRequest(ODERayRequest req) | 88 | public void QueueRequest(ODERayRequest req) |
@@ -152,29 +150,29 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
152 | { | 150 | { |
153 | if (CollisionContactGeomsPerTest > 80) | 151 | if (CollisionContactGeomsPerTest > 80) |
154 | CollisionContactGeomsPerTest = 80; | 152 | CollisionContactGeomsPerTest = 80; |
155 | d.GeomBoxSetLengths(Box, req.Normal.X, req.Normal.Y, req.Normal.Z); | 153 | SafeNativeMethods.GeomBoxSetLengths(Box, req.Normal.X, req.Normal.Y, req.Normal.Z); |
156 | d.GeomSetPosition(Box, req.Origin.X, req.Origin.Y, req.Origin.Z); | 154 | SafeNativeMethods.GeomSetPosition(Box, req.Origin.X, req.Origin.Y, req.Origin.Z); |
157 | d.Quaternion qtmp; | 155 | SafeNativeMethods.Quaternion qtmp; |
158 | qtmp.X = req.orientation.X; | 156 | qtmp.X = req.orientation.X; |
159 | qtmp.Y = req.orientation.Y; | 157 | qtmp.Y = req.orientation.Y; |
160 | qtmp.Z = req.orientation.Z; | 158 | qtmp.Z = req.orientation.Z; |
161 | qtmp.W = req.orientation.W; | 159 | qtmp.W = req.orientation.W; |
162 | d.GeomSetQuaternion(Box, ref qtmp); | 160 | SafeNativeMethods.GeomSetQuaternion(Box, ref qtmp); |
163 | } | 161 | } |
164 | else if (req.callbackMethod is ProbeSphereCallback) | 162 | else if (req.callbackMethod is ProbeSphereCallback) |
165 | { | 163 | { |
166 | if (CollisionContactGeomsPerTest > 80) | 164 | if (CollisionContactGeomsPerTest > 80) |
167 | CollisionContactGeomsPerTest = 80; | 165 | CollisionContactGeomsPerTest = 80; |
168 | 166 | ||
169 | d.GeomSphereSetRadius(Sphere, req.length); | 167 | SafeNativeMethods.GeomSphereSetRadius(Sphere, req.length); |
170 | d.GeomSetPosition(Sphere, req.Origin.X, req.Origin.Y, req.Origin.Z); | 168 | SafeNativeMethods.GeomSetPosition(Sphere, req.Origin.X, req.Origin.Y, req.Origin.Z); |
171 | } | 169 | } |
172 | else if (req.callbackMethod is ProbePlaneCallback) | 170 | else if (req.callbackMethod is ProbePlaneCallback) |
173 | { | 171 | { |
174 | if (CollisionContactGeomsPerTest > 80) | 172 | if (CollisionContactGeomsPerTest > 80) |
175 | CollisionContactGeomsPerTest = 80; | 173 | CollisionContactGeomsPerTest = 80; |
176 | 174 | ||
177 | d.GeomPlaneSetParams(Plane, req.Normal.X, req.Normal.Y, req.Normal.Z, req.length); | 175 | SafeNativeMethods.GeomPlaneSetParams(Plane, req.Normal.X, req.Normal.Y, req.Normal.Z, req.length); |
178 | } | 176 | } |
179 | 177 | ||
180 | else | 178 | else |
@@ -182,24 +180,24 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
182 | if (CollisionContactGeomsPerTest > 25) | 180 | if (CollisionContactGeomsPerTest > 25) |
183 | CollisionContactGeomsPerTest = 25; | 181 | CollisionContactGeomsPerTest = 25; |
184 | 182 | ||
185 | d.GeomRaySetLength(ray, req.length); | 183 | SafeNativeMethods.GeomRaySetLength(ray, req.length); |
186 | d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); | 184 | SafeNativeMethods.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); |
187 | d.GeomRaySetParams(ray, 0, backfacecull); | 185 | SafeNativeMethods.GeomRaySetParams(ray, 0, backfacecull); |
188 | 186 | ||
189 | if (req.callbackMethod is RaycastCallback) | 187 | if (req.callbackMethod is RaycastCallback) |
190 | { | 188 | { |
191 | // if we only want one get only one per Collision pair saving memory | 189 | // if we only want one get only one per Collision pair saving memory |
192 | CurrentRayFilter |= RayFilterFlags.ClosestHit; | 190 | CurrentRayFilter |= RayFilterFlags.ClosestHit; |
193 | d.GeomRaySetClosestHit(ray, 1); | 191 | SafeNativeMethods.GeomRaySetClosestHit(ray, 1); |
194 | } | 192 | } |
195 | else | 193 | else |
196 | d.GeomRaySetClosestHit(ray, closestHit); | 194 | SafeNativeMethods.GeomRaySetClosestHit(ray, closestHit); |
197 | } | 195 | } |
198 | 196 | ||
199 | if ((CurrentRayFilter & RayFilterFlags.ContactsUnImportant) != 0) | 197 | if ((CurrentRayFilter & RayFilterFlags.ContactsUnImportant) != 0) |
200 | unchecked | 198 | unchecked |
201 | { | 199 | { |
202 | CollisionContactGeomsPerTest |= (int)d.CONTACTS_UNIMPORTANT; | 200 | CollisionContactGeomsPerTest |= (int)SafeNativeMethods.CONTACTS_UNIMPORTANT; |
203 | } | 201 | } |
204 | 202 | ||
205 | if (geom == IntPtr.Zero) | 203 | if (geom == IntPtr.Zero) |
@@ -224,27 +222,27 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
224 | if (req.callbackMethod is ProbeBoxCallback) | 222 | if (req.callbackMethod is ProbeBoxCallback) |
225 | { | 223 | { |
226 | catflags |= CollisionCategories.Space; | 224 | catflags |= CollisionCategories.Space; |
227 | d.GeomSetCollideBits(Box, (uint)catflags); | 225 | SafeNativeMethods.GeomSetCollideBits(Box, (uint)catflags); |
228 | d.GeomSetCategoryBits(Box, (uint)catflags); | 226 | SafeNativeMethods.GeomSetCategoryBits(Box, (uint)catflags); |
229 | doProbe(req, Box); | 227 | doProbe(req, Box); |
230 | } | 228 | } |
231 | else if (req.callbackMethod is ProbeSphereCallback) | 229 | else if (req.callbackMethod is ProbeSphereCallback) |
232 | { | 230 | { |
233 | catflags |= CollisionCategories.Space; | 231 | catflags |= CollisionCategories.Space; |
234 | d.GeomSetCollideBits(Sphere, (uint)catflags); | 232 | SafeNativeMethods.GeomSetCollideBits(Sphere, (uint)catflags); |
235 | d.GeomSetCategoryBits(Sphere, (uint)catflags); | 233 | SafeNativeMethods.GeomSetCategoryBits(Sphere, (uint)catflags); |
236 | doProbe(req, Sphere); | 234 | doProbe(req, Sphere); |
237 | } | 235 | } |
238 | else if (req.callbackMethod is ProbePlaneCallback) | 236 | else if (req.callbackMethod is ProbePlaneCallback) |
239 | { | 237 | { |
240 | catflags |= CollisionCategories.Space; | 238 | catflags |= CollisionCategories.Space; |
241 | d.GeomSetCollideBits(Plane, (uint)catflags); | 239 | SafeNativeMethods.GeomSetCollideBits(Plane, (uint)catflags); |
242 | d.GeomSetCategoryBits(Plane, (uint)catflags); | 240 | SafeNativeMethods.GeomSetCategoryBits(Plane, (uint)catflags); |
243 | doPlane(req,IntPtr.Zero); | 241 | doPlane(req,IntPtr.Zero); |
244 | } | 242 | } |
245 | else | 243 | else |
246 | { | 244 | { |
247 | d.GeomSetCollideBits(ray, (uint)catflags); | 245 | SafeNativeMethods.GeomSetCollideBits(ray, (uint)catflags); |
248 | doSpaceRay(req); | 246 | doSpaceRay(req); |
249 | } | 247 | } |
250 | } | 248 | } |
@@ -255,12 +253,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
255 | 253 | ||
256 | if (req.callbackMethod is ProbePlaneCallback) | 254 | if (req.callbackMethod is ProbePlaneCallback) |
257 | { | 255 | { |
258 | d.GeomSetCollideBits(Plane, (uint)CollisionCategories.All); | 256 | SafeNativeMethods.GeomSetCollideBits(Plane, (uint)CollisionCategories.All); |
259 | doPlane(req,geom); | 257 | doPlane(req,geom); |
260 | } | 258 | } |
261 | else | 259 | else |
262 | { | 260 | { |
263 | d.GeomSetCollideBits(ray, (uint)CollisionCategories.All); | 261 | SafeNativeMethods.GeomSetCollideBits(ray, (uint)CollisionCategories.All); |
264 | doGeomRay(req,geom); | 262 | doGeomRay(req,geom); |
265 | } | 263 | } |
266 | } | 264 | } |
@@ -307,11 +305,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
307 | // Collide tests | 305 | // Collide tests |
308 | if ((CurrentRayFilter & FilterActiveSpace) != 0) | 306 | if ((CurrentRayFilter & FilterActiveSpace) != 0) |
309 | { | 307 | { |
310 | d.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); | 308 | SafeNativeMethods.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); |
311 | d.SpaceCollide2(ray, m_scene.CharsSpace, IntPtr.Zero, nearCallback); | 309 | SafeNativeMethods.SpaceCollide2(ray, m_scene.CharsSpace, IntPtr.Zero, nearCallback); |
312 | } | 310 | } |
313 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 311 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
314 | d.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); | 312 | SafeNativeMethods.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); |
315 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 313 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
316 | { | 314 | { |
317 | // current ode land to ray collisions is very bad | 315 | // current ode land to ray collisions is very bad |
@@ -324,11 +322,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
324 | { | 322 | { |
325 | float tmp2 = req.length * req.length - tmp + 2500; | 323 | float tmp2 = req.length * req.length - tmp + 2500; |
326 | tmp2 = (float)Math.Sqrt(tmp2); | 324 | tmp2 = (float)Math.Sqrt(tmp2); |
327 | d.GeomRaySetLength(ray, tmp2); | 325 | SafeNativeMethods.GeomRaySetLength(ray, tmp2); |
328 | } | 326 | } |
329 | 327 | ||
330 | } | 328 | } |
331 | d.SpaceCollide2(ray, m_scene.GroundSpace, IntPtr.Zero, nearCallback); | 329 | SafeNativeMethods.SpaceCollide2(ray, m_scene.GroundSpace, IntPtr.Zero, nearCallback); |
332 | } | 330 | } |
333 | 331 | ||
334 | if (req.callbackMethod is RaycastCallback) | 332 | if (req.callbackMethod is RaycastCallback) |
@@ -377,13 +375,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
377 | // Collide tests | 375 | // Collide tests |
378 | if ((CurrentRayFilter & FilterActiveSpace) != 0) | 376 | if ((CurrentRayFilter & FilterActiveSpace) != 0) |
379 | { | 377 | { |
380 | d.SpaceCollide2(probe, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); | 378 | SafeNativeMethods.SpaceCollide2(probe, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); |
381 | d.SpaceCollide2(probe, m_scene.CharsSpace, IntPtr.Zero, nearCallback); | 379 | SafeNativeMethods.SpaceCollide2(probe, m_scene.CharsSpace, IntPtr.Zero, nearCallback); |
382 | } | 380 | } |
383 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 381 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
384 | d.SpaceCollide2(probe, m_scene.StaticSpace, IntPtr.Zero, nearCallback); | 382 | SafeNativeMethods.SpaceCollide2(probe, m_scene.StaticSpace, IntPtr.Zero, nearCallback); |
385 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 383 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
386 | d.SpaceCollide2(probe, m_scene.GroundSpace, IntPtr.Zero, nearCallback); | 384 | SafeNativeMethods.SpaceCollide2(probe, m_scene.GroundSpace, IntPtr.Zero, nearCallback); |
387 | 385 | ||
388 | List<ContactResult> cresult = new List<ContactResult>(m_contactResults.Count); | 386 | List<ContactResult> cresult = new List<ContactResult>(m_contactResults.Count); |
389 | lock (m_PendingRequests) | 387 | lock (m_PendingRequests) |
@@ -404,17 +402,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
404 | { | 402 | { |
405 | if ((CurrentRayFilter & FilterActiveSpace) != 0) | 403 | if ((CurrentRayFilter & FilterActiveSpace) != 0) |
406 | { | 404 | { |
407 | d.SpaceCollide2(Plane, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); | 405 | SafeNativeMethods.SpaceCollide2(Plane, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); |
408 | d.SpaceCollide2(Plane, m_scene.CharsSpace, IntPtr.Zero, nearCallback); | 406 | SafeNativeMethods.SpaceCollide2(Plane, m_scene.CharsSpace, IntPtr.Zero, nearCallback); |
409 | } | 407 | } |
410 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 408 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
411 | d.SpaceCollide2(Plane, m_scene.StaticSpace, IntPtr.Zero, nearCallback); | 409 | SafeNativeMethods.SpaceCollide2(Plane, m_scene.StaticSpace, IntPtr.Zero, nearCallback); |
412 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 410 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
413 | d.SpaceCollide2(Plane, m_scene.GroundSpace, IntPtr.Zero, nearCallback); | 411 | SafeNativeMethods.SpaceCollide2(Plane, m_scene.GroundSpace, IntPtr.Zero, nearCallback); |
414 | } | 412 | } |
415 | else | 413 | else |
416 | { | 414 | { |
417 | d.SpaceCollide2(Plane, geom, IntPtr.Zero, nearCallback); | 415 | SafeNativeMethods.SpaceCollide2(Plane, geom, IntPtr.Zero, nearCallback); |
418 | } | 416 | } |
419 | 417 | ||
420 | List<ContactResult> cresult = new List<ContactResult>(m_contactResults.Count); | 418 | List<ContactResult> cresult = new List<ContactResult>(m_contactResults.Count); |
@@ -434,7 +432,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
434 | private void doGeomRay(ODERayRequest req, IntPtr geom) | 432 | private void doGeomRay(ODERayRequest req, IntPtr geom) |
435 | { | 433 | { |
436 | // Collide test | 434 | // Collide test |
437 | d.SpaceCollide2(ray, geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test | 435 | SafeNativeMethods.SpaceCollide2(ray, geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test |
438 | 436 | ||
439 | if (req.callbackMethod is RaycastCallback) | 437 | if (req.callbackMethod is RaycastCallback) |
440 | { | 438 | { |
@@ -478,14 +476,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
478 | } | 476 | } |
479 | } | 477 | } |
480 | 478 | ||
481 | private bool GetCurContactGeom(int index, ref d.ContactGeom newcontactgeom) | 479 | private bool GetCurContactGeom(int index, ref SafeNativeMethods.ContactGeom newcontactgeom) |
482 | { | 480 | { |
483 | IntPtr ContactgeomsArray = m_scene.ContactgeomsArray; | 481 | IntPtr ContactgeomsArray = m_scene.ContactgeomsArray; |
484 | if (ContactgeomsArray == IntPtr.Zero || index >= CollisionContactGeomsPerTest) | 482 | if (ContactgeomsArray == IntPtr.Zero || index >= CollisionContactGeomsPerTest) |
485 | return false; | 483 | return false; |
486 | 484 | ||
487 | IntPtr contactptr = new IntPtr(ContactgeomsArray.ToInt64() + (Int64)(index * d.ContactGeom.unmanagedSizeOf)); | 485 | IntPtr contactptr = new IntPtr(ContactgeomsArray.ToInt64() + (Int64)(index * SafeNativeMethods.ContactGeom.unmanagedSizeOf)); |
488 | newcontactgeom = (d.ContactGeom)Marshal.PtrToStructure(contactptr, typeof(d.ContactGeom)); | 486 | newcontactgeom = (SafeNativeMethods.ContactGeom)Marshal.PtrToStructure(contactptr, typeof(SafeNativeMethods.ContactGeom)); |
489 | return true; | 487 | return true; |
490 | } | 488 | } |
491 | 489 | ||
@@ -498,11 +496,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
498 | if (m_contactResults.Count >= CurrentMaxCount) | 496 | if (m_contactResults.Count >= CurrentMaxCount) |
499 | return; | 497 | return; |
500 | 498 | ||
501 | if (d.GeomIsSpace(g2)) | 499 | if (SafeNativeMethods.GeomIsSpace(g2)) |
502 | { | 500 | { |
503 | try | 501 | try |
504 | { | 502 | { |
505 | d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); | 503 | SafeNativeMethods.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); |
506 | } | 504 | } |
507 | catch (Exception e) | 505 | catch (Exception e) |
508 | { | 506 | { |
@@ -514,7 +512,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
514 | int count = 0; | 512 | int count = 0; |
515 | try | 513 | try |
516 | { | 514 | { |
517 | count = d.CollidePtr(g1, g2, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, d.ContactGeom.unmanagedSizeOf); | 515 | count = SafeNativeMethods.CollidePtr(g1, g2, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, SafeNativeMethods.ContactGeom.unmanagedSizeOf); |
518 | } | 516 | } |
519 | catch (Exception e) | 517 | catch (Exception e) |
520 | { | 518 | { |
@@ -586,7 +584,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
586 | break; | 584 | break; |
587 | } | 585 | } |
588 | 586 | ||
589 | d.ContactGeom curcontact = new d.ContactGeom(); | 587 | SafeNativeMethods.ContactGeom curcontact = new SafeNativeMethods.ContactGeom(); |
590 | 588 | ||
591 | // closestHit for now only works for meshs, so must do it for others | 589 | // closestHit for now only works for meshs, so must do it for others |
592 | if ((CurrentRayFilter & RayFilterFlags.ClosestHit) == 0) | 590 | if ((CurrentRayFilter & RayFilterFlags.ClosestHit) == 0) |
@@ -654,22 +652,22 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
654 | m_scene = null; | 652 | m_scene = null; |
655 | if (ray != IntPtr.Zero) | 653 | if (ray != IntPtr.Zero) |
656 | { | 654 | { |
657 | d.GeomDestroy(ray); | 655 | SafeNativeMethods.GeomDestroy(ray); |
658 | ray = IntPtr.Zero; | 656 | ray = IntPtr.Zero; |
659 | } | 657 | } |
660 | if (Box != IntPtr.Zero) | 658 | if (Box != IntPtr.Zero) |
661 | { | 659 | { |
662 | d.GeomDestroy(Box); | 660 | SafeNativeMethods.GeomDestroy(Box); |
663 | Box = IntPtr.Zero; | 661 | Box = IntPtr.Zero; |
664 | } | 662 | } |
665 | if (Sphere != IntPtr.Zero) | 663 | if (Sphere != IntPtr.Zero) |
666 | { | 664 | { |
667 | d.GeomDestroy(Sphere); | 665 | SafeNativeMethods.GeomDestroy(Sphere); |
668 | Sphere = IntPtr.Zero; | 666 | Sphere = IntPtr.Zero; |
669 | } | 667 | } |
670 | if (Plane != IntPtr.Zero) | 668 | if (Plane != IntPtr.Zero) |
671 | { | 669 | { |
672 | d.GeomDestroy(Plane); | 670 | SafeNativeMethods.GeomDestroy(Plane); |
673 | Plane = IntPtr.Zero; | 671 | Plane = IntPtr.Zero; |
674 | } | 672 | } |
675 | } | 673 | } |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 5f63a7b..0003085 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |||
@@ -34,15 +34,10 @@ using System.Linq; | |||
34 | using System.Reflection; | 34 | using System.Reflection; |
35 | using System.Runtime.InteropServices; | 35 | using System.Runtime.InteropServices; |
36 | using System.Threading; | 36 | using System.Threading; |
37 | using System.IO; | ||
38 | using System.Diagnostics; | ||
39 | using log4net; | 37 | using log4net; |
40 | using Nini.Config; | 38 | using Nini.Config; |
41 | using Mono.Addins; | ||
42 | using OdeAPI; | ||
43 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
44 | using OpenSim.Region.Framework.Scenes; | 40 | using OpenSim.Region.Framework.Scenes; |
45 | using OpenSim.Region.Framework.Interfaces; | ||
46 | using OpenSim.Region.PhysicsModules.SharedBase; | 41 | using OpenSim.Region.PhysicsModules.SharedBase; |
47 | using OpenMetaverse; | 42 | using OpenMetaverse; |
48 | 43 | ||
@@ -180,7 +175,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
180 | // const d.ContactFlags comumContactFlags = d.ContactFlags.SoftERP | d.ContactFlags.SoftCFM |d.ContactFlags.Approx1 | d.ContactFlags.Bounce; | 175 | // const d.ContactFlags comumContactFlags = d.ContactFlags.SoftERP | d.ContactFlags.SoftCFM |d.ContactFlags.Approx1 | d.ContactFlags.Bounce; |
181 | 176 | ||
182 | // const d.ContactFlags comumContactFlags = d.ContactFlags.Bounce | d.ContactFlags.Approx1 | d.ContactFlags.Slip1 | d.ContactFlags.Slip2; | 177 | // const d.ContactFlags comumContactFlags = d.ContactFlags.Bounce | d.ContactFlags.Approx1 | d.ContactFlags.Slip1 | d.ContactFlags.Slip2; |
183 | const d.ContactFlags comumContactFlags = d.ContactFlags.Bounce | d.ContactFlags.Approx1; | 178 | const SafeNativeMethods.ContactFlags comumContactFlags = SafeNativeMethods.ContactFlags.Bounce | SafeNativeMethods.ContactFlags.Approx1; |
184 | const float comumContactERP = 0.75f; | 179 | const float comumContactERP = 0.75f; |
185 | const float comumContactCFM = 0.0001f; | 180 | const float comumContactCFM = 0.0001f; |
186 | const float comumContactSLIP = 0f; | 181 | const float comumContactSLIP = 0f; |
@@ -228,7 +223,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
228 | 223 | ||
229 | public int bodyFramesAutoDisable = 5; | 224 | public int bodyFramesAutoDisable = 5; |
230 | 225 | ||
231 | private d.NearCallback nearCallback; | 226 | private SafeNativeMethods.NearCallback nearCallback; |
232 | 227 | ||
233 | private Dictionary<uint,OdePrim> _prims = new Dictionary<uint,OdePrim>(); | 228 | private Dictionary<uint,OdePrim> _prims = new Dictionary<uint,OdePrim>(); |
234 | private HashSet<OdeCharacter> _characters = new HashSet<OdeCharacter>(); | 229 | private HashSet<OdeCharacter> _characters = new HashSet<OdeCharacter>(); |
@@ -251,7 +246,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
251 | private int contactsPerCollision = 80; | 246 | private int contactsPerCollision = 80; |
252 | internal IntPtr ContactgeomsArray = IntPtr.Zero; | 247 | internal IntPtr ContactgeomsArray = IntPtr.Zero; |
253 | private IntPtr GlobalContactsArray = IntPtr.Zero; | 248 | private IntPtr GlobalContactsArray = IntPtr.Zero; |
254 | private d.Contact SharedTmpcontact = new d.Contact(); | 249 | private SafeNativeMethods.Contact SharedTmpcontact = new SafeNativeMethods.Contact(); |
255 | 250 | ||
256 | const int maxContactsbeforedeath = 6000; | 251 | const int maxContactsbeforedeath = 6000; |
257 | private volatile int m_global_contactcount = 0; | 252 | private volatile int m_global_contactcount = 0; |
@@ -356,7 +351,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
356 | /// </summary> | 351 | /// </summary> |
357 | private void Initialization() | 352 | private void Initialization() |
358 | { | 353 | { |
359 | d.AllocateODEDataForThread(~0U); | 354 | SafeNativeMethods.AllocateODEDataForThread(~0U); |
360 | 355 | ||
361 | SimulationLock = new Object(); | 356 | SimulationLock = new Object(); |
362 | 357 | ||
@@ -374,15 +369,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
374 | // Create the world and the first space | 369 | // Create the world and the first space |
375 | try | 370 | try |
376 | { | 371 | { |
377 | world = d.WorldCreate(); | 372 | world = SafeNativeMethods.WorldCreate(); |
378 | TopSpace = d.SimpleSpaceCreate(IntPtr.Zero); | 373 | TopSpace = SafeNativeMethods.SimpleSpaceCreate(IntPtr.Zero); |
379 | ActiveSpace = d.SimpleSpaceCreate(TopSpace); | 374 | ActiveSpace = SafeNativeMethods.SimpleSpaceCreate(TopSpace); |
380 | CharsSpace = d.SimpleSpaceCreate(TopSpace); | 375 | CharsSpace = SafeNativeMethods.SimpleSpaceCreate(TopSpace); |
381 | GroundSpace = d.SimpleSpaceCreate(TopSpace); | 376 | GroundSpace = SafeNativeMethods.SimpleSpaceCreate(TopSpace); |
382 | float sx = WorldExtents.X + 16; | 377 | float sx = WorldExtents.X + 16; |
383 | float sy = WorldExtents.Y + 16; | 378 | float sy = WorldExtents.Y + 16; |
384 | d.Vector3 ex =new d.Vector3(sx, sy, 0); | 379 | SafeNativeMethods.Vector3 ex =new SafeNativeMethods.Vector3(sx, sy, 0); |
385 | d.Vector3 px =new d.Vector3(sx * 0.5f, sx * 0.5f, 0); | 380 | SafeNativeMethods.Vector3 px =new SafeNativeMethods.Vector3(sx * 0.5f, sx * 0.5f, 0); |
386 | if(sx < sy) | 381 | if(sx < sy) |
387 | sx = sy; | 382 | sx = sy; |
388 | sx = (float)Math.Log(sx) * 1.442695f + 0.5f; | 383 | sx = (float)Math.Log(sx) * 1.442695f + 0.5f; |
@@ -391,7 +386,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
391 | dp = 8; | 386 | dp = 8; |
392 | else if(dp < 4) | 387 | else if(dp < 4) |
393 | dp = 4; | 388 | dp = 4; |
394 | StaticSpace = d.QuadTreeSpaceCreate(TopSpace, ref px, ref ex, dp); | 389 | StaticSpace = SafeNativeMethods.QuadTreeSpaceCreate(TopSpace, ref px, ref ex, dp); |
395 | } | 390 | } |
396 | catch | 391 | catch |
397 | { | 392 | { |
@@ -400,47 +395,47 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
400 | } | 395 | } |
401 | 396 | ||
402 | // demote to second level | 397 | // demote to second level |
403 | d.SpaceSetSublevel(ActiveSpace, 1); | 398 | SafeNativeMethods.SpaceSetSublevel(ActiveSpace, 1); |
404 | d.SpaceSetSublevel(CharsSpace, 1); | 399 | SafeNativeMethods.SpaceSetSublevel(CharsSpace, 1); |
405 | d.SpaceSetSublevel(StaticSpace, 1); | 400 | SafeNativeMethods.SpaceSetSublevel(StaticSpace, 1); |
406 | d.SpaceSetSublevel(GroundSpace, 1); | 401 | SafeNativeMethods.SpaceSetSublevel(GroundSpace, 1); |
407 | 402 | ||
408 | d.GeomSetCategoryBits(ActiveSpace, (uint)(CollisionCategories.Space | | 403 | SafeNativeMethods.GeomSetCategoryBits(ActiveSpace, (uint)(CollisionCategories.Space | |
409 | CollisionCategories.Geom | | 404 | CollisionCategories.Geom | |
410 | CollisionCategories.Character | | 405 | CollisionCategories.Character | |
411 | CollisionCategories.Phantom | | 406 | CollisionCategories.Phantom | |
412 | CollisionCategories.VolumeDtc | 407 | CollisionCategories.VolumeDtc |
413 | )); | 408 | )); |
414 | d.GeomSetCollideBits(ActiveSpace, (uint)(CollisionCategories.Space | | 409 | SafeNativeMethods.GeomSetCollideBits(ActiveSpace, (uint)(CollisionCategories.Space | |
415 | CollisionCategories.Geom | | 410 | CollisionCategories.Geom | |
416 | CollisionCategories.Character | | 411 | CollisionCategories.Character | |
417 | CollisionCategories.Phantom | | 412 | CollisionCategories.Phantom | |
418 | CollisionCategories.VolumeDtc | 413 | CollisionCategories.VolumeDtc |
419 | )); | 414 | )); |
420 | d.GeomSetCategoryBits(CharsSpace, (uint)(CollisionCategories.Space | | 415 | SafeNativeMethods.GeomSetCategoryBits(CharsSpace, (uint)(CollisionCategories.Space | |
421 | CollisionCategories.Geom | | 416 | CollisionCategories.Geom | |
422 | CollisionCategories.Character | | 417 | CollisionCategories.Character | |
423 | CollisionCategories.Phantom | | 418 | CollisionCategories.Phantom | |
424 | CollisionCategories.VolumeDtc | 419 | CollisionCategories.VolumeDtc |
425 | )); | 420 | )); |
426 | d.GeomSetCollideBits(CharsSpace, 0); | 421 | SafeNativeMethods.GeomSetCollideBits(CharsSpace, 0); |
427 | 422 | ||
428 | d.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space | | 423 | SafeNativeMethods.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space | |
429 | CollisionCategories.Geom | | 424 | CollisionCategories.Geom | |
430 | // CollisionCategories.Land | | 425 | // CollisionCategories.Land | |
431 | // CollisionCategories.Water | | 426 | // CollisionCategories.Water | |
432 | CollisionCategories.Phantom | | 427 | CollisionCategories.Phantom | |
433 | CollisionCategories.VolumeDtc | 428 | CollisionCategories.VolumeDtc |
434 | )); | 429 | )); |
435 | d.GeomSetCollideBits(StaticSpace, 0); | 430 | SafeNativeMethods.GeomSetCollideBits(StaticSpace, 0); |
436 | 431 | ||
437 | d.GeomSetCategoryBits(GroundSpace, (uint)(CollisionCategories.Land)); | 432 | SafeNativeMethods.GeomSetCategoryBits(GroundSpace, (uint)(CollisionCategories.Land)); |
438 | d.GeomSetCollideBits(GroundSpace, 0); | 433 | SafeNativeMethods.GeomSetCollideBits(GroundSpace, 0); |
439 | 434 | ||
440 | contactgroup = d.JointGroupCreate(maxContactsbeforedeath + 1); | 435 | contactgroup = SafeNativeMethods.JointGroupCreate(maxContactsbeforedeath + 1); |
441 | //contactgroup | 436 | //contactgroup |
442 | 437 | ||
443 | d.WorldSetAutoDisableFlag(world, false); | 438 | SafeNativeMethods.WorldSetAutoDisableFlag(world, false); |
444 | } | 439 | } |
445 | 440 | ||
446 | 441 | ||
@@ -490,27 +485,27 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
490 | maximumAngularVelocity = 0.49f * heartbeat *(float)Math.PI; | 485 | maximumAngularVelocity = 0.49f * heartbeat *(float)Math.PI; |
491 | maxAngVelocitySQ = maximumAngularVelocity * maximumAngularVelocity; | 486 | maxAngVelocitySQ = maximumAngularVelocity * maximumAngularVelocity; |
492 | 487 | ||
493 | d.WorldSetCFM(world, comumContactCFM); | 488 | SafeNativeMethods.WorldSetCFM(world, comumContactCFM); |
494 | d.WorldSetERP(world, comumContactERP); | 489 | SafeNativeMethods.WorldSetERP(world, comumContactERP); |
495 | 490 | ||
496 | d.WorldSetGravity(world, gravityx, gravityy, gravityz); | 491 | SafeNativeMethods.WorldSetGravity(world, gravityx, gravityy, gravityz); |
497 | 492 | ||
498 | d.WorldSetLinearDamping(world, 0.001f); | 493 | SafeNativeMethods.WorldSetLinearDamping(world, 0.001f); |
499 | d.WorldSetAngularDamping(world, 0.002f); | 494 | SafeNativeMethods.WorldSetAngularDamping(world, 0.002f); |
500 | d.WorldSetAngularDampingThreshold(world, 0f); | 495 | SafeNativeMethods.WorldSetAngularDampingThreshold(world, 0f); |
501 | d.WorldSetLinearDampingThreshold(world, 0f); | 496 | SafeNativeMethods.WorldSetLinearDampingThreshold(world, 0f); |
502 | d.WorldSetMaxAngularSpeed(world, maximumAngularVelocity); | 497 | SafeNativeMethods.WorldSetMaxAngularSpeed(world, maximumAngularVelocity); |
503 | 498 | ||
504 | d.WorldSetQuickStepNumIterations(world, m_physicsiterations); | 499 | SafeNativeMethods.WorldSetQuickStepNumIterations(world, m_physicsiterations); |
505 | 500 | ||
506 | d.WorldSetContactSurfaceLayer(world, contactsurfacelayer); | 501 | SafeNativeMethods.WorldSetContactSurfaceLayer(world, contactsurfacelayer); |
507 | d.WorldSetContactMaxCorrectingVel(world, 60.0f); | 502 | SafeNativeMethods.WorldSetContactMaxCorrectingVel(world, 60.0f); |
508 | 503 | ||
509 | HalfOdeStep = ODE_STEPSIZE * 0.5f; | 504 | HalfOdeStep = ODE_STEPSIZE * 0.5f; |
510 | odetimestepMS = (int)(1000.0f * ODE_STEPSIZE + 0.5f); | 505 | odetimestepMS = (int)(1000.0f * ODE_STEPSIZE + 0.5f); |
511 | 506 | ||
512 | ContactgeomsArray = Marshal.AllocHGlobal(contactsPerCollision * d.ContactGeom.unmanagedSizeOf); | 507 | ContactgeomsArray = Marshal.AllocHGlobal(contactsPerCollision * SafeNativeMethods.ContactGeom.unmanagedSizeOf); |
513 | GlobalContactsArray = Marshal.AllocHGlobal((maxContactsbeforedeath + 100) * d.Contact.unmanagedSizeOf); | 508 | GlobalContactsArray = Marshal.AllocHGlobal((maxContactsbeforedeath + 100) * SafeNativeMethods.Contact.unmanagedSizeOf); |
514 | 509 | ||
515 | SharedTmpcontact.geom.g1 = IntPtr.Zero; | 510 | SharedTmpcontact.geom.g1 = IntPtr.Zero; |
516 | SharedTmpcontact.geom.g2 = IntPtr.Zero; | 511 | SharedTmpcontact.geom.g2 = IntPtr.Zero; |
@@ -565,7 +560,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
565 | #region Collision Detection | 560 | #region Collision Detection |
566 | 561 | ||
567 | // sets a global contact for a joint for contactgeom , and base contact description) | 562 | // sets a global contact for a joint for contactgeom , and base contact description) |
568 | private IntPtr CreateContacJoint(ref d.ContactGeom contactGeom,bool smooth) | 563 | private IntPtr CreateContacJoint(ref SafeNativeMethods.ContactGeom contactGeom,bool smooth) |
569 | { | 564 | { |
570 | if (m_global_contactcount >= maxContactsbeforedeath) | 565 | if (m_global_contactcount >= maxContactsbeforedeath) |
571 | return IntPtr.Zero; | 566 | return IntPtr.Zero; |
@@ -578,18 +573,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
578 | SharedTmpcontact.geom.pos = contactGeom.pos; | 573 | SharedTmpcontact.geom.pos = contactGeom.pos; |
579 | SharedTmpcontact.geom.normal = contactGeom.normal; | 574 | SharedTmpcontact.geom.normal = contactGeom.normal; |
580 | 575 | ||
581 | IntPtr contact = new IntPtr(GlobalContactsArray.ToInt64() + (Int64)(m_global_contactcount * d.Contact.unmanagedSizeOf)); | 576 | IntPtr contact = new IntPtr(GlobalContactsArray.ToInt64() + (Int64)(m_global_contactcount * SafeNativeMethods.Contact.unmanagedSizeOf)); |
582 | Marshal.StructureToPtr(SharedTmpcontact, contact, true); | 577 | Marshal.StructureToPtr(SharedTmpcontact, contact, true); |
583 | return d.JointCreateContactPtr(world, contactgroup, contact); | 578 | return SafeNativeMethods.JointCreateContactPtr(world, contactgroup, contact); |
584 | } | 579 | } |
585 | 580 | ||
586 | private bool GetCurContactGeom(int index, ref d.ContactGeom newcontactgeom) | 581 | private bool GetCurContactGeom(int index, ref SafeNativeMethods.ContactGeom newcontactgeom) |
587 | { | 582 | { |
588 | if (ContactgeomsArray == IntPtr.Zero || index >= contactsPerCollision) | 583 | if (ContactgeomsArray == IntPtr.Zero || index >= contactsPerCollision) |
589 | return false; | 584 | return false; |
590 | 585 | ||
591 | IntPtr contactptr = new IntPtr(ContactgeomsArray.ToInt64() + (Int64)(index * d.ContactGeom.unmanagedSizeOf)); | 586 | IntPtr contactptr = new IntPtr(ContactgeomsArray.ToInt64() + (Int64)(index * SafeNativeMethods.ContactGeom.unmanagedSizeOf)); |
592 | newcontactgeom = (d.ContactGeom)Marshal.PtrToStructure(contactptr, typeof(d.ContactGeom)); | 587 | newcontactgeom = (SafeNativeMethods.ContactGeom)Marshal.PtrToStructure(contactptr, typeof(SafeNativeMethods.ContactGeom)); |
593 | return true; | 588 | return true; |
594 | } | 589 | } |
595 | 590 | ||
@@ -614,14 +609,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
614 | if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) | 609 | if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) |
615 | return; | 610 | return; |
616 | 611 | ||
617 | if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2)) | 612 | if (SafeNativeMethods.GeomIsSpace(g1) || SafeNativeMethods.GeomIsSpace(g2)) |
618 | { | 613 | { |
619 | // We'll be calling near recursivly if one | 614 | // We'll be calling near recursivly if one |
620 | // of them is a space to find all of the | 615 | // of them is a space to find all of the |
621 | // contact points in the space | 616 | // contact points in the space |
622 | try | 617 | try |
623 | { | 618 | { |
624 | d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); | 619 | SafeNativeMethods.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); |
625 | } | 620 | } |
626 | catch (AccessViolationException) | 621 | catch (AccessViolationException) |
627 | { | 622 | { |
@@ -636,8 +631,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
636 | 631 | ||
637 | // get geom bodies to check if we already a joint contact | 632 | // get geom bodies to check if we already a joint contact |
638 | // guess this shouldn't happen now | 633 | // guess this shouldn't happen now |
639 | IntPtr b1 = d.GeomGetBody(g1); | 634 | IntPtr b1 = SafeNativeMethods.GeomGetBody(g1); |
640 | IntPtr b2 = d.GeomGetBody(g2); | 635 | IntPtr b2 = SafeNativeMethods.GeomGetBody(g2); |
641 | 636 | ||
642 | // d.GeomClassID id = d.GeomGetClass(g1); | 637 | // d.GeomClassID id = d.GeomGetClass(g1); |
643 | 638 | ||
@@ -679,18 +674,18 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
679 | // | 674 | // |
680 | */ | 675 | */ |
681 | 676 | ||
682 | if (d.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || | 677 | if (SafeNativeMethods.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || |
683 | d.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) | 678 | SafeNativeMethods.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) |
684 | { | 679 | { |
685 | int cflags; | 680 | int cflags; |
686 | unchecked | 681 | unchecked |
687 | { | 682 | { |
688 | cflags = (int)(1 | d.CONTACTS_UNIMPORTANT); | 683 | cflags = (int)(1 | SafeNativeMethods.CONTACTS_UNIMPORTANT); |
689 | } | 684 | } |
690 | count = d.CollidePtr(g1, g2, cflags, ContactgeomsArray, d.ContactGeom.unmanagedSizeOf); | 685 | count = SafeNativeMethods.CollidePtr(g1, g2, cflags, ContactgeomsArray, SafeNativeMethods.ContactGeom.unmanagedSizeOf); |
691 | } | 686 | } |
692 | else | 687 | else |
693 | count = d.CollidePtr(g1, g2, (contactsPerCollision & 0xffff), ContactgeomsArray, d.ContactGeom.unmanagedSizeOf); | 688 | count = SafeNativeMethods.CollidePtr(g1, g2, (contactsPerCollision & 0xffff), ContactgeomsArray, SafeNativeMethods.ContactGeom.unmanagedSizeOf); |
694 | } | 689 | } |
695 | catch (SEHException) | 690 | catch (SEHException) |
696 | { | 691 | { |
@@ -726,7 +721,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
726 | 721 | ||
727 | 722 | ||
728 | // get first contact | 723 | // get first contact |
729 | d.ContactGeom curContact = new d.ContactGeom(); | 724 | SafeNativeMethods.ContactGeom curContact = new SafeNativeMethods.ContactGeom(); |
730 | 725 | ||
731 | if (!GetCurContactGeom(0, ref curContact)) | 726 | if (!GetCurContactGeom(0, ref curContact)) |
732 | return; | 727 | return; |
@@ -802,8 +797,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
802 | // if (relVlenSQ > 0.01f) | 797 | // if (relVlenSQ > 0.01f) |
803 | // mu *= frictionMovementMult; | 798 | // mu *= frictionMovementMult; |
804 | 799 | ||
805 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass && | 800 | if(SafeNativeMethods.GeomGetClass(g2) == SafeNativeMethods.GeomClassID.TriMeshClass && |
806 | d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass) | 801 | SafeNativeMethods.GeomGetClass(g1) == SafeNativeMethods.GeomClassID.TriMeshClass) |
807 | smoothMesh = true; | 802 | smoothMesh = true; |
808 | break; | 803 | break; |
809 | 804 | ||
@@ -817,7 +812,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
817 | // mu *= frictionMovementMult; | 812 | // mu *= frictionMovementMult; |
818 | p1.CollidingGround = true; | 813 | p1.CollidingGround = true; |
819 | 814 | ||
820 | if(d.GeomGetClass(g1) == d.GeomClassID.TriMeshClass) | 815 | if(SafeNativeMethods.GeomGetClass(g1) == SafeNativeMethods.GeomClassID.TriMeshClass) |
821 | smoothMesh = true; | 816 | smoothMesh = true; |
822 | break; | 817 | break; |
823 | 818 | ||
@@ -843,7 +838,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
843 | // if (Math.Abs(v2.X) > 0.1f || Math.Abs(v2.Y) > 0.1f) | 838 | // if (Math.Abs(v2.X) > 0.1f || Math.Abs(v2.Y) > 0.1f) |
844 | // mu *= frictionMovementMult; | 839 | // mu *= frictionMovementMult; |
845 | 840 | ||
846 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass) | 841 | if(SafeNativeMethods.GeomGetClass(g2) == SafeNativeMethods.GeomClassID.TriMeshClass) |
847 | smoothMesh = true; | 842 | smoothMesh = true; |
848 | } | 843 | } |
849 | else | 844 | else |
@@ -873,7 +868,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
873 | SharedTmpcontact.surface.mu = mu; | 868 | SharedTmpcontact.surface.mu = mu; |
874 | SharedTmpcontact.surface.bounce = bounce; | 869 | SharedTmpcontact.surface.bounce = bounce; |
875 | 870 | ||
876 | d.ContactGeom altContact = new d.ContactGeom(); | 871 | SafeNativeMethods.ContactGeom altContact = new SafeNativeMethods.ContactGeom(); |
877 | bool useAltcontact; | 872 | bool useAltcontact; |
878 | bool noskip; | 873 | bool noskip; |
879 | 874 | ||
@@ -925,7 +920,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
925 | if (Joint == IntPtr.Zero) | 920 | if (Joint == IntPtr.Zero) |
926 | break; | 921 | break; |
927 | 922 | ||
928 | d.JointAttach(Joint, b1, b2); | 923 | SafeNativeMethods.JointAttach(Joint, b1, b2); |
929 | 924 | ||
930 | ncontacts++; | 925 | ncontacts++; |
931 | 926 | ||
@@ -1073,12 +1068,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1073 | continue; | 1068 | continue; |
1074 | 1069 | ||
1075 | // do colisions with static space | 1070 | // do colisions with static space |
1076 | d.SpaceCollide2(chr.collider, StaticSpace, IntPtr.Zero, nearCallback); | 1071 | SafeNativeMethods.SpaceCollide2(chr.collider, StaticSpace, IntPtr.Zero, nearCallback); |
1077 | 1072 | ||
1078 | // no coll with gnd | 1073 | // no coll with gnd |
1079 | } | 1074 | } |
1080 | // chars with chars | 1075 | // chars with chars |
1081 | d.SpaceCollide(CharsSpace, IntPtr.Zero, nearCallback); | 1076 | SafeNativeMethods.SpaceCollide(CharsSpace, IntPtr.Zero, nearCallback); |
1082 | 1077 | ||
1083 | } | 1078 | } |
1084 | catch (AccessViolationException) | 1079 | catch (AccessViolationException) |
@@ -1094,7 +1089,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1094 | { | 1089 | { |
1095 | aprim.CollisionScore = 0; | 1090 | aprim.CollisionScore = 0; |
1096 | aprim.IsColliding = false; | 1091 | aprim.IsColliding = false; |
1097 | if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body)) | 1092 | if(!aprim.m_outbounds && SafeNativeMethods.BodyIsEnabled(aprim.Body)) |
1098 | aprim.clearSleeperCollisions(); | 1093 | aprim.clearSleeperCollisions(); |
1099 | } | 1094 | } |
1100 | } | 1095 | } |
@@ -1105,11 +1100,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1105 | { | 1100 | { |
1106 | foreach (OdePrim aprim in _activegroups) | 1101 | foreach (OdePrim aprim in _activegroups) |
1107 | { | 1102 | { |
1108 | if(!aprim.m_outbounds && d.BodyIsEnabled(aprim.Body) && | 1103 | if(!aprim.m_outbounds && SafeNativeMethods.BodyIsEnabled(aprim.Body) && |
1109 | aprim.collide_geom != IntPtr.Zero) | 1104 | aprim.collide_geom != IntPtr.Zero) |
1110 | { | 1105 | { |
1111 | d.SpaceCollide2(StaticSpace, aprim.collide_geom, IntPtr.Zero, nearCallback); | 1106 | SafeNativeMethods.SpaceCollide2(StaticSpace, aprim.collide_geom, IntPtr.Zero, nearCallback); |
1112 | d.SpaceCollide2(GroundSpace, aprim.collide_geom, IntPtr.Zero, nearCallback); | 1107 | SafeNativeMethods.SpaceCollide2(GroundSpace, aprim.collide_geom, IntPtr.Zero, nearCallback); |
1113 | } | 1108 | } |
1114 | } | 1109 | } |
1115 | } | 1110 | } |
@@ -1122,7 +1117,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1122 | // colide active amoung them | 1117 | // colide active amoung them |
1123 | try | 1118 | try |
1124 | { | 1119 | { |
1125 | d.SpaceCollide(ActiveSpace, IntPtr.Zero, nearCallback); | 1120 | SafeNativeMethods.SpaceCollide(ActiveSpace, IntPtr.Zero, nearCallback); |
1126 | } | 1121 | } |
1127 | catch (Exception e) | 1122 | catch (Exception e) |
1128 | { | 1123 | { |
@@ -1132,7 +1127,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1132 | // and with chars | 1127 | // and with chars |
1133 | try | 1128 | try |
1134 | { | 1129 | { |
1135 | d.SpaceCollide2(CharsSpace,ActiveSpace, IntPtr.Zero, nearCallback); | 1130 | SafeNativeMethods.SpaceCollide2(CharsSpace,ActiveSpace, IntPtr.Zero, nearCallback); |
1136 | } | 1131 | } |
1137 | catch (Exception e) | 1132 | catch (Exception e) |
1138 | { | 1133 | { |
@@ -1232,7 +1227,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1232 | 1227 | ||
1233 | lock (OdeLock) | 1228 | lock (OdeLock) |
1234 | { | 1229 | { |
1235 | d.AllocateODEDataForThread(0); | 1230 | SafeNativeMethods.AllocateODEDataForThread(0); |
1236 | ((OdeCharacter) actor).Destroy(); | 1231 | ((OdeCharacter) actor).Destroy(); |
1237 | } | 1232 | } |
1238 | } | 1233 | } |
@@ -1403,16 +1398,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1403 | return StaticSpace; | 1398 | return StaticSpace; |
1404 | 1399 | ||
1405 | // else remove it from its current space | 1400 | // else remove it from its current space |
1406 | if (currentspace != IntPtr.Zero && d.SpaceQuery(currentspace, geom)) | 1401 | if (currentspace != IntPtr.Zero && SafeNativeMethods.SpaceQuery(currentspace, geom)) |
1407 | { | 1402 | { |
1408 | if (d.GeomIsSpace(currentspace)) | 1403 | if (SafeNativeMethods.GeomIsSpace(currentspace)) |
1409 | { | 1404 | { |
1410 | waitForSpaceUnlock(currentspace); | 1405 | waitForSpaceUnlock(currentspace); |
1411 | d.SpaceRemove(currentspace, geom); | 1406 | SafeNativeMethods.SpaceRemove(currentspace, geom); |
1412 | 1407 | ||
1413 | if (d.SpaceGetSublevel(currentspace) > 2 && d.SpaceGetNumGeoms(currentspace) == 0) | 1408 | if (SafeNativeMethods.SpaceGetSublevel(currentspace) > 2 && SafeNativeMethods.SpaceGetNumGeoms(currentspace) == 0) |
1414 | { | 1409 | { |
1415 | d.SpaceDestroy(currentspace); | 1410 | SafeNativeMethods.SpaceDestroy(currentspace); |
1416 | } | 1411 | } |
1417 | } | 1412 | } |
1418 | else | 1413 | else |
@@ -1421,19 +1416,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1421 | " Geom:" + geom); | 1416 | " Geom:" + geom); |
1422 | } | 1417 | } |
1423 | } | 1418 | } |
1424 | else // odd currentspace is null or doesn't contain the geom? lets try the geom ideia of current space | 1419 | else |
1425 | { | 1420 | { |
1426 | currentspace = d.GeomGetSpace(geom); | 1421 | currentspace = SafeNativeMethods.GeomGetSpace(geom); |
1427 | if (currentspace != IntPtr.Zero) | 1422 | if (currentspace != IntPtr.Zero) |
1428 | { | 1423 | { |
1429 | if (d.GeomIsSpace(currentspace)) | 1424 | if (SafeNativeMethods.GeomIsSpace(currentspace)) |
1430 | { | 1425 | { |
1431 | waitForSpaceUnlock(currentspace); | 1426 | waitForSpaceUnlock(currentspace); |
1432 | d.SpaceRemove(currentspace, geom); | 1427 | SafeNativeMethods.SpaceRemove(currentspace, geom); |
1433 | 1428 | ||
1434 | if (d.SpaceGetSublevel(currentspace) > 2 && d.SpaceGetNumGeoms(currentspace) == 0) | 1429 | if (SafeNativeMethods.SpaceGetSublevel(currentspace) > 2 && SafeNativeMethods.SpaceGetNumGeoms(currentspace) == 0) |
1435 | { | 1430 | { |
1436 | d.SpaceDestroy(currentspace); | 1431 | SafeNativeMethods.SpaceDestroy(currentspace); |
1437 | } | 1432 | } |
1438 | } | 1433 | } |
1439 | } | 1434 | } |
@@ -1441,12 +1436,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1441 | 1436 | ||
1442 | // put the geom in the newspace | 1437 | // put the geom in the newspace |
1443 | waitForSpaceUnlock(StaticSpace); | 1438 | waitForSpaceUnlock(StaticSpace); |
1444 | d.SpaceAdd(StaticSpace, geom); | 1439 | if(SafeNativeMethods.SpaceQuery(StaticSpace, geom)) |
1440 | m_log.Info("[Physics]: 'MoveGeomToStaticSpace' geom already in static space:" + geom); | ||
1441 | else | ||
1442 | SafeNativeMethods.SpaceAdd(StaticSpace, geom); | ||
1445 | 1443 | ||
1446 | return StaticSpace; | 1444 | return StaticSpace; |
1447 | } | 1445 | } |
1448 | |||
1449 | |||
1450 | #endregion | 1446 | #endregion |
1451 | 1447 | ||
1452 | 1448 | ||
@@ -1485,7 +1481,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1485 | return; | 1481 | return; |
1486 | } | 1482 | } |
1487 | 1483 | ||
1488 | d.AllocateODEDataForThread(~0U); | 1484 | SafeNativeMethods.AllocateODEDataForThread(~0U); |
1489 | 1485 | ||
1490 | ODEchangeitem item; | 1486 | ODEchangeitem item; |
1491 | 1487 | ||
@@ -1585,7 +1581,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1585 | double moveTime = 0; | 1581 | double moveTime = 0; |
1586 | double rayTime = 0; | 1582 | double rayTime = 0; |
1587 | */ | 1583 | */ |
1588 | d.AllocateODEDataForThread(~0U); | 1584 | SafeNativeMethods.AllocateODEDataForThread(~0U); |
1589 | 1585 | ||
1590 | if (ChangesQueue.Count > 0) | 1586 | if (ChangesQueue.Count > 0) |
1591 | { | 1587 | { |
@@ -1689,7 +1685,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1689 | pobj.SendCollisions((int)(odetimestepMS)); | 1685 | pobj.SendCollisions((int)(odetimestepMS)); |
1690 | if(pobj.Body != IntPtr.Zero && !pobj.m_isSelected && | 1686 | if(pobj.Body != IntPtr.Zero && !pobj.m_isSelected && |
1691 | !pobj.m_disabled && !pobj.m_building && | 1687 | !pobj.m_disabled && !pobj.m_building && |
1692 | !d.BodyIsEnabled(pobj.Body)) | 1688 | !SafeNativeMethods.BodyIsEnabled(pobj.Body)) |
1693 | sleepers.Add(pobj); | 1689 | sleepers.Add(pobj); |
1694 | } | 1690 | } |
1695 | break; | 1691 | break; |
@@ -1704,8 +1700,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1704 | 1700 | ||
1705 | // do a ode simulation step | 1701 | // do a ode simulation step |
1706 | // tmpTime = Util.GetTimeStampMS(); | 1702 | // tmpTime = Util.GetTimeStampMS(); |
1707 | d.WorldQuickStep(world, ODE_STEPSIZE); | 1703 | SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); |
1708 | d.JointGroupEmpty(contactgroup); | 1704 | SafeNativeMethods.JointGroupEmpty(contactgroup); |
1709 | // qstepTIme += Util.GetTimeStampMS() - tmpTime; | 1705 | // qstepTIme += Util.GetTimeStampMS() - tmpTime; |
1710 | 1706 | ||
1711 | // update managed ideia of physical data and do updates to core | 1707 | // update managed ideia of physical data and do updates to core |
@@ -1828,26 +1824,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1828 | 1824 | ||
1829 | } | 1825 | } |
1830 | */ | 1826 | */ |
1831 | /* | ||
1832 | // Finished with all sim stepping. If requested, dump world state to file for debugging. | ||
1833 | // TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed? | ||
1834 | // TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots? | ||
1835 | if (physics_logging && (physics_logging_interval > 0) && (framecount % physics_logging_interval == 0)) | ||
1836 | { | ||
1837 | string fname = "state-" + world.ToString() + ".DIF"; // give each physics world a separate filename | ||
1838 | string prefix = "world" + world.ToString(); // prefix for variable names in exported .DIF file | ||
1839 | |||
1840 | if (physics_logging_append_existing_logfile) | ||
1841 | { | ||
1842 | string header = "-------------- START OF PHYSICS FRAME " + framecount.ToString() + " --------------"; | ||
1843 | TextWriter fwriter = File.AppendText(fname); | ||
1844 | fwriter.WriteLine(header); | ||
1845 | fwriter.Close(); | ||
1846 | } | ||
1847 | |||
1848 | d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); | ||
1849 | } | ||
1850 | */ | ||
1851 | fps = (float)nodeframes * ODE_STEPSIZE / reqTimeStep; | 1827 | fps = (float)nodeframes * ODE_STEPSIZE / reqTimeStep; |
1852 | 1828 | ||
1853 | if(step_time < HalfOdeStep) | 1829 | if(step_time < HalfOdeStep) |
@@ -2208,35 +2184,35 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2208 | 2184 | ||
2209 | lock (OdeLock) | 2185 | lock (OdeLock) |
2210 | { | 2186 | { |
2211 | d.AllocateODEDataForThread(~0U); | 2187 | SafeNativeMethods.AllocateODEDataForThread(~0U); |
2212 | 2188 | ||
2213 | if (TerrainGeom != IntPtr.Zero) | 2189 | if (TerrainGeom != IntPtr.Zero) |
2214 | { | 2190 | { |
2215 | actor_name_map.Remove(TerrainGeom); | 2191 | actor_name_map.Remove(TerrainGeom); |
2216 | d.GeomDestroy(TerrainGeom); | 2192 | SafeNativeMethods.GeomDestroy(TerrainGeom); |
2217 | 2193 | ||
2218 | } | 2194 | } |
2219 | 2195 | ||
2220 | if (TerrainHeightFieldHeightsHandler.IsAllocated) | 2196 | if (TerrainHeightFieldHeightsHandler.IsAllocated) |
2221 | TerrainHeightFieldHeightsHandler.Free(); | 2197 | TerrainHeightFieldHeightsHandler.Free(); |
2222 | 2198 | ||
2223 | IntPtr HeightmapData = d.GeomHeightfieldDataCreate(); | 2199 | IntPtr HeightmapData = SafeNativeMethods.GeomHeightfieldDataCreate(); |
2224 | 2200 | ||
2225 | TerrainHeightFieldHeightsHandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned); | 2201 | TerrainHeightFieldHeightsHandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned); |
2226 | 2202 | ||
2227 | d.GeomHeightfieldDataBuildSingle(HeightmapData, TerrainHeightFieldHeightsHandler.AddrOfPinnedObject(), 0, | 2203 | SafeNativeMethods.GeomHeightfieldDataBuildSingle(HeightmapData, TerrainHeightFieldHeightsHandler.AddrOfPinnedObject(), 0, |
2228 | heightmapHeight, heightmapWidth , | 2204 | heightmapHeight, heightmapWidth , |
2229 | (int)heightmapHeightSamples, (int)heightmapWidthSamples, scale, | 2205 | (int)heightmapHeightSamples, (int)heightmapWidthSamples, scale, |
2230 | offset, thickness, wrap); | 2206 | offset, thickness, wrap); |
2231 | 2207 | ||
2232 | d.GeomHeightfieldDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1); | 2208 | SafeNativeMethods.GeomHeightfieldDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1); |
2233 | 2209 | ||
2234 | TerrainGeom = d.CreateHeightfield(GroundSpace, HeightmapData, 1); | 2210 | TerrainGeom = SafeNativeMethods.CreateHeightfield(GroundSpace, HeightmapData, 1); |
2235 | 2211 | ||
2236 | if (TerrainGeom != IntPtr.Zero) | 2212 | if (TerrainGeom != IntPtr.Zero) |
2237 | { | 2213 | { |
2238 | d.GeomSetCategoryBits(TerrainGeom, (uint)(CollisionCategories.Land)); | 2214 | SafeNativeMethods.GeomSetCategoryBits(TerrainGeom, (uint)(CollisionCategories.Land)); |
2239 | d.GeomSetCollideBits(TerrainGeom, 0); | 2215 | SafeNativeMethods.GeomSetCollideBits(TerrainGeom, 0); |
2240 | 2216 | ||
2241 | PhysicsActor pa = new NullPhysicsActor(); | 2217 | PhysicsActor pa = new NullPhysicsActor(); |
2242 | pa.Name = "Terrain"; | 2218 | pa.Name = "Terrain"; |
@@ -2245,14 +2221,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2245 | 2221 | ||
2246 | // geom_name_map[GroundGeom] = "Terrain"; | 2222 | // geom_name_map[GroundGeom] = "Terrain"; |
2247 | 2223 | ||
2248 | d.Quaternion q = new d.Quaternion(); | 2224 | SafeNativeMethods.Quaternion q = new SafeNativeMethods.Quaternion(); |
2249 | q.X = 0.5f; | 2225 | q.X = 0.5f; |
2250 | q.Y = 0.5f; | 2226 | q.Y = 0.5f; |
2251 | q.Z = 0.5f; | 2227 | q.Z = 0.5f; |
2252 | q.W = 0.5f; | 2228 | q.W = 0.5f; |
2253 | 2229 | ||
2254 | d.GeomSetQuaternion(TerrainGeom, ref q); | 2230 | SafeNativeMethods.GeomSetQuaternion(TerrainGeom, ref q); |
2255 | d.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); | 2231 | SafeNativeMethods.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); |
2256 | TerrainHeightFieldHeight = _heightmap; | 2232 | TerrainHeightFieldHeight = _heightmap; |
2257 | } | 2233 | } |
2258 | else | 2234 | else |
@@ -2320,7 +2296,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2320 | if (TerrainGeom != IntPtr.Zero) | 2296 | if (TerrainGeom != IntPtr.Zero) |
2321 | { | 2297 | { |
2322 | actor_name_map.Remove(TerrainGeom); | 2298 | actor_name_map.Remove(TerrainGeom); |
2323 | d.GeomDestroy(TerrainGeom); | 2299 | SafeNativeMethods.GeomDestroy(TerrainGeom); |
2324 | } | 2300 | } |
2325 | 2301 | ||
2326 | if (TerrainHeightFieldHeightsHandler.IsAllocated) | 2302 | if (TerrainHeightFieldHeightsHandler.IsAllocated) |
@@ -2328,7 +2304,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2328 | 2304 | ||
2329 | TerrainHeightFieldHeight = null; | 2305 | TerrainHeightFieldHeight = null; |
2330 | 2306 | ||
2331 | IntPtr HeightmapData = d.GeomOSTerrainDataCreate(); | 2307 | IntPtr HeightmapData = SafeNativeMethods.GeomOSTerrainDataCreate(); |
2332 | 2308 | ||
2333 | const int wrap = 0; | 2309 | const int wrap = 0; |
2334 | float thickness = hfmin; | 2310 | float thickness = hfmin; |
@@ -2337,16 +2313,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2337 | 2313 | ||
2338 | TerrainHeightFieldHeightsHandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned); | 2314 | TerrainHeightFieldHeightsHandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned); |
2339 | 2315 | ||
2340 | d.GeomOSTerrainDataBuild(HeightmapData, TerrainHeightFieldHeightsHandler.AddrOfPinnedObject(), 0, 1.0f, | 2316 | SafeNativeMethods.GeomOSTerrainDataBuild(HeightmapData, TerrainHeightFieldHeightsHandler.AddrOfPinnedObject(), 0, 1.0f, |
2341 | (int)heightmapWidthSamples, (int)heightmapHeightSamples, | 2317 | (int)heightmapWidthSamples, (int)heightmapHeightSamples, |
2342 | thickness, wrap); | 2318 | thickness, wrap); |
2343 | 2319 | ||
2344 | // d.GeomOSTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1); | 2320 | // d.GeomOSTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1); |
2345 | TerrainGeom = d.CreateOSTerrain(GroundSpace, HeightmapData, 1); | 2321 | TerrainGeom = SafeNativeMethods.CreateOSTerrain(GroundSpace, HeightmapData, 1); |
2346 | if (TerrainGeom != IntPtr.Zero) | 2322 | if (TerrainGeom != IntPtr.Zero) |
2347 | { | 2323 | { |
2348 | d.GeomSetCategoryBits(TerrainGeom, (uint)(CollisionCategories.Land)); | 2324 | SafeNativeMethods.GeomSetCategoryBits(TerrainGeom, (uint)(CollisionCategories.Land)); |
2349 | d.GeomSetCollideBits(TerrainGeom, 0); | 2325 | SafeNativeMethods.GeomSetCollideBits(TerrainGeom, 0); |
2350 | 2326 | ||
2351 | PhysicsActor pa = new NullPhysicsActor(); | 2327 | PhysicsActor pa = new NullPhysicsActor(); |
2352 | pa.Name = "Terrain"; | 2328 | pa.Name = "Terrain"; |
@@ -2355,7 +2331,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2355 | 2331 | ||
2356 | // geom_name_map[GroundGeom] = "Terrain"; | 2332 | // geom_name_map[GroundGeom] = "Terrain"; |
2357 | 2333 | ||
2358 | d.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); | 2334 | SafeNativeMethods.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); |
2359 | TerrainHeightFieldHeight = _heightmap; | 2335 | TerrainHeightFieldHeight = _heightmap; |
2360 | } | 2336 | } |
2361 | else | 2337 | else |
@@ -2385,7 +2361,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2385 | if (world == IntPtr.Zero) | 2361 | if (world == IntPtr.Zero) |
2386 | return; | 2362 | return; |
2387 | 2363 | ||
2388 | d.AllocateODEDataForThread(~0U); | 2364 | SafeNativeMethods.AllocateODEDataForThread(~0U); |
2389 | 2365 | ||
2390 | if (m_meshWorker != null) | 2366 | if (m_meshWorker != null) |
2391 | m_meshWorker.Stop(); | 2367 | m_meshWorker.Stop(); |
@@ -2419,7 +2395,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2419 | ch.DoAChange(changes.Remove, null); | 2395 | ch.DoAChange(changes.Remove, null); |
2420 | 2396 | ||
2421 | if (TerrainGeom != IntPtr.Zero) | 2397 | if (TerrainGeom != IntPtr.Zero) |
2422 | d.GeomDestroy(TerrainGeom); | 2398 | SafeNativeMethods.GeomDestroy(TerrainGeom); |
2423 | TerrainGeom = IntPtr.Zero; | 2399 | TerrainGeom = IntPtr.Zero; |
2424 | 2400 | ||
2425 | if (TerrainHeightFieldHeightsHandler.IsAllocated) | 2401 | if (TerrainHeightFieldHeightsHandler.IsAllocated) |
@@ -2438,7 +2414,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
2438 | GlobalContactsArray = IntPtr.Zero; | 2414 | GlobalContactsArray = IntPtr.Zero; |
2439 | } | 2415 | } |
2440 | 2416 | ||
2441 | d.WorldDestroy(world); | 2417 | SafeNativeMethods.WorldDestroy(world); |
2442 | world = IntPtr.Zero; | 2418 | world = IntPtr.Zero; |
2443 | //d.CloseODE(); | 2419 | //d.CloseODE(); |
2444 | } | 2420 | } |
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs b/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs index 214205d..f882e6c 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs | |||
@@ -27,13 +27,7 @@ | |||
27 | // Ubit Umarov 2012 | 27 | // Ubit Umarov 2012 |
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | ||
31 | using System.Runtime.InteropServices; | ||
32 | using System.Text; | ||
33 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.PhysicsModules.SharedBase; | 30 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | using OdeAPI; | ||
36 | using log4net; | ||
37 | using OpenMetaverse; | 31 | using OpenMetaverse; |
38 | 32 | ||
39 | namespace OpenSim.Region.PhysicsModule.ubOde | 33 | namespace OpenSim.Region.PhysicsModule.ubOde |
@@ -78,8 +72,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
78 | 72 | ||
79 | IntPtr geom = ((OdePrim)actor).prim_geom; | 73 | IntPtr geom = ((OdePrim)actor).prim_geom; |
80 | 74 | ||
81 | Vector3 geopos = d.GeomGetPositionOMV(geom); | 75 | Vector3 geopos = SafeNativeMethods.GeomGetPositionOMV(geom); |
82 | Quaternion geomOri = d.GeomGetQuaternionOMV(geom); | 76 | Quaternion geomOri = SafeNativeMethods.GeomGetQuaternionOMV(geom); |
83 | 77 | ||
84 | // Vector3 geopos = actor.Position; | 78 | // Vector3 geopos = actor.Position; |
85 | // Quaternion geomOri = actor.Orientation; | 79 | // Quaternion geomOri = actor.Orientation; |
@@ -123,11 +117,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
123 | 117 | ||
124 | offset = rayResults[0].Pos - geopos; | 118 | offset = rayResults[0].Pos - geopos; |
125 | 119 | ||
126 | d.GeomClassID geoclass = d.GeomGetClass(geom); | 120 | SafeNativeMethods.GeomClassID geoclass = SafeNativeMethods.GeomGetClass(geom); |
127 | 121 | ||
128 | if (geoclass == d.GeomClassID.SphereClass) | 122 | if (geoclass == SafeNativeMethods.GeomClassID.SphereClass) |
129 | { | 123 | { |
130 | float r = d.GeomSphereGetRadius(geom); | 124 | float r = SafeNativeMethods.GeomSphereGetRadius(geom); |
131 | 125 | ||
132 | offset.Normalize(); | 126 | offset.Normalize(); |
133 | offset *= r; | 127 | offset *= r; |