diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEApi.cs b/OpenSim/Region/PhysicsModules/Ode/ODEApi.cs index bf903ad538..e271fb15fb 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEApi.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEApi.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.PhysicsModule.ODE using dReal = System.Single; //#endif - internal static class SafeNativeMethods + internal static class OdeNative { internal static dReal Infinity = dReal.MaxValue; internal static int NTotalBodies = 0; @@ -349,19 +349,17 @@ namespace OpenSim.Region.PhysicsModule.ODE internal dReal slip2; } - - [StructLayout(LayoutKind.Sequential)] + [StructLayout(LayoutKind.Sequential, Size = 16)] internal struct Vector3 { internal Vector3(dReal x, dReal y, dReal z) { - X = x; Y = y; Z = z; _w = 0.0f; + X = x; Y = y; Z = z; //_w = 0.0f; } internal dReal X, Y, Z; - private dReal _w; + //private dReal _w; } - [StructLayout(LayoutKind.Sequential)] internal struct Vector4 { @@ -374,58 +372,58 @@ namespace OpenSim.Region.PhysicsModule.ODE #endregion - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAllocateODEDataForThread"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAllocateODEDataForThread"), SuppressUnmanagedCodeSecurity] internal static extern int AllocateODEDataForThread(uint ODEInitFlags); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnected"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnected"), SuppressUnmanagedCodeSecurity] internal static extern bool AreConnected(IntPtr b1, IntPtr b2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnectedExcluding"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnectedExcluding"), SuppressUnmanagedCodeSecurity] internal static extern bool AreConnectedExcluding(IntPtr b1, IntPtr b2, JointType joint_type); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForce"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForce"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddForce(IntPtr body, dReal fx, dReal fy, dReal fz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtPos"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtPos"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtRelPos"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtRelPos"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForce"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForce"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddRelForce(IntPtr body, dReal fx, dReal fy, dReal fz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtPos"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtPos"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddRelForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtRelPos"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtRelPos"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddRelForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelTorque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelTorque"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddRelTorque(IntPtr body, dReal fx, dReal fy, dReal fz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddTorque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddTorque"), SuppressUnmanagedCodeSecurity] internal static extern void BodyAddTorque(IntPtr body, dReal fx, dReal fy, dReal fz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] internal static extern void BodyCopyPosition(IntPtr body, out Vector3 pos); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] internal static extern void BodyCopyPosition(IntPtr body, out dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void BodyCopyQuaternion(IntPtr body, out Quaternion quat); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void BodyCopyQuaternion(IntPtr body, out dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] internal static extern void BodyCopyRotation(IntPtr body, out Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] internal static extern void BodyCopyRotation(IntPtr body, out dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr BodyiCreate(IntPtr world); internal static IntPtr BodyCreate(IntPtr world) { @@ -433,7 +431,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return BodyiCreate(world); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void BodyiDestroy(IntPtr body); internal static void BodyDestroy(IntPtr body) { @@ -441,189 +439,189 @@ namespace OpenSim.Region.PhysicsModule.ODE BodyiDestroy(body); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDisable"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDisable"), SuppressUnmanagedCodeSecurity] internal static extern void BodyDisable(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyEnable"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyEnable"), SuppressUnmanagedCodeSecurity] internal static extern void BodyEnable(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal BodyGetAutoDisableAngularThreshold(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] internal static extern bool BodyGetAutoDisableFlag(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] internal static extern void BodyGetAutoDisableDefaults(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal BodyGetAutoDisableLinearThreshold(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] internal static extern int BodyGetAutoDisableSteps(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] internal static extern dReal BodyGetAutoDisableTime(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularVel"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Vector3* BodyGetAngularVelUnsafe(IntPtr body); internal static Vector3 BodyGetAngularVel(IntPtr body) { unsafe { return *(BodyGetAngularVelUnsafe(body)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetData"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr BodyGetData(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] internal static extern int BodyGetFiniteRotationMode(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] internal static extern void BodyGetFiniteRotationAxis(IntPtr body, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetForce"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetForce"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Vector3* BodyGetForceUnsafe(IntPtr body); internal static Vector3 BodyGetForce(IntPtr body) { unsafe { return *(BodyGetForceUnsafe(body)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGravityMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGravityMode"), SuppressUnmanagedCodeSecurity] internal static extern bool BodyGetGravityMode(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGyroscopicMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGyroscopicMode"), SuppressUnmanagedCodeSecurity] internal static extern int BodyGetGyroscopicMode(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetJoint"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetJoint"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr BodyGetJoint(IntPtr body, int index); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearVel"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Vector3* BodyGetLinearVelUnsafe(IntPtr body); internal static Vector3 BodyGetLinearVel(IntPtr body) { unsafe { return *(BodyGetLinearVelUnsafe(body)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetMass"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetMass"), SuppressUnmanagedCodeSecurity] internal static extern void BodyGetMass(IntPtr body, out Mass mass); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNumJoints"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNumJoints"), SuppressUnmanagedCodeSecurity] internal static extern int BodyGetNumJoints(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPointVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPointVel"), SuppressUnmanagedCodeSecurity] internal static extern void BodyGetPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosition"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Vector3* BodyGetPositionUnsafe(IntPtr body); internal static Vector3 BodyGetPosition(IntPtr body) { unsafe { return *(BodyGetPositionUnsafe(body)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosRelPoint"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosRelPoint"), SuppressUnmanagedCodeSecurity] internal static extern void BodyGetPosRelPoint(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetQuaternion"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Quaternion* BodyGetQuaternionUnsafe(IntPtr body); internal static Quaternion BodyGetQuaternion(IntPtr body) { unsafe { return *(BodyGetQuaternionUnsafe(body)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointPos"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointPos"), SuppressUnmanagedCodeSecurity] internal static extern void BodyGetRelPointPos(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointVel"), SuppressUnmanagedCodeSecurity] internal static extern void BodyGetRelPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRotation"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Matrix3* BodyGetRotationUnsafe(IntPtr body); internal static Matrix3 BodyGetRotation(IntPtr body) { unsafe { return *(BodyGetRotationUnsafe(body)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetTorque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetTorque"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Vector3* BodyGetTorqueUnsafe(IntPtr body); internal static Vector3 BodyGetTorque(IntPtr body) { unsafe { return *(BodyGetTorqueUnsafe(body)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetWorld"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetWorld"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr BodyGetWorld(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFirstGeom"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFirstGeom"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr BodyGetFirstGeom(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNextGeom"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNextGeom"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr dBodyGetNextGeom(IntPtr Geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyIsEnabled"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyIsEnabled"), SuppressUnmanagedCodeSecurity] internal static extern bool BodyIsEnabled(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularVel"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAngularVel(IntPtr body, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAutoDisableAngularThreshold(IntPtr body, dReal angular_threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAutoDisableDefaults(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAutoDisableFlag(IntPtr body, bool do_auto_disable); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAutoDisableLinearThreshold(IntPtr body, dReal linear_threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAutoDisableSteps(IntPtr body, int steps); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableTime"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableTime"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAutoDisableTime(IntPtr body, dReal time); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetData"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetData(IntPtr body, IntPtr data); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetFiniteRotationMode(IntPtr body, int mode); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetFiniteRotationAxis(IntPtr body, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDamping"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetLinearDamping(IntPtr body, dReal scale); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAngularDamping(IntPtr body, dReal scale); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDamping"), SuppressUnmanagedCodeSecurity] internal static extern dReal BodyGetLinearDamping(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDamping"), SuppressUnmanagedCodeSecurity] internal static extern dReal BodyGetAngularDamping(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetDamping(IntPtr body, dReal linear_scale, dReal angular_scale); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetAngularDampingThreshold(IntPtr body, dReal threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetLinearDampingThreshold(IntPtr body, dReal threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal BodyGetLinearDampingThreshold(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal BodyGetAngularDampingThreshold(IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetForce"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetForce"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetForce(IntPtr body, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGravityMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGravityMode"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetGravityMode(IntPtr body, bool mode); /// @@ -631,71 +629,71 @@ namespace OpenSim.Region.PhysicsModule.ODE /// /// Pointer to body /// NonZero enabled, Zero disabled - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGyroscopicMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGyroscopicMode"), SuppressUnmanagedCodeSecurity] internal static extern void dBodySetGyroscopicMode(IntPtr body, int enabled); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearVel"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetLinearVel(IntPtr body, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetMass"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetMass"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetMass(IntPtr body, ref Mass mass); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetPosition"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetPosition(IntPtr body, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetQuaternion(IntPtr body, ref Quaternion q); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetQuaternion(IntPtr body, ref dReal w); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetRotation(IntPtr body, ref Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetRotation(IntPtr body, ref dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetTorque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetTorque"), SuppressUnmanagedCodeSecurity] internal static extern void BodySetTorque(IntPtr body, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorFromWorld"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorFromWorld"), SuppressUnmanagedCodeSecurity] internal static extern void BodyVectorFromWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorToWorld"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorToWorld"), SuppressUnmanagedCodeSecurity] internal static extern void BodyVectorToWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxBox"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxBox"), SuppressUnmanagedCodeSecurity] internal static extern void BoxBox(ref Vector3 p1, ref Matrix3 R1, ref Vector3 side1, ref Vector3 p2, ref Matrix3 R2, ref Vector3 side2, ref Vector3 normal, out dReal depth, out int return_code, int maxc, out ContactGeom contact, int skip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxTouchesBox"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxTouchesBox"), SuppressUnmanagedCodeSecurity] internal static extern void BoxTouchesBox(ref Vector3 _p1, ref Matrix3 R1, ref Vector3 side1, ref Vector3 _p2, ref Matrix3 R2, ref Vector3 side2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCleanupODEAllDataForThread"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCleanupODEAllDataForThread"), SuppressUnmanagedCodeSecurity] internal static extern void CleanupODEAllDataForThread(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dClosestLineSegmentPoints"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dClosestLineSegmentPoints"), SuppressUnmanagedCodeSecurity] internal static extern void ClosestLineSegmentPoints(ref Vector3 a1, ref Vector3 a2, ref Vector3 b1, ref Vector3 b2, ref Vector3 cp1, ref Vector3 cp2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCloseODE"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCloseODE"), SuppressUnmanagedCodeSecurity] internal static extern void CloseODE(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] internal static extern int Collide(IntPtr o1, IntPtr o2, int flags, [In, Out] ContactGeom[] contact, int skip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] internal static extern int CollidePtr(IntPtr o1, IntPtr o2, int flags, IntPtr contactgeomarray, int skip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dConnectingJoint"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dConnectingJoint"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr ConnectingJoint(IntPtr j1, IntPtr j2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiBox(IntPtr space, dReal lx, dReal ly, dReal lz); internal static IntPtr CreateBox(IntPtr space, dReal lx, dReal ly, dReal lz) { @@ -703,7 +701,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiBox(space, lx, ly, lz); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiCapsule(IntPtr space, dReal radius, dReal length); internal static IntPtr CreateCapsule(IntPtr space, dReal radius, dReal length) { @@ -711,7 +709,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiCapsule(space, radius, length); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); internal static IntPtr CreateConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons) { @@ -719,7 +717,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiConvex(space, planes, planeCount, points, pointCount, polygons); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiCylinder(IntPtr space, dReal radius, dReal length); internal static IntPtr CreateCylinder(IntPtr space, dReal radius, dReal length) { @@ -727,7 +725,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiCylinder(space, radius, length); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiHeightfield(IntPtr space, IntPtr data, int bPlaceable); internal static IntPtr CreateHeightfield(IntPtr space, IntPtr data, int bPlaceable) { @@ -735,7 +733,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiHeightfield(space, data, bPlaceable); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateOSTerrain"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateOSTerrain"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiOSTerrain(IntPtr space, IntPtr data, int bPlaceable); internal static IntPtr CreateOSTerrain(IntPtr space, IntPtr data, int bPlaceable) { @@ -747,7 +745,7 @@ namespace OpenSim.Region.PhysicsModule.ODE - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiGeom(int classnum); internal static IntPtr CreateGeom(int classnum) { @@ -755,13 +753,13 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiGeom(classnum); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity] internal static extern int CreateGeomClass(ref GeomClass classptr); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomTransform"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomTransform"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateGeomTransform(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiPlane(IntPtr space, dReal a, dReal b, dReal c, dReal d); internal static IntPtr CreatePlane(IntPtr space, dReal a, dReal b, dReal c, dReal d) { @@ -769,7 +767,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiPlane(space, a, b, c, d); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiRay(IntPtr space, dReal length); internal static IntPtr CreateRay(IntPtr space, dReal length) { @@ -777,7 +775,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiRay(space, length); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiSphere(IntPtr space, dReal radius); internal static IntPtr CreateSphere(IntPtr space, dReal radius) { @@ -785,7 +783,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return CreateiSphere(space, radius); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateiTriMesh(IntPtr space, IntPtr data, TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback); internal static IntPtr CreateTriMesh(IntPtr space, IntPtr data, @@ -794,79 +792,79 @@ namespace OpenSim.Region.PhysicsModule.ODE NTotalGeoms++; return CreateiTriMesh(space, data, callback, arrayCallback, rayCallback); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDot"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDot"), SuppressUnmanagedCodeSecurity] internal static extern dReal Dot(ref dReal X0, ref dReal X1, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity] internal static extern void DQfromW(dReal[] dq, ref Vector3 w, ref Quaternion q); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorCholesky"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorCholesky"), SuppressUnmanagedCodeSecurity] internal static extern int FactorCholesky(ref dReal A00, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorLDLT"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorLDLT"), SuppressUnmanagedCodeSecurity] internal static extern void FactorLDLT(ref dReal A, out dReal d, int n, int nskip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] internal static extern void GeomBoxGetLengths(IntPtr geom, out Vector3 len); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] internal static extern void GeomBoxGetLengths(IntPtr geom, out dReal x); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxPointDepth"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxPointDepth"), SuppressUnmanagedCodeSecurity] internal static extern dReal GeomBoxPointDepth(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxSetLengths"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxSetLengths"), SuppressUnmanagedCodeSecurity] internal static extern void GeomBoxSetLengths(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleGetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleGetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCapsuleGetParams(IntPtr geom, out dReal radius, out dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsulePointDepth"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsulePointDepth"), SuppressUnmanagedCodeSecurity] internal static extern dReal GeomCapsulePointDepth(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleSetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleSetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCapsuleSetParams(IntPtr geom, dReal radius, dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomClearOffset"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomClearOffset"), SuppressUnmanagedCodeSecurity] internal static extern void GeomClearOffset(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref Vector3 pos); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref Quaternion Q); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyPosition(IntPtr geom, out Vector3 pos); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyPosition(IntPtr geom, out dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyRotation(IntPtr geom, out Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyRotation(IntPtr geom, out dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderGetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderGetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCylinderGetParams(IntPtr geom, out dReal radius, out dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderSetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderSetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCylinderSetParams(IntPtr geom, dReal radius, dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void GeomiDestroy(IntPtr geom); internal static void GeomDestroy(IntPtr geom) { @@ -875,51 +873,51 @@ namespace OpenSim.Region.PhysicsModule.ODE } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity] internal static extern void GeomDisable(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomEnable"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomEnable"), SuppressUnmanagedCodeSecurity] internal static extern void GeomEnable(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] internal static extern void GeomGetAABB(IntPtr geom, out AABB aabb); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] internal static extern void GeomGetAABB(IntPtr geom, out dReal minX); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetBody"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetBody"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomGetBody(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCategoryBits"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCategoryBits"), SuppressUnmanagedCodeSecurity] internal static extern uint GeomGetCategoryBits(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClassData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClassData"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomGetClassData(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCollideBits"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCollideBits"), SuppressUnmanagedCodeSecurity] internal static extern uint GeomGetCollideBits(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClass"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClass"), SuppressUnmanagedCodeSecurity] internal static extern GeomClassID GeomGetClass(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetData"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomGetData(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetPosition"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Vector3* GeomGetOffsetPositionUnsafe(IntPtr geom); internal static Vector3 GeomGetOffsetPosition(IntPtr geom) { unsafe { return *(GeomGetOffsetPositionUnsafe(geom)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetRotation"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Matrix3* GeomGetOffsetRotationUnsafe(IntPtr geom); internal static Matrix3 GeomGetOffsetRotation(IntPtr geom) { unsafe { return *(GeomGetOffsetRotationUnsafe(geom)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetPosition"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Vector3* GeomGetPositionUnsafe(IntPtr geom); internal static Vector3 GeomGetPosition(IntPtr geom) { @@ -931,7 +929,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return new OMV.Vector3(vtmp.X, vtmp.Y, vtmp.Z); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyQuaternion(IntPtr geom, out Quaternion q); internal static OMV.Quaternion GeomGetQuaternionOMV(IntPtr geom) { @@ -940,391 +938,391 @@ namespace OpenSim.Region.PhysicsModule.ODE return new OMV.Quaternion(qtmp.X, qtmp.Y, qtmp.Z, qtmp.W); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomCopyQuaternion(IntPtr geom, out dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetRotation"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Matrix3* GeomGetRotationUnsafe(IntPtr geom); internal static Matrix3 GeomGetRotation(IntPtr geom) { unsafe { return *(GeomGetRotationUnsafe(geom)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetSpace"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetSpace"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomGetSpace(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildByte(IntPtr d, byte[] pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildByte(IntPtr d, IntPtr pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildCallback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildCallback"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildCallback(IntPtr d, IntPtr pUserData, HeightfieldGetHeight pCallback, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, ushort[] pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, short[] pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, IntPtr pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildSingle(IntPtr d, float[] pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildSingle(IntPtr d, IntPtr pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildDouble(IntPtr d, double[] pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataBuildDouble(IntPtr d, IntPtr pHeightData, int bCopyHeightData, dReal width, dReal depth, int widthSamples, int depthSamples, dReal scale, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomHeightfieldDataCreate(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataDestroy(IntPtr d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataSetBounds"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataSetBounds"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldGetHeightfieldData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldGetHeightfieldData"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomHeightfieldGetHeightfieldData(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldSetHeightfieldData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldSetHeightfieldData"), SuppressUnmanagedCodeSecurity] internal static extern void GeomHeightfieldSetHeightfieldData(IntPtr g, IntPtr d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity] internal static extern void GeomOSTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData, dReal sampleSize, int widthSamples, int depthSamples, dReal offset, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataBuild"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataBuild"), SuppressUnmanagedCodeSecurity] internal static extern void GeomOSTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData, dReal sampleSize, int widthSamples, int depthSamples, dReal thickness, int bWrap); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomOSTerrainDataCreate(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void GeomOSTerrainDataDestroy(IntPtr d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity] internal static extern void GeomOSTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomOSTerrainGetHeightfieldData(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity] internal static extern void GeomOSTerrainSetHeightfieldData(IntPtr g, IntPtr d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity] internal static extern bool GeomIsEnabled(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsOffset"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsOffset"), SuppressUnmanagedCodeSecurity] internal static extern bool GeomIsOffset(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsSpace"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsSpace"), SuppressUnmanagedCodeSecurity] internal static extern bool GeomIsSpace(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomPlaneGetParams(IntPtr geom, ref Vector4 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomPlaneGetParams(IntPtr geom, ref dReal A); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlanePointDepth"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlanePointDepth"), SuppressUnmanagedCodeSecurity] internal static extern dReal GeomPlanePointDepth(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneSetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneSetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomPlaneSetParams(IntPtr plane, dReal a, dReal b, dReal c, dReal d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] internal static extern void GeomRayGet(IntPtr ray, ref Vector3 start, ref Vector3 dir); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] internal static extern void GeomRayGet(IntPtr ray, ref dReal startX, ref dReal dirX); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetClosestHit"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetClosestHit"), SuppressUnmanagedCodeSecurity] internal static extern int GeomRayGetClosestHit(IntPtr ray); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetLength"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetLength"), SuppressUnmanagedCodeSecurity] internal static extern dReal GeomRayGetLength(IntPtr ray); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetParams"), SuppressUnmanagedCodeSecurity] internal static extern dReal GeomRayGetParams(IntPtr g, out int firstContact, out int backfaceCull); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySet"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySet"), SuppressUnmanagedCodeSecurity] internal static extern void GeomRaySet(IntPtr ray, dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetClosestHit"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetClosestHit"), SuppressUnmanagedCodeSecurity] internal static extern void GeomRaySetClosestHit(IntPtr ray, int closestHit); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetLength"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetLength"), SuppressUnmanagedCodeSecurity] internal static extern void GeomRaySetLength(IntPtr ray, dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetParams"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetParams"), SuppressUnmanagedCodeSecurity] internal static extern void GeomRaySetParams(IntPtr ray, int firstContact, int backfaceCull); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetBody"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetBody"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetBody(IntPtr geom, IntPtr body); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCategoryBits"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCategoryBits"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetCategoryBits(IntPtr geom, uint bits); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCollideBits"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCollideBits"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetCollideBits(IntPtr geom, uint bits); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetConvex"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetConvex"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomSetConvex(IntPtr geom, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetData"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetData(IntPtr geom, IntPtr data); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetPosition"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetPosition(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetQuaternion(IntPtr geom, ref Quaternion Q); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetQuaternion(IntPtr geom, ref dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetRotation(IntPtr geom, ref Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetRotation(IntPtr geom, ref dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldPosition"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetWorldPosition(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref Quaternion Q); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetPosition"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetPosition(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetQuaternion(IntPtr geom, ref Quaternion quat); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetQuaternion(IntPtr geom, ref dReal w); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetRotation(IntPtr geom, ref Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSetRotation(IntPtr geom, ref dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereGetRadius"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereGetRadius"), SuppressUnmanagedCodeSecurity] internal static extern dReal GeomSphereGetRadius(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSpherePointDepth"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSpherePointDepth"), SuppressUnmanagedCodeSecurity] internal static extern dReal GeomSpherePointDepth(IntPtr geom, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereSetRadius"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereSetRadius"), SuppressUnmanagedCodeSecurity] internal static extern void GeomSphereSetRadius(IntPtr geom, dReal radius); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetCleanup"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetCleanup"), SuppressUnmanagedCodeSecurity] internal static extern int GeomTransformGetCleanup(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetGeom"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetGeom"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomTransformGetGeom(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetInfo"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetInfo"), SuppressUnmanagedCodeSecurity] internal static extern int GeomTransformGetInfo(IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetCleanup"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetCleanup"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTransformSetCleanup(IntPtr geom, int mode); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetGeom"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetGeom"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTransformSetGeom(IntPtr geom, IntPtr obj); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetInfo"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetInfo"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTransformSetInfo(IntPtr geom, int info); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildDouble(IntPtr d, double[] vertices, int vertexStride, int vertexCount, int[] indices, int indexCount, int triStride); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildDouble(IntPtr d, IntPtr vertices, int vertexStride, int vertexCount, IntPtr indices, int indexCount, int triStride); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildDouble1(IntPtr d, double[] vertices, int vertexStride, int vertexCount, int[] indices, int indexCount, int triStride, double[] normals); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildDouble(IntPtr d, IntPtr vertices, int vertexStride, int vertexCount, IntPtr indices, int indexCount, int triStride, IntPtr normals); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSingle(IntPtr d, dReal[] vertices, int vertexStride, int vertexCount, int[] indices, int indexCount, int triStride); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSingle(IntPtr d, IntPtr vertices, int vertexStride, int vertexCount, IntPtr indices, int indexCount, int triStride); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSingle1(IntPtr d, dReal[] vertices, int vertexStride, int vertexCount, int[] indices, int indexCount, int triStride, dReal[] normals); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSingle1(IntPtr d, IntPtr vertices, int vertexStride, int vertexCount, IntPtr indices, int indexCount, int triStride, IntPtr normals); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSimple(IntPtr d, float[] vertices, int vertexStride, int vertexCount, int[] indices, int indexCount, int triStride); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSimple(IntPtr d, IntPtr vertices, int vertexStride, int vertexCount, IntPtr indices, int indexCount, int triStride); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSimple1(IntPtr d, float[] vertices, int vertexStride, int vertexCount, int[] indices, int indexCount, int triStride, float[] normals); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataBuildSimple1(IntPtr d, IntPtr vertices, int vertexStride, int vertexCount, IntPtr indices, int indexCount, int triStride, IntPtr normals); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshClearTCCache"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshClearTCCache"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshClearTCCache(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomTriMeshDataCreate(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataDestroy(IntPtr d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataGet"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataGet"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomTriMeshDataGet(IntPtr d, int data_id); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataPreprocess"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataPreprocess"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataPreprocess(IntPtr d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataSet"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataSet"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataSet(IntPtr d, int data_id, IntPtr in_data); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataUpdate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataUpdate"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshDataUpdate(IntPtr d); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshEnableTC"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshEnableTC"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshEnableTC(IntPtr g, int geomClass, bool enable); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetArrayCallback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetArrayCallback"), SuppressUnmanagedCodeSecurity] internal static extern TriArrayCallback GeomTriMeshGetArrayCallback(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetCallback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetCallback"), SuppressUnmanagedCodeSecurity] internal static extern TriCallback GeomTriMeshGetCallback(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetData"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomTriMeshGetData(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetLastTransform"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetLastTransform"), SuppressUnmanagedCodeSecurity] internal extern unsafe static Matrix4* GeomTriMeshGetLastTransformUnsafe(IntPtr geom); internal static Matrix4 GeomTriMeshGetLastTransform(IntPtr geom) { unsafe { return *(GeomTriMeshGetLastTransformUnsafe(geom)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetPoint"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetPoint"), SuppressUnmanagedCodeSecurity] internal extern static void GeomTriMeshGetPoint(IntPtr g, int index, dReal u, dReal v, ref Vector3 outVec); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetRayCallback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetRayCallback"), SuppressUnmanagedCodeSecurity] internal static extern TriRayCallback GeomTriMeshGetRayCallback(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangle"), SuppressUnmanagedCodeSecurity] internal extern static void GeomTriMeshGetTriangle(IntPtr g, int index, ref Vector3 v0, ref Vector3 v1, ref Vector3 v2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangleCount"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangleCount"), SuppressUnmanagedCodeSecurity] internal extern static int GeomTriMeshGetTriangleCount(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriMeshDataID"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriMeshDataID"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr GeomTriMeshGetTriMeshDataID(IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshIsTCEnabled"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshIsTCEnabled"), SuppressUnmanagedCodeSecurity] internal static extern bool GeomTriMeshIsTCEnabled(IntPtr g, int geomClass); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetArrayCallback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetArrayCallback"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshSetArrayCallback(IntPtr g, TriArrayCallback arrayCallback); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetCallback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetCallback"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshSetCallback(IntPtr g, TriCallback callback); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetData"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshSetData(IntPtr g, IntPtr data); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshSetLastTransform(IntPtr g, ref Matrix4 last_trans); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshSetLastTransform(IntPtr g, ref dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetRayCallback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetRayCallback"), SuppressUnmanagedCodeSecurity] internal static extern void GeomTriMeshSetRayCallback(IntPtr g, TriRayCallback callback); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGetConfiguration"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGetConfiguration"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr iGetConfiguration(); internal static string GetConfiguration() @@ -1334,692 +1332,692 @@ namespace OpenSim.Region.PhysicsModule.ODE return s; } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr HashSpaceCreate(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceGetLevels"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceGetLevels"), SuppressUnmanagedCodeSecurity] internal static extern void HashSpaceGetLevels(IntPtr space, out int minlevel, out int maxlevel); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceSetLevels"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceSetLevels"), SuppressUnmanagedCodeSecurity] internal static extern void HashSpaceSetLevels(IntPtr space, int minlevel, int maxlevel); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInfiniteAABB"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInfiniteAABB"), SuppressUnmanagedCodeSecurity] internal static extern void InfiniteAABB(IntPtr geom, out AABB aabb); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE"), SuppressUnmanagedCodeSecurity] internal static extern void InitODE(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE2"), SuppressUnmanagedCodeSecurity] internal static extern int InitODE2(uint ODEInitFlags); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dIsPositiveDefinite"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dIsPositiveDefinite"), SuppressUnmanagedCodeSecurity] internal static extern int IsPositiveDefinite(ref dReal A, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInvertPDMatrix"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInvertPDMatrix"), SuppressUnmanagedCodeSecurity] internal static extern int InvertPDMatrix(ref dReal A, out dReal Ainv, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddAMotorTorques"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddAMotorTorques"), SuppressUnmanagedCodeSecurity] internal static extern void JointAddAMotorTorques(IntPtr joint, dReal torque1, dReal torque2, dReal torque3); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHingeTorque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHingeTorque"), SuppressUnmanagedCodeSecurity] internal static extern void JointAddHingeTorque(IntPtr joint, dReal torque); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHinge2Torque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHinge2Torque"), SuppressUnmanagedCodeSecurity] internal static extern void JointAddHinge2Torques(IntPtr joint, dReal torque1, dReal torque2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddPRTorque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddPRTorque"), SuppressUnmanagedCodeSecurity] internal static extern void JointAddPRTorque(IntPtr joint, dReal torque); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddUniversalTorque"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddUniversalTorque"), SuppressUnmanagedCodeSecurity] internal static extern void JointAddUniversalTorques(IntPtr joint, dReal torque1, dReal torque2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddSliderForce"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddSliderForce"), SuppressUnmanagedCodeSecurity] internal static extern void JointAddSliderForce(IntPtr joint, dReal force); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAttach"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAttach"), SuppressUnmanagedCodeSecurity] internal static extern void JointAttach(IntPtr joint, IntPtr body1, IntPtr body2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateAMotor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateAMotor"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateAMotor(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateBall"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateBall"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateBall(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateContact(IntPtr world, IntPtr group, ref Contact contact); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateContactPtr(IntPtr world, IntPtr group, IntPtr contact); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateFixed"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateFixed"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateFixed(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateHinge(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge2"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateHinge2(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateLMotor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateLMotor"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateLMotor(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateNull"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateNull"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateNull(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePR"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePR"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreatePR(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePlane2D"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePlane2D"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreatePlane2D(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateSlider"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateSlider"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateSlider(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateUniversal"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateUniversal"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointCreateUniversal(IntPtr world, IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void JointDestroy(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngle"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetAMotorAngle(IntPtr j, int anum); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngleRate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngleRate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetAMotorAngleRate(IntPtr j, int anum); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetAMotorAxis(IntPtr j, int anum, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxisRel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxisRel"), SuppressUnmanagedCodeSecurity] internal static extern int JointGetAMotorAxisRel(IntPtr j, int anum); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorMode"), SuppressUnmanagedCodeSecurity] internal static extern int JointGetAMotorMode(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] internal static extern int JointGetAMotorNumAxes(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorParam"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetAMotorParam(IntPtr j, int parameter); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetBallAnchor(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor2"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetBallAnchor2(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBody"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBody"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointGetBody(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetData"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointGetData(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetFeedback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetFeedback"), SuppressUnmanagedCodeSecurity] internal extern unsafe static JointFeedback* JointGetFeedbackUnsafe(IntPtr j); internal static JointFeedback JointGetFeedback(IntPtr j) { unsafe { return *(JointGetFeedbackUnsafe(j)); } } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetHingeAnchor(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngle"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetHingeAngle(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngleRate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngleRate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetHingeAngleRate(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetHingeAxis(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeParam"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetHingeParam(IntPtr j, int parameter); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetHinge2Angle1(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1Rate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1Rate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetHinge2Angle1Rate(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle2Rate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle2Rate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetHinge2Angle2Rate(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor2"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetHingeAnchor2(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetHinge2Anchor(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor2"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetHinge2Anchor2(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis1"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetHinge2Axis1(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis2"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetHinge2Axis2(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Param"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Param"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetHinge2Param(IntPtr j, int parameter); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetLMotorAxis(IntPtr j, int anum, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] internal static extern int JointGetLMotorNumAxes(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorParam"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetLMotorParam(IntPtr j, int parameter); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetPRAnchor(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis1"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetPRAxis1(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis2"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetPRAxis2(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRParam"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetPRParam(IntPtr j, int parameter); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPosition"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetPRPosition(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPositionRate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPositionRate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetPRPositionRate(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetSliderAxis(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderParam"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetSliderParam(IntPtr j, int parameter); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPosition"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPosition"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetSliderPosition(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPositionRate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPositionRate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetSliderPositionRate(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetType"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetType"), SuppressUnmanagedCodeSecurity] internal static extern JointType JointGetType(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetUniversalAnchor(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor2"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetUniversalAnchor2(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetUniversalAngle1(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1Rate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1Rate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetUniversalAngle1Rate(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetUniversalAngle2(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2Rate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2Rate"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetUniversalAngle2Rate(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngles"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngles"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetUniversalAngles(IntPtr j, out dReal angle1, out dReal angle2); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis1"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetUniversalAxis1(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis2"), SuppressUnmanagedCodeSecurity] internal static extern void JointGetUniversalAxis2(IntPtr j, out Vector3 result); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalParam"), SuppressUnmanagedCodeSecurity] internal static extern dReal JointGetUniversalParam(IntPtr j, int parameter); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr JointGroupCreate(int max_size); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void JointGroupDestroy(IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupEmpty"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupEmpty"), SuppressUnmanagedCodeSecurity] internal static extern void JointGroupEmpty(IntPtr group); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAngle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAngle"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetAMotorAngle(IntPtr j, int anum, dReal angle); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetAMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorMode"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorMode"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetAMotorMode(IntPtr j, int mode); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetAMotorNumAxes(IntPtr group, int num); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetAMotorParam(IntPtr group, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetBallAnchor(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor2"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetBallAnchor2(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetData"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetData"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetData(IntPtr j, IntPtr data); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFeedback"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFeedback"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetFeedback(IntPtr j, out JointFeedback feedback); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFixed"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFixed"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetFixed(IntPtr j); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHingeAnchor(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchorDelta"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchorDelta"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHingeAnchorDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHingeAxis(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHingeParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Anchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Anchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHinge2Anchor(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis1"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHinge2Axis1(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis2"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHinge2Axis2(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Param"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Param"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetHinge2Param(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetLMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetLMotorNumAxes(IntPtr j, int num); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetLMotorParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DAngleParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DAngleParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetPlane2DAngleParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DXParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DXParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetPlane2DXParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DYParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DYParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetPlane2DYParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetPRAnchor(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis1"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetPRAxis1(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis2"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetPRAxis2(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetPRParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxis"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetSliderAxis(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxisDelta"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxisDelta"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetSliderAxisDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetSliderParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAnchor"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAnchor"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetUniversalAnchor(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis1"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetUniversalAxis1(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis2"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetUniversalAxis2(IntPtr j, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalParam"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalParam"), SuppressUnmanagedCodeSecurity] internal static extern void JointSetUniversalParam(IntPtr j, int parameter, dReal value); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dLDLTAddTL"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dLDLTAddTL"), SuppressUnmanagedCodeSecurity] internal static extern void LDLTAddTL(ref dReal L, ref dReal d, ref dReal a, int n, int nskip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdd"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdd"), SuppressUnmanagedCodeSecurity] internal static extern void MassAdd(ref Mass a, ref Mass b); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdjust"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdjust"), SuppressUnmanagedCodeSecurity] internal static extern void MassAdjust(ref Mass m, dReal newmass); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassCheck"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassCheck"), SuppressUnmanagedCodeSecurity] internal static extern bool MassCheck(ref Mass m); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] internal static extern void MassRotate(ref Mass mass, ref Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] internal static extern void MassRotate(ref Mass mass, ref dReal M00); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBox"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBox"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetBox(out Mass mass, dReal density, dReal lx, dReal ly, dReal lz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBoxTotal"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBoxTotal"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetBoxTotal(out Mass mass, dReal total_mass, dReal lx, dReal ly, dReal lz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsule"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsule"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetCapsule(out Mass mass, dReal density, int direction, dReal radius, dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsuleTotal"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsuleTotal"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetCapsuleTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinder"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinder"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetCylinder(out Mass mass, dReal density, int direction, dReal radius, dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinderTotal"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinderTotal"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetCylinderTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetParameters"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetParameters"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetParameters(out Mass mass, dReal themass, dReal cgx, dReal cgy, dReal cgz, dReal i11, dReal i22, dReal i33, dReal i12, dReal i13, dReal i23); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphere"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphere"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetSphere(out Mass mass, dReal density, dReal radius); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphereTotal"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphereTotal"), SuppressUnmanagedCodeSecurity] internal static extern void dMassSetSphereTotal(out Mass mass, dReal total_mass, dReal radius); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetTrimesh"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetTrimesh"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetTrimesh(out Mass mass, dReal density, IntPtr g); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetZero"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetZero"), SuppressUnmanagedCodeSecurity] internal static extern void MassSetZero(out Mass mass); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassTranslate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassTranslate"), SuppressUnmanagedCodeSecurity] internal static extern void MassTranslate(ref Mass mass, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] internal static extern void Multiply0(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] private static extern void MultiplyiM3V3(out Vector3 vout, ref Matrix3 matrix, ref Vector3 vect,int p, int q, int r); internal static void MultiplyM3V3(out Vector3 outvector, ref Matrix3 matrix, ref Vector3 invector) { MultiplyiM3V3(out outvector, ref matrix, ref invector, 3, 3, 1); } - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply1"), SuppressUnmanagedCodeSecurity] internal static extern void Multiply1(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply2"), SuppressUnmanagedCodeSecurity] internal static extern void Multiply2(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] internal static extern void QFromAxisAndAngle(out Quaternion q, dReal ax, dReal ay, dReal az, dReal angle); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQfromR"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQfromR"), SuppressUnmanagedCodeSecurity] internal static extern void QfromR(out Quaternion q, ref Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply0"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply0"), SuppressUnmanagedCodeSecurity] internal static extern void QMultiply0(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply1"), SuppressUnmanagedCodeSecurity] internal static extern void QMultiply1(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply2"), SuppressUnmanagedCodeSecurity] internal static extern void QMultiply2(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply3"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply3"), SuppressUnmanagedCodeSecurity] internal static extern void QMultiply3(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQSetIdentity"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQSetIdentity"), SuppressUnmanagedCodeSecurity] internal static extern void QSetIdentity(out Quaternion q); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref Vector3 center, ref Vector3 extents, int depth); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref dReal centerX, ref dReal extentsX, int depth); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRandReal"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRandReal"), SuppressUnmanagedCodeSecurity] internal static extern dReal RandReal(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFrom2Axes"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFrom2Axes"), SuppressUnmanagedCodeSecurity] internal static extern void RFrom2Axes(out Matrix3 R, dReal ax, dReal ay, dReal az, dReal bx, dReal by, dReal bz); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] internal static extern void RFromAxisAndAngle(out Matrix3 R, dReal x, dReal y, dReal z, dReal angle); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromEulerAngles"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromEulerAngles"), SuppressUnmanagedCodeSecurity] internal static extern void RFromEulerAngles(out Matrix3 R, dReal phi, dReal theta, dReal psi); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRfromQ"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRfromQ"), SuppressUnmanagedCodeSecurity] internal static extern void RfromQ(out Matrix3 R, ref Quaternion q); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromZAxis"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromZAxis"), SuppressUnmanagedCodeSecurity] internal static extern void RFromZAxis(out Matrix3 R, dReal ax, dReal ay, dReal az); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRSetIdentity"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRSetIdentity"), SuppressUnmanagedCodeSecurity] internal static extern void RSetIdentity(out Matrix3 R); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetValue"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetValue"), SuppressUnmanagedCodeSecurity] internal static extern void SetValue(out dReal a, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetZero"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetZero"), SuppressUnmanagedCodeSecurity] internal static extern void SetZero(out dReal a, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSimpleSpaceCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSimpleSpaceCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr SimpleSpaceCreate(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveCholesky"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveCholesky"), SuppressUnmanagedCodeSecurity] internal static extern void SolveCholesky(ref dReal L, out dReal b, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1"), SuppressUnmanagedCodeSecurity] internal static extern void SolveL1(ref dReal L, out dReal b, int n, int nskip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1T"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1T"), SuppressUnmanagedCodeSecurity] internal static extern void SolveL1T(ref dReal L, out dReal b, int n, int nskip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveLDLT"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveLDLT"), SuppressUnmanagedCodeSecurity] internal static extern void SolveLDLT(ref dReal L, ref dReal d, out dReal b, int n, int nskip); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceAdd"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceAdd"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceAdd(IntPtr space, IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceLockQuery"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceLockQuery"), SuppressUnmanagedCodeSecurity] internal static extern bool SpaceLockQuery(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceClean"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceClean"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceClean(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceCollide(IntPtr space, IntPtr data, NearCallback callback); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide2"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide2"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceCollide2(IntPtr space1, IntPtr space2, IntPtr data, NearCallback callback); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceDestroy(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetCleanup"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetCleanup"), SuppressUnmanagedCodeSecurity] internal static extern bool SpaceGetCleanup(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetNumGeoms"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetNumGeoms"), SuppressUnmanagedCodeSecurity] internal static extern int SpaceGetNumGeoms(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetGeom"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetGeom"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr SpaceGetGeom(IntPtr space, int i); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetSublevel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetSublevel"), SuppressUnmanagedCodeSecurity] internal static extern int SpaceGetSublevel(IntPtr space); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceQuery"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceQuery"), SuppressUnmanagedCodeSecurity] internal static extern bool SpaceQuery(IntPtr space, IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceRemove"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceRemove"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceRemove(IntPtr space, IntPtr geom); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetCleanup"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetCleanup"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceSetCleanup(IntPtr space, bool mode); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetSublevel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetSublevel"), SuppressUnmanagedCodeSecurity] internal static extern void SpaceSetSublevel(IntPtr space, int sublevel); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSweepAndPruneSpaceCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSweepAndPruneSpaceCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr SweepAndPruneSpaceCreate(IntPtr space, int AxisOrder); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dVectorScale"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dVectorScale"), SuppressUnmanagedCodeSecurity] internal static extern void VectorScale(out dReal a, ref dReal d, int n); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldCreate"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldCreate"), SuppressUnmanagedCodeSecurity] internal static extern IntPtr WorldCreate(); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldDestroy"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldDestroy"), SuppressUnmanagedCodeSecurity] internal static extern void WorldDestroy(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] internal static extern int WorldGetAutoDisableAverageSamplesCount(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetAutoDisableAngularThreshold(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] internal static extern bool WorldGetAutoDisableFlag(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetAutoDisableLinearThreshold(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] internal static extern int WorldGetAutoDisableSteps(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetAutoDisableTime(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] internal static extern int WorldGetAutoEnableDepthSF1(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetCFM"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetCFM"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetCFM(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetERP"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetERP"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetERP(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] internal static extern void WorldGetGravity(IntPtr world, out Vector3 gravity); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] internal static extern void WorldGetGravity(IntPtr world, out dReal X); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetContactMaxCorrectingVel(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetContactSurfaceLayer(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDamping"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetAngularDamping(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetAngularDampingThreshold(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDamping"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetLinearDamping(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetLinearDampingThreshold(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] internal static extern int WorldGetQuickStepNumIterations(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepW"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepW"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetQuickStepW(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] internal static extern dReal WorldGetMaxAngularSpeed(IntPtr world); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] internal static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out Vector3 force); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] internal static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out dReal forceX); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldQuickStep"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldQuickStep"), SuppressUnmanagedCodeSecurity] internal static extern void WorldQuickStep(IntPtr world, dReal stepsize); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDamping"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAngularDamping(IntPtr world, dReal scale); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAngularDampingThreshold(IntPtr world, dReal threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAutoDisableAngularThreshold(IntPtr world, dReal angular_threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAutoDisableAverageSamplesCount(IntPtr world, int average_samples_count); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAutoDisableFlag(IntPtr world, bool do_auto_disable); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAutoDisableLinearThreshold(IntPtr world, dReal linear_threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAutoDisableSteps(IntPtr world, int steps); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableTime"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableTime"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAutoDisableTime(IntPtr world, dReal time); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetAutoEnableDepthSF1(IntPtr world, int autoEnableDepth); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetCFM"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetCFM"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetCFM(IntPtr world, dReal cfm); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetContactMaxCorrectingVel(IntPtr world, dReal vel); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetContactSurfaceLayer(IntPtr world, dReal depth); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetDamping"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetDamping(IntPtr world, dReal linear_scale, dReal angular_scale); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetERP"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetERP"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetERP(IntPtr world, dReal erp); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetGravity"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetGravity"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetGravity(IntPtr world, dReal x, dReal y, dReal z); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDamping"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDamping"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetLinearDamping(IntPtr world, dReal scale); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetLinearDampingThreshold(IntPtr world, dReal threshold); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetQuickStepNumIterations(IntPtr world, int num); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepW"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepW"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetQuickStepW(IntPtr world, dReal over_relaxation); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity] internal static extern void WorldSetMaxAngularSpeed(IntPtr world, dReal max_speed); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStep"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStep"), SuppressUnmanagedCodeSecurity] internal static extern void WorldStep(IntPtr world, dReal stepsize); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStepFast1"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStepFast1"), SuppressUnmanagedCodeSecurity] internal static extern void WorldStepFast1(IntPtr world, dReal stepsize, int maxiterations); - [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldExportDIF"), SuppressUnmanagedCodeSecurity] + [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldExportDIF"), SuppressUnmanagedCodeSecurity] internal static extern void WorldExportDIF(IntPtr world, string filename, bool append, string prefix); } } diff --git a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs index 639d3fd17a..21c7702a31 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.PhysicsModule.ODE private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Vector3 _position; - private SafeNativeMethods.Vector3 _zeroPosition; + private OdeNative.Vector3 _zeroPosition; private bool _zeroFlag = false; private bool m_lastUpdateSent = false; private Vector3 _velocity; @@ -151,7 +151,7 @@ namespace OpenSim.Region.PhysicsModule.ODE internal IntPtr Shell { get; private set; } private IntPtr Amotor = IntPtr.Zero; - private SafeNativeMethods.Mass ShellMass; + private OdeNative.Mass ShellMass; private int m_eventsubscription = 0; private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); @@ -564,12 +564,12 @@ namespace OpenSim.Region.PhysicsModule.ODE float yTiltComponent = -movementVector.Y * m_tiltMagnitudeWhenProjectedOnXYPlane; //m_log.Debug("[ODE CHARACTER]: changing avatar tilt"); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LowStop, xTiltComponent); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop, xTiltComponent); // must be same as lowstop, else a different, spurious tilt is introduced - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, yTiltComponent); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, yTiltComponent); // same as lowstop - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LowStop, xTiltComponent); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop, xTiltComponent); // must be same as lowstop, else a different, spurious tilt is introduced + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, yTiltComponent); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, yTiltComponent); // same as lowstop + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, 0f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop } /// @@ -807,11 +807,11 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_pidControllerActive == false) { - _zeroPosition = SafeNativeMethods.BodyGetPosition(Body); + _zeroPosition = OdeNative.BodyGetPosition(Body); } //PidStatus = true; - SafeNativeMethods.Vector3 localpos = SafeNativeMethods.BodyGetPosition(Body); + OdeNative.Vector3 localpos = OdeNative.BodyGetPosition(Body); Vector3 localPos = new Vector3(localpos.X, localpos.Y, localpos.Z); if (!localPos.IsFinite()) @@ -826,7 +826,7 @@ namespace OpenSim.Region.PhysicsModule.ODE } Vector3 vec = Vector3.Zero; - SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); + OdeNative.Vector3 vel = OdeNative.BodyGetLinearVel(Body); // m_log.DebugFormat( // "[ODE CHARACTER]: Current velocity in Move() is <{0},{1},{2}>, target {3} for {4}", @@ -850,7 +850,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (!_zeroFlag) { _zeroFlag = true; - _zeroPosition = SafeNativeMethods.BodyGetPosition(Body); + _zeroPosition = OdeNative.BodyGetPosition(Body); } if (m_pidControllerActive) @@ -860,7 +860,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // Avatar to Avatar collisions // Prim to avatar collisions - SafeNativeMethods.Vector3 pos = SafeNativeMethods.BodyGetPosition(Body); + OdeNative.Vector3 pos = OdeNative.BodyGetPosition(Body); vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); vec.Y = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y)* (PID_P * 2); if (flying) @@ -908,7 +908,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { // We're colliding with something and we're not flying but we're moving // This means we're walking or running. - SafeNativeMethods.Vector3 pos = SafeNativeMethods.BodyGetPosition(Body); + OdeNative.Vector3 pos = OdeNative.BodyGetPosition(Body); vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P; vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D; vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D; @@ -942,7 +942,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (vec.IsFinite()) { // Apply the total force acting on this avatar - SafeNativeMethods.BodyAddForce(Body, vec.X, vec.Y, vec.Z); + OdeNative.BodyAddForce(Body, vec.X, vec.Y, vec.Z); if (!_zeroFlag) AlignAvatarTiltWithCurrentDirectionOfMovement(vec); @@ -958,7 +958,7 @@ namespace OpenSim.Region.PhysicsModule.ODE return; } - SafeNativeMethods.Vector3 newVel = SafeNativeMethods.BodyGetLinearVel(Body); + OdeNative.Vector3 newVel = OdeNative.BodyGetLinearVel(Body); if (newVel.X >= 256 || newVel.X <= 256 || newVel.Y >= 256 || newVel.Y <= 256 || newVel.Z >= 256 || newVel.Z <= 256) { // m_log.DebugFormat( @@ -974,7 +974,7 @@ namespace OpenSim.Region.PhysicsModule.ODE else newVel.Z = Util.Clamp(newVel.Z, -255f, 255f); - SafeNativeMethods.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); + OdeNative.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); } } @@ -987,16 +987,16 @@ namespace OpenSim.Region.PhysicsModule.ODE internal void UpdatePositionAndVelocity(List defects) { // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! - SafeNativeMethods.Vector3 newPos; + OdeNative.Vector3 newPos; try { - newPos = SafeNativeMethods.BodyGetPosition(Body); + newPos = OdeNative.BodyGetPosition(Body); } catch (NullReferenceException) { bad = true; defects.Add(this); - newPos = new SafeNativeMethods.Vector3(_position.X, _position.Y, _position.Z); + newPos = new OdeNative.Vector3(_position.X, _position.Y, _position.Z); base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! m_log.WarnFormat("[ODE CHARACTER]: Avatar Null reference for Avatar {0}, physical actor {1}", Name, m_uuid); @@ -1033,11 +1033,11 @@ namespace OpenSim.Region.PhysicsModule.ODE else { m_lastUpdateSent = false; - SafeNativeMethods.Vector3 newVelocity; + OdeNative.Vector3 newVelocity; try { - newVelocity = SafeNativeMethods.BodyGetLinearVel(Body); + newVelocity = OdeNative.BodyGetLinearVel(Body); } catch (NullReferenceException) { @@ -1104,14 +1104,14 @@ namespace OpenSim.Region.PhysicsModule.ODE } // lock (OdeScene.UniversalColliderSyncObject) - Shell = SafeNativeMethods.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); + Shell = OdeNative.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); - SafeNativeMethods.GeomSetCategoryBits(Shell, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(Shell, (uint)m_collisionFlags); + OdeNative.GeomSetCategoryBits(Shell, (uint)m_collisionCategories); + OdeNative.GeomSetCollideBits(Shell, (uint)m_collisionFlags); - SafeNativeMethods.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH); - Body = SafeNativeMethods.BodyCreate(_parent_scene.world); - SafeNativeMethods.BodySetPosition(Body, npositionX, npositionY, npositionZ); + OdeNative.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH); + Body = OdeNative.BodyCreate(_parent_scene.world); + OdeNative.BodySetPosition(Body, npositionX, npositionY, npositionZ); _position.X = npositionX; _position.Y = npositionY; @@ -1119,45 +1119,45 @@ namespace OpenSim.Region.PhysicsModule.ODE m_taintPosition = _position; - SafeNativeMethods.BodySetMass(Body, ref ShellMass); - SafeNativeMethods.Matrix3 m_caprot; + OdeNative.BodySetMass(Body, ref ShellMass); + OdeNative.Matrix3 m_caprot; // 90 Stand up on the cap of the capped cyllinder if (_parent_scene.IsAvCapsuleTilted) { - SafeNativeMethods.RFromAxisAndAngle(out m_caprot, 1, 0, 1, (float)(Math.PI / 2)); + OdeNative.RFromAxisAndAngle(out m_caprot, 1, 0, 1, (float)(Math.PI / 2)); } else { - SafeNativeMethods.RFromAxisAndAngle(out m_caprot, 0, 0, 1, (float)(Math.PI / 2)); + OdeNative.RFromAxisAndAngle(out m_caprot, 0, 0, 1, (float)(Math.PI / 2)); } - SafeNativeMethods.GeomSetRotation(Shell, ref m_caprot); - SafeNativeMethods.BodySetRotation(Body, ref m_caprot); + OdeNative.GeomSetRotation(Shell, ref m_caprot); + OdeNative.BodySetRotation(Body, ref m_caprot); - SafeNativeMethods.GeomSetBody(Shell, Body); + OdeNative.GeomSetBody(Shell, Body); // The purpose of the AMotor here is to keep the avatar's physical // surrogate from rotating while moving - Amotor = SafeNativeMethods.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); - SafeNativeMethods.JointAttach(Amotor, Body, IntPtr.Zero); - SafeNativeMethods.JointSetAMotorMode(Amotor, dAMotorEuler); - SafeNativeMethods.JointSetAMotorNumAxes(Amotor, 3); - SafeNativeMethods.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); - SafeNativeMethods.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); - SafeNativeMethods.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 0, 0); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 1, 0); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 2, 0); + Amotor = OdeNative.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); + OdeNative.JointAttach(Amotor, Body, IntPtr.Zero); + OdeNative.JointSetAMotorMode(Amotor, dAMotorEuler); + OdeNative.JointSetAMotorNumAxes(Amotor, 3); + OdeNative.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); + OdeNative.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); + OdeNative.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); + OdeNative.JointSetAMotorAngle(Amotor, 0, 0); + OdeNative.JointSetAMotorAngle(Amotor, 1, 0); + OdeNative.JointSetAMotorAngle(Amotor, 2, 0); // These lowstops and high stops are effectively (no wiggle room) if (_parent_scene.IsAvCapsuleTilted) { - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -0.000000000001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -0.000000000001f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); } else { @@ -1169,18 +1169,18 @@ namespace OpenSim.Region.PhysicsModule.ODE // to be comprehended in their entirety. #endregion AlignAvatarTiltWithCurrentDirectionOfMovement(Vector3.Zero); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LowStop, 0.08f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, 0.08f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.08f); // must be same as lowstop, else a different, spurious tilt is introduced - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.08f); // same as lowstop + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LowStop, 0.08f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, 0.08f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.08f); // must be same as lowstop, else a different, spurious tilt is introduced + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.08f); // same as lowstop } // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the // capped cyllinder will fall over - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); + OdeNative.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor); //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); //d.QfromR( @@ -1219,7 +1219,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (Amotor != IntPtr.Zero) { // Kill the Amotor - SafeNativeMethods.JointDestroy(Amotor); + OdeNative.JointDestroy(Amotor); Amotor = IntPtr.Zero; } @@ -1229,14 +1229,14 @@ namespace OpenSim.Region.PhysicsModule.ODE if (Body != IntPtr.Zero) { //kill the body - SafeNativeMethods.BodyDestroy(Body); + OdeNative.BodyDestroy(Body); Body = IntPtr.Zero; } if (Shell != IntPtr.Zero) { // lock (OdeScene.UniversalColliderSyncObject) - SafeNativeMethods.GeomDestroy(Shell); + OdeNative.GeomDestroy(Shell); _parent_scene.geom_name_map.Remove(Shell); _parent_scene.actor_name_map.Remove(Shell); @@ -1327,7 +1327,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetPosition(Body, m_taintPosition.X, m_taintPosition.Y, m_taintPosition.Z); + OdeNative.BodySetPosition(Body, m_taintPosition.X, m_taintPosition.Y, m_taintPosition.Z); _position = m_taintPosition; } } @@ -1339,7 +1339,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // FIXME: This is not a good solution since it's subject to a race condition if a force is another // thread sets a new force while we're in this loop (since it could be obliterated by // m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force. - SafeNativeMethods.BodyAddForce(Body, m_taintForce.X, m_taintForce.Y, m_taintForce.Z); + OdeNative.BodyAddForce(Body, m_taintForce.X, m_taintForce.Y, m_taintForce.Z); } m_taintForce = Vector3.Zero; diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs index 39aea59673..d01b59b335 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs @@ -93,7 +93,7 @@ namespace OpenSim.Region.PhysicsModule.ODE private float m_linearMotorDecayTimescale = 0; private float m_linearMotorTimescale = 0; private Vector3 m_lastLinearVelocityVector = Vector3.Zero; - private SafeNativeMethods.Vector3 m_lastPositionVector = new SafeNativeMethods.Vector3(); + private OdeNative.Vector3 m_lastPositionVector = new OdeNative.Vector3(); // private bool m_LinearMotorSetLastFrame = false; // private Vector3 m_linearMotorOffset = Vector3.Zero; @@ -611,7 +611,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { m_lastLinearVelocityVector = Vector3.Zero; m_lastAngularVelocity = Vector3.Zero; - m_lastPositionVector = SafeNativeMethods.BodyGetPosition(Body); + m_lastPositionVector = OdeNative.BodyGetPosition(Body); } internal void Step(float pTimestep, OdeScene pParentScene) @@ -631,8 +631,8 @@ namespace OpenSim.Region.PhysicsModule.ODE { if (!m_linearMotorDirection.ApproxEquals(Vector3.Zero, 0.01f)) // requested m_linearMotorDirection is significant { - if (!SafeNativeMethods.BodyIsEnabled(Body)) - SafeNativeMethods.BodyEnable(Body); + if (!OdeNative.BodyIsEnabled(Body)) + OdeNative.BodyEnable(Body); // add drive to body Vector3 addAmount = m_linearMotorDirection/(m_linearMotorTimescale/pTimestep); @@ -662,7 +662,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // convert requested object velocity to world-referenced vector m_dir = m_lastLinearVelocityVector; - SafeNativeMethods.Quaternion rot = SafeNativeMethods.BodyGetQuaternion(Body); + OdeNative.Quaternion rot = OdeNative.BodyGetQuaternion(Body); Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object m_dir *= rotq; // apply obj rotation to velocity vector @@ -673,15 +673,15 @@ namespace OpenSim.Region.PhysicsModule.ODE Vector3 grav = Vector3.Zero; // There is some gravity, make a gravity force vector // that is applied after object velocity. - SafeNativeMethods.Mass objMass; - SafeNativeMethods.BodyGetMass(Body, out objMass); + OdeNative.Mass objMass; + OdeNative.BodyGetMass(Body, out objMass); // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy); // Preserve the current Z velocity - SafeNativeMethods.Vector3 vel_now = SafeNativeMethods.BodyGetLinearVel(Body); + OdeNative.Vector3 vel_now = OdeNative.BodyGetLinearVel(Body); m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity - SafeNativeMethods.Vector3 pos = SafeNativeMethods.BodyGetPosition(Body); + OdeNative.Vector3 pos = OdeNative.BodyGetPosition(Body); // Vector3 accel = new Vector3(-(m_dir.X - m_lastLinearVelocityVector.X / 0.1f), -(m_dir.Y - m_lastLinearVelocityVector.Y / 0.1f), m_dir.Z - m_lastLinearVelocityVector.Z / 0.1f); Vector3 posChange = new Vector3(); posChange.X = pos.X - m_lastPositionVector.X; @@ -693,33 +693,33 @@ namespace OpenSim.Region.PhysicsModule.ODE if (pos.X >= (m_BlockingEndPoint.X - (float)1)) { pos.X -= posChange.X + 1; - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, pos.Z); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, pos.Z); } if (pos.Y >= (m_BlockingEndPoint.Y - (float)1)) { pos.Y -= posChange.Y + 1; - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, pos.Z); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, pos.Z); } if (pos.Z >= (m_BlockingEndPoint.Z - (float)1)) { pos.Z -= posChange.Z + 1; - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, pos.Z); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, pos.Z); } if (pos.X <= 0) { pos.X += posChange.X + 1; - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, pos.Z); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, pos.Z); } if (pos.Y <= 0) { pos.Y += posChange.Y + 1; - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, pos.Z); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, pos.Z); } } if (pos.Z < _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y)) { pos.Z = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + 2; - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, pos.Z); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, pos.Z); } // Check if hovering @@ -748,7 +748,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { if ((pos.Z - m_VhoverTargetHeight) > .2 || (pos.Z - m_VhoverTargetHeight) < -.2) { - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, m_VhoverTargetHeight); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, m_VhoverTargetHeight); } } else @@ -815,12 +815,12 @@ namespace OpenSim.Region.PhysicsModule.ODE m_dir.Z = 0; } - m_lastPositionVector = SafeNativeMethods.BodyGetPosition(Body); + m_lastPositionVector = OdeNative.BodyGetPosition(Body); // Apply velocity - SafeNativeMethods.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z); + OdeNative.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z); // apply gravity force - SafeNativeMethods.BodyAddForce(Body, grav.X, grav.Y, grav.Z); + OdeNative.BodyAddForce(Body, grav.X, grav.Y, grav.Z); // apply friction @@ -841,7 +841,7 @@ namespace OpenSim.Region.PhysicsModule.ODE */ // Get what the body is doing, this includes 'external' influences - SafeNativeMethods.Vector3 angularVelocity = SafeNativeMethods.BodyGetAngularVel(Body); + OdeNative.Vector3 angularVelocity = OdeNative.BodyGetAngularVel(Body); // Vector3 angularVelocity = Vector3.Zero; if (m_angularMotorApply > 0) @@ -874,7 +874,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { float VAservo = 0.2f / (m_verticalAttractionTimescale * pTimestep); // get present body rotation - SafeNativeMethods.Quaternion rot = SafeNativeMethods.BodyGetQuaternion(Body); + OdeNative.Quaternion rot = OdeNative.BodyGetQuaternion(Body); Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // make a vector pointing up Vector3 verterr = Vector3.Zero; @@ -923,7 +923,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f)) { - if (!SafeNativeMethods.BodyIsEnabled (Body)) SafeNativeMethods.BodyEnable (Body); + if (!OdeNative.BodyIsEnabled (Body)) OdeNative.BodyEnable (Body); } else { @@ -935,14 +935,14 @@ namespace OpenSim.Region.PhysicsModule.ODE m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; // Apply to the body - SafeNativeMethods.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z); + OdeNative.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z); } //end MoveAngular internal void LimitRotation(float timestep) { - SafeNativeMethods.Quaternion rot = SafeNativeMethods.BodyGetQuaternion(Body); + OdeNative.Quaternion rot = OdeNative.BodyGetQuaternion(Body); Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object - SafeNativeMethods.Quaternion m_rot = new SafeNativeMethods.Quaternion(); + OdeNative.Quaternion m_rot = new OdeNative.Quaternion(); bool changed = false; m_rot.X = rotq.X; m_rot.Y = rotq.Y; @@ -975,7 +975,7 @@ namespace OpenSim.Region.PhysicsModule.ODE changed = true; } if (changed) - SafeNativeMethods.BodySetQuaternion(Body, ref m_rot); + OdeNative.BodySetQuaternion(Body, ref m_rot); } } } diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs b/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs index d6aeb63cbc..adc1a63973 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs @@ -66,11 +66,11 @@ namespace OpenSim.Region.PhysicsModule.ODE return; if (Util.IsWindows()) - Util.LoadArchSpecificWindowsDll("ode.dll"); + Util.LoadArchSpecificWindowsDll("ubode.dll"); // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to // http://opensimulator.org/mantis/view.php?id=2750). - SafeNativeMethods.InitODE(); + OdeNative.InitODE(); m_scene = new OdeScene(scene, m_config, Name, Version); } diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs index 16b2551174..95cda3b3c4 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs @@ -212,7 +212,7 @@ namespace OpenSim.Region.PhysicsModule.ODE public IntPtr Body = IntPtr.Zero; private Vector3 _target_velocity; - private SafeNativeMethods.Mass pMass; + private OdeNative.Mass pMass; private int m_eventsubscription; private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); @@ -356,13 +356,13 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); + OdeNative.GeomSetCategoryBits(prim_geom, 0); + OdeNative.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); } else { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); } _parent_scene.geom_name_map[prim_geom] = Name; @@ -386,7 +386,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { if (IsPhysical && Body != IntPtr.Zero) { - SafeNativeMethods.BodyEnable(Body); + OdeNative.BodyEnable(Body); if (m_vehicle.Type != Vehicle.TYPE_NONE) m_vehicle.Enable(Body, _parent_scene); } @@ -401,7 +401,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (IsPhysical && Body != IntPtr.Zero) { - SafeNativeMethods.BodyDisable(Body); + OdeNative.BodyDisable(Body); } } @@ -415,22 +415,22 @@ namespace OpenSim.Region.PhysicsModule.ODE if (!childPrim) { // Sets the geom to a body - Body = SafeNativeMethods.BodyCreate(_parent_scene.world); + Body = OdeNative.BodyCreate(_parent_scene.world); setMass(); - SafeNativeMethods.BodySetPosition(Body, _position.X, _position.Y, _position.Z); - SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); + OdeNative.BodySetPosition(Body, _position.X, _position.Y, _position.Z); + OdeNative.Quaternion myrot = new OdeNative.Quaternion(); myrot.X = _orientation.X; myrot.Y = _orientation.Y; myrot.Z = _orientation.Z; myrot.W = _orientation.W; - SafeNativeMethods.BodySetQuaternion(Body, ref myrot); - SafeNativeMethods.GeomSetBody(prim_geom, Body); + OdeNative.BodySetQuaternion(Body, ref myrot); + OdeNative.GeomSetBody(prim_geom, Body); if (m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); + OdeNative.GeomSetCategoryBits(prim_geom, 0); + OdeNative.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); } else { @@ -438,14 +438,14 @@ namespace OpenSim.Region.PhysicsModule.ODE m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); } - SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); - SafeNativeMethods.BodySetAutoDisableFlag(Body, true); - SafeNativeMethods.BodySetAutoDisableSteps(Body, body_autodisable_frames); + OdeNative.BodySetAutoDisableFlag(Body, true); + OdeNative.BodySetAutoDisableSteps(Body, body_autodisable_frames); // disconnect from world gravity so we can apply buoyancy - SafeNativeMethods.BodySetGravityMode (Body, false); + OdeNative.BodySetGravityMode (Body, false); m_interpenetrationcount = 0; m_collisionscore = 0; @@ -787,8 +787,8 @@ namespace OpenSim.Region.PhysicsModule.ODE //m_log.Info("[PHYSICS]: New Mass: " + newmass.ToString()); - SafeNativeMethods.MassSetBoxTotal(out pMass, newmass, _size.X, _size.Y, _size.Z); - SafeNativeMethods.BodySetMass(Body, ref pMass); + OdeNative.MassSetBoxTotal(out pMass, newmass, _size.X, _size.Y, _size.Z); + OdeNative.BodySetMass(Body, ref pMass); } } @@ -796,7 +796,7 @@ namespace OpenSim.Region.PhysicsModule.ODE { if (Body != (IntPtr)0) { - SafeNativeMethods.BodySetAngularVel(Body, x, y, z); + OdeNative.BodySetAngularVel(Body, x, y, z); } } @@ -818,16 +818,16 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prim_geom, 0); + OdeNative.GeomSetCategoryBits(prim_geom, 0); + OdeNative.GeomSetCollideBits(prim_geom, 0); } else { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); } - SafeNativeMethods.BodyDestroy(Body); + OdeNative.BodyDestroy(Body); lock (childrenPrim) { if (childrenPrim.Count > 0) @@ -851,14 +851,14 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prim_geom, 0); + OdeNative.GeomSetCategoryBits(prim_geom, 0); + OdeNative.GeomSetCollideBits(prim_geom, 0); } else { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); } Body = IntPtr.Zero; @@ -915,10 +915,10 @@ namespace OpenSim.Region.PhysicsModule.ODE } else { - _triMeshData = SafeNativeMethods.GeomTriMeshDataCreate(); + _triMeshData = OdeNative.GeomTriMeshDataCreate(); - SafeNativeMethods.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); - SafeNativeMethods.GeomTriMeshDataPreprocess(_triMeshData); + OdeNative.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); + OdeNative.GeomTriMeshDataPreprocess(_triMeshData); m_MeshToTriMeshMap[mesh] = _triMeshData; } } @@ -926,7 +926,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // _parent_scene.waitForSpaceUnlock(m_targetSpace); try { - SetGeom(SafeNativeMethods.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null)); + SetGeom(OdeNative.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null)); } catch (AccessViolationException) { @@ -1032,7 +1032,7 @@ Console.WriteLine("ZProcessTaints for " + Name); { if (Amotor != IntPtr.Zero) { - SafeNativeMethods.JointDestroy(Amotor); + OdeNative.JointDestroy(Amotor); Amotor = IntPtr.Zero; } } @@ -1107,7 +1107,7 @@ Console.WriteLine("ZProcessTaints for " + Name); if (Body == IntPtr.Zero) { - Body = SafeNativeMethods.BodyCreate(_parent_scene.world); + Body = OdeNative.BodyCreate(_parent_scene.world); setMass(); } @@ -1123,21 +1123,21 @@ Console.WriteLine("ZProcessTaints for " + Name); foreach (OdePrim prm in childrenPrim) { - SafeNativeMethods.Mass m2; - SafeNativeMethods.MassSetZero(out m2); - SafeNativeMethods.MassSetBoxTotal(out m2, prm.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z); + OdeNative.Mass m2; + OdeNative.MassSetZero(out m2); + OdeNative.MassSetBoxTotal(out m2, prm.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z); - SafeNativeMethods.Quaternion quat = new SafeNativeMethods.Quaternion(); + OdeNative.Quaternion quat = new OdeNative.Quaternion(); quat.W = prm._orientation.W; quat.X = prm._orientation.X; quat.Y = prm._orientation.Y; quat.Z = prm._orientation.Z; - SafeNativeMethods.Matrix3 mat = new SafeNativeMethods.Matrix3(); - SafeNativeMethods.RfromQ(out mat, ref quat); - SafeNativeMethods.MassRotate(ref m2, ref mat); - SafeNativeMethods.MassTranslate(ref m2, Position.X - prm.Position.X, Position.Y - prm.Position.Y, Position.Z - prm.Position.Z); - SafeNativeMethods.MassAdd(ref pMass, ref m2); + OdeNative.Matrix3 mat = new OdeNative.Matrix3(); + OdeNative.RfromQ(out mat, ref quat); + OdeNative.MassRotate(ref m2, ref mat); + OdeNative.MassTranslate(ref m2, Position.X - prm.Position.X, Position.Y - prm.Position.Y, Position.Z - prm.Position.Z); + OdeNative.MassAdd(ref pMass, ref m2); } foreach (OdePrim prm in childrenPrim) @@ -1148,36 +1148,36 @@ Console.WriteLine("ZProcessTaints for " + Name); //Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name); if (prm.m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, (uint)prm.BadMeshAssetCollideBits); + OdeNative.GeomSetCategoryBits(prm.prim_geom, 0); + OdeNative.GeomSetCollideBits(prm.prim_geom, (uint)prm.BadMeshAssetCollideBits); } else { - SafeNativeMethods.GeomSetCategoryBits(prm.prim_geom, (uint)prm.m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prm.prim_geom, (uint)prm.m_collisionFlags); + OdeNative.GeomSetCategoryBits(prm.prim_geom, (uint)prm.m_collisionCategories); + OdeNative.GeomSetCollideBits(prm.prim_geom, (uint)prm.m_collisionFlags); } - SafeNativeMethods.Quaternion quat = new SafeNativeMethods.Quaternion(); + OdeNative.Quaternion quat = new OdeNative.Quaternion(); quat.W = prm._orientation.W; quat.X = prm._orientation.X; quat.Y = prm._orientation.Y; quat.Z = prm._orientation.Z; - SafeNativeMethods.Matrix3 mat = new SafeNativeMethods.Matrix3(); - SafeNativeMethods.RfromQ(out mat, ref quat); + OdeNative.Matrix3 mat = new OdeNative.Matrix3(); + OdeNative.RfromQ(out mat, ref quat); if (Body != IntPtr.Zero) { - SafeNativeMethods.GeomSetBody(prm.prim_geom, Body); + OdeNative.GeomSetBody(prm.prim_geom, Body); prm.childPrim = true; - SafeNativeMethods.GeomSetOffsetWorldPosition(prm.prim_geom, prm.Position.X , prm.Position.Y, prm.Position.Z); + OdeNative.GeomSetOffsetWorldPosition(prm.prim_geom, prm.Position.X , prm.Position.Y, prm.Position.Z); //d.GeomSetOffsetPosition(prim.prim_geom, // (Position.X - prm.Position.X) - pMass.c.X, // (Position.Y - prm.Position.Y) - pMass.c.Y, // (Position.Z - prm.Position.Z) - pMass.c.Z); - SafeNativeMethods.GeomSetOffsetWorldRotation(prm.prim_geom, ref mat); + OdeNative.GeomSetOffsetWorldRotation(prm.prim_geom, ref mat); //d.GeomSetOffsetRotation(prm.prim_geom, ref mat); - SafeNativeMethods.MassTranslate(ref pMass, -pMass.c.X, -pMass.c.Y, -pMass.c.Z); - SafeNativeMethods.BodySetMass(Body, ref pMass); + OdeNative.MassTranslate(ref pMass, -pMass.c.X, -pMass.c.Y, -pMass.c.Z); + OdeNative.BodySetMass(Body, ref pMass); } else { @@ -1197,37 +1197,37 @@ Console.WriteLine("ZProcessTaints for " + Name); if (m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); + OdeNative.GeomSetCategoryBits(prim_geom, 0); + OdeNative.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); } else { //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name); - SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); + OdeNative.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); //Console.WriteLine(" Post GeomSetCategoryBits 2"); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); } - SafeNativeMethods.Quaternion quat2 = new SafeNativeMethods.Quaternion(); + OdeNative.Quaternion quat2 = new OdeNative.Quaternion(); quat2.W = _orientation.W; quat2.X = _orientation.X; quat2.Y = _orientation.Y; quat2.Z = _orientation.Z; - SafeNativeMethods.Matrix3 mat2 = new SafeNativeMethods.Matrix3(); - SafeNativeMethods.RfromQ(out mat2, ref quat2); - SafeNativeMethods.GeomSetBody(prim_geom, Body); - SafeNativeMethods.GeomSetOffsetWorldPosition(prim_geom, Position.X - pMass.c.X, Position.Y - pMass.c.Y, Position.Z - pMass.c.Z); + OdeNative.Matrix3 mat2 = new OdeNative.Matrix3(); + OdeNative.RfromQ(out mat2, ref quat2); + OdeNative.GeomSetBody(prim_geom, Body); + OdeNative.GeomSetOffsetWorldPosition(prim_geom, Position.X - pMass.c.X, Position.Y - pMass.c.Y, Position.Z - pMass.c.Z); //d.GeomSetOffsetPosition(prim.prim_geom, // (Position.X - prm.Position.X) - pMass.c.X, // (Position.Y - prm.Position.Y) - pMass.c.Y, // (Position.Z - prm.Position.Z) - pMass.c.Z); //d.GeomSetOffsetRotation(prim_geom, ref mat2); - SafeNativeMethods.MassTranslate(ref pMass, -pMass.c.X, -pMass.c.Y, -pMass.c.Z); - SafeNativeMethods.BodySetMass(Body, ref pMass); + OdeNative.MassTranslate(ref pMass, -pMass.c.X, -pMass.c.Y, -pMass.c.Z); + OdeNative.BodySetMass(Body, ref pMass); - SafeNativeMethods.BodySetAutoDisableFlag(Body, true); - SafeNativeMethods.BodySetAutoDisableSteps(Body, body_autodisable_frames); + OdeNative.BodySetAutoDisableFlag(Body, true); + OdeNative.BodySetAutoDisableSteps(Body, body_autodisable_frames); m_interpenetrationcount = 0; m_collisionscore = 0; @@ -1240,7 +1240,7 @@ Console.WriteLine("ZProcessTaints for " + Name); createAMotor(m_angularlock); } - SafeNativeMethods.BodySetPosition(Body, Position.X, Position.Y, Position.Z); + OdeNative.BodySetPosition(Body, Position.X, Position.Y, Position.Z); if (m_vehicle.Type != Vehicle.TYPE_NONE) m_vehicle.Enable(Body, _parent_scene); @@ -1370,13 +1370,13 @@ Console.WriteLine("ZProcessTaints for " + Name); if (m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prim_geom, 0); + OdeNative.GeomSetCategoryBits(prim_geom, 0); + OdeNative.GeomSetCollideBits(prim_geom, 0); } else { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); } if (IsPhysical) @@ -1400,21 +1400,21 @@ Console.WriteLine("ZProcessTaints for " + Name); if (m_assetFailed) { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); + OdeNative.GeomSetCategoryBits(prim_geom, 0); + OdeNative.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); } else { - SafeNativeMethods.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); } if (IsPhysical) { if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetLinearVel(Body, 0f, 0f, 0f); - SafeNativeMethods.BodySetForce(Body, 0, 0, 0); + OdeNative.BodySetLinearVel(Body, 0f, 0f, 0f); + OdeNative.BodySetForce(Body, 0, 0, 0); enableBodySoft(); } } @@ -1463,7 +1463,7 @@ Console.WriteLine("CreateGeom:"); try { //Console.WriteLine(" CreateGeom 1"); - SetGeom(SafeNativeMethods.CreateSphere(m_targetSpace, _size.X / 2)); + SetGeom(OdeNative.CreateSphere(m_targetSpace, _size.X / 2)); m_expectedCollisionContacts = 3; } catch (AccessViolationException) @@ -1478,7 +1478,7 @@ Console.WriteLine("CreateGeom:"); try { //Console.WriteLine(" CreateGeom 2"); - SetGeom(SafeNativeMethods.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); + SetGeom(OdeNative.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); m_expectedCollisionContacts = 4; } catch (AccessViolationException) @@ -1494,7 +1494,7 @@ Console.WriteLine("CreateGeom:"); try { //Console.WriteLine(" CreateGeom 3"); - SetGeom(SafeNativeMethods.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); + SetGeom(OdeNative.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); m_expectedCollisionContacts = 4; } catch (AccessViolationException) @@ -1510,7 +1510,7 @@ Console.WriteLine("CreateGeom:"); try { //Console.WriteLine(" CreateGeom 4"); - SetGeom(SafeNativeMethods.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); + SetGeom(OdeNative.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); m_expectedCollisionContacts = 4; } catch (AccessViolationException) @@ -1536,7 +1536,7 @@ Console.WriteLine("CreateGeom:"); { _parent_scene.geom_name_map.Remove(prim_geom); _parent_scene.actor_name_map.Remove(prim_geom); - SafeNativeMethods.GeomDestroy(prim_geom); + OdeNative.GeomDestroy(prim_geom); m_expectedCollisionContacts = 0; prim_geom = IntPtr.Zero; } @@ -1593,13 +1593,13 @@ Console.WriteLine("changeadd 1"); #endif CreateGeom(m_targetSpace, mesh); - SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); - SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); + OdeNative.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); + OdeNative.Quaternion myrot = new OdeNative.Quaternion(); myrot.X = _orientation.X; myrot.Y = _orientation.Y; myrot.Z = _orientation.Z; myrot.W = _orientation.W; - SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); + OdeNative.GeomSetQuaternion(prim_geom, ref myrot); if (IsPhysical && Body == IntPtr.Zero) enableBody(); @@ -1627,14 +1627,14 @@ Console.WriteLine("changeadd 1"); { if (m_linkJoint != IntPtr.Zero) { - SafeNativeMethods.JointDestroy(m_linkJoint); + OdeNative.JointDestroy(m_linkJoint); m_linkJoint = IntPtr.Zero; } } if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetPosition(Body, _position.X, _position.Y, _position.Z); + OdeNative.BodySetPosition(Body, _position.X, _position.Y, _position.Z); if (_parent != null) { @@ -1643,12 +1643,12 @@ Console.WriteLine("changeadd 1"); { // KF: Fixed Joints were removed? Anyway - this Console.WriteLine does not show up, so routine is not used?? Console.WriteLine(" JointCreateFixed"); - m_linkJoint = SafeNativeMethods.JointCreateFixed(_parent_scene.world, _linkJointGroup); - SafeNativeMethods.JointAttach(m_linkJoint, Body, odParent.Body); - SafeNativeMethods.JointSetFixed(m_linkJoint); + m_linkJoint = OdeNative.JointCreateFixed(_parent_scene.world, _linkJointGroup); + OdeNative.JointAttach(m_linkJoint, Body, odParent.Body); + OdeNative.JointSetFixed(m_linkJoint); } } - SafeNativeMethods.BodyEnable(Body); + OdeNative.BodyEnable(Body); if (m_vehicle.Type != Vehicle.TYPE_NONE) { m_vehicle.Enable(Body, _parent_scene); @@ -1674,10 +1674,10 @@ Console.WriteLine(" JointCreateFixed"); // _parent_scene.waitForSpaceUnlock(m_targetSpace); - SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); + OdeNative.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); // _parent_scene.waitForSpaceUnlock(m_targetSpace); - SafeNativeMethods.SpaceAdd(m_targetSpace, prim_geom); + OdeNative.SpaceAdd(m_targetSpace, prim_geom); changeSelectedStatus(); @@ -1704,7 +1704,7 @@ Console.WriteLine(" JointCreateFixed"); else { //Console.WriteLine("Move " + Name); - if (!SafeNativeMethods.BodyIsEnabled (Body)) SafeNativeMethods.BodyEnable (Body); // KF add 161009 + if (!OdeNative.BodyIsEnabled (Body)) OdeNative.BodyEnable (Body); // KF add 161009 float m_mass = CalculateMass(); @@ -1746,9 +1746,9 @@ Console.WriteLine(" JointCreateFixed"); //PidStatus = true; // PhysicsVector vec = new PhysicsVector(); - SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); + OdeNative.Vector3 vel = OdeNative.BodyGetLinearVel(Body); - SafeNativeMethods.Vector3 pos = SafeNativeMethods.BodyGetPosition(Body); + OdeNative.Vector3 pos = OdeNative.BodyGetPosition(Body); _target_velocity = new Vector3( (m_PIDTarget.X - pos.X) * ((PID_G - m_PIDTau) * timestep), @@ -1770,9 +1770,9 @@ Console.WriteLine(" JointCreateFixed"); //fx = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); //fy = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y) * (PID_P * 2); //fz = fz + (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; - SafeNativeMethods.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); - SafeNativeMethods.BodyAddForce(Body, 0, 0, fz); + OdeNative.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); + OdeNative.BodySetLinearVel(Body, 0, 0, 0); + OdeNative.BodyAddForce(Body, 0, 0, fz); return; } else @@ -1813,8 +1813,8 @@ Console.WriteLine(" JointCreateFixed"); } // Where are we, and where are we headed? - SafeNativeMethods.Vector3 pos = SafeNativeMethods.BodyGetPosition(Body); - SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); + OdeNative.Vector3 pos = OdeNative.BodyGetPosition(Body); + OdeNative.Vector3 vel = OdeNative.BodyGetLinearVel(Body); // Non-Vehicles have a limited set of Hover options. // determine what our target height really is based on HoverType @@ -1856,9 +1856,9 @@ Console.WriteLine(" JointCreateFixed"); // Avatar to Avatar collisions // Prim to avatar collisions - SafeNativeMethods.BodySetPosition(Body, pos.X, pos.Y, m_targetHoverHeight); - SafeNativeMethods.BodySetLinearVel(Body, vel.X, vel.Y, 0); - SafeNativeMethods.BodyAddForce(Body, 0, 0, fz); + OdeNative.BodySetPosition(Body, pos.X, pos.Y, m_targetHoverHeight); + OdeNative.BodySetLinearVel(Body, vel.X, vel.Y, 0); + OdeNative.BodyAddForce(Body, 0, 0, fz); return; } else @@ -1884,13 +1884,13 @@ Console.WriteLine(" JointCreateFixed"); //m_taintdisable = true; //base.RaiseOutOfBounds(Position); //d.BodySetLinearVel(Body, fx, fy, 0f); - if (!SafeNativeMethods.BodyIsEnabled(Body)) + if (!OdeNative.BodyIsEnabled(Body)) { // A physical body at rest on a surface will auto-disable after a while, // this appears to re-enable it incase the surface it is upon vanishes, // and the body should fall again. - SafeNativeMethods.BodySetLinearVel(Body, 0f, 0f, 0f); - SafeNativeMethods.BodySetForce(Body, 0, 0, 0); + OdeNative.BodySetLinearVel(Body, 0f, 0f, 0f); + OdeNative.BodySetForce(Body, 0, 0, 0); enableBodySoft(); } @@ -1906,7 +1906,7 @@ Console.WriteLine(" JointCreateFixed"); fy = nmax; if (fy < nmin) fy = nmin; - SafeNativeMethods.BodyAddForce(Body, fx, fy, fz); + OdeNative.BodyAddForce(Body, fx, fy, fz); //Console.WriteLine("AddForce " + fx + "," + fy + "," + fz); } } @@ -1922,7 +1922,7 @@ Console.WriteLine(" JointCreateFixed"); private void rotate() { - SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); + OdeNative.Quaternion myrot = new OdeNative.Quaternion(); myrot.X = _orientation.X; myrot.Y = _orientation.Y; myrot.Z = _orientation.Z; @@ -1930,7 +1930,7 @@ Console.WriteLine(" JointCreateFixed"); if (Body != IntPtr.Zero) { // KF: If this is a root prim do BodySet - SafeNativeMethods.BodySetQuaternion(Body, ref myrot); + OdeNative.BodySetQuaternion(Body, ref myrot); if (IsPhysical) { // create or remove locks @@ -1940,7 +1940,7 @@ Console.WriteLine(" JointCreateFixed"); else { // daughter prim, do Geom set - SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); + OdeNative.GeomSetQuaternion(prim_geom, ref myrot); } resetCollisionAccounting(); @@ -1962,7 +1962,7 @@ Console.WriteLine(" JointCreateFixed"); m_disabled = true; if (Body != IntPtr.Zero) { - SafeNativeMethods.BodyDisable(Body); + OdeNative.BodyDisable(Body); Body = IntPtr.Zero; } @@ -2051,10 +2051,10 @@ Console.WriteLine(" JointCreateFixed"); } } - if (SafeNativeMethods.SpaceQuery(m_targetSpace, prim_geom)) + if (OdeNative.SpaceQuery(m_targetSpace, prim_geom)) { // _parent_scene.waitForSpaceUnlock(m_targetSpace); - SafeNativeMethods.SpaceRemove(m_targetSpace, prim_geom); + OdeNative.SpaceRemove(m_targetSpace, prim_geom); } RemoveGeom(); @@ -2084,13 +2084,13 @@ Console.WriteLine(" JointCreateFixed"); } CreateGeom(m_targetSpace, mesh); - SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); - SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); + OdeNative.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); + OdeNative.Quaternion myrot = new OdeNative.Quaternion(); myrot.X = _orientation.X; myrot.Y = _orientation.Y; myrot.Z = _orientation.Z; myrot.W = _orientation.W; - SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); + OdeNative.GeomSetQuaternion(prim_geom, ref myrot); //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); if (IsPhysical && Body == IntPtr.Zero && !childPrim) @@ -2098,7 +2098,7 @@ Console.WriteLine(" JointCreateFixed"); // Re creates body on size. // EnableBody also does setMass() enableBody(); - SafeNativeMethods.BodyEnable(Body); + OdeNative.BodyEnable(Body); } changeSelectedStatus(); @@ -2133,10 +2133,10 @@ Console.WriteLine(" JointCreateFixed"); } if (m_assetFailed) - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); + OdeNative.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits); else - SafeNativeMethods.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); + OdeNative.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags); } /// /// Change prim in response to a shape taint. @@ -2190,14 +2190,14 @@ Console.WriteLine(" JointCreateFixed"); } CreateGeom(m_targetSpace, mesh); - SafeNativeMethods.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); - SafeNativeMethods.Quaternion myrot = new SafeNativeMethods.Quaternion(); + OdeNative.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); + OdeNative.Quaternion myrot = new OdeNative.Quaternion(); //myrot.W = _orientation.w; myrot.W = _orientation.W; myrot.X = _orientation.X; myrot.Y = _orientation.Y; myrot.Z = _orientation.Z; - SafeNativeMethods.GeomSetQuaternion(prim_geom, ref myrot); + OdeNative.GeomSetQuaternion(prim_geom, ref myrot); //d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); if (IsPhysical && Body == IntPtr.Zero) @@ -2207,7 +2207,7 @@ Console.WriteLine(" JointCreateFixed"); enableBody(); if (Body != IntPtr.Zero) { - SafeNativeMethods.BodyEnable(Body); + OdeNative.BodyEnable(Body); } } @@ -2264,8 +2264,8 @@ Console.WriteLine(" JointCreateFixed"); m_taintforce = false; return; } - SafeNativeMethods.BodyEnable(Body); - SafeNativeMethods.BodyAddForce(Body, iforce.X, iforce.Y, iforce.Z); + OdeNative.BodyEnable(Body); + OdeNative.BodyAddForce(Body, iforce.X, iforce.Y, iforce.Z); } m_forcelist.Clear(); } @@ -2286,7 +2286,7 @@ Console.WriteLine(" JointCreateFixed"); { if (IsPhysical && Body != IntPtr.Zero) { - SafeNativeMethods.BodySetTorque(Body, m_taintTorque.X, m_taintTorque.Y, m_taintTorque.Z); + OdeNative.BodySetTorque(Body, m_taintTorque.X, m_taintTorque.Y, m_taintTorque.Z); } } @@ -2310,8 +2310,8 @@ Console.WriteLine(" JointCreateFixed"); { iforce = iforce + (m_angularforcelist[i] * 100); } - SafeNativeMethods.BodyEnable(Body); - SafeNativeMethods.BodyAddTorque(Body, iforce.X, iforce.Y, iforce.Z); + OdeNative.BodyEnable(Body); + OdeNative.BodyAddTorque(Body, iforce.X, iforce.Y, iforce.Z); } m_angularforcelist.Clear(); @@ -2339,7 +2339,7 @@ Console.WriteLine(" JointCreateFixed"); { if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetLinearVel(Body, m_taintVelocity.X, m_taintVelocity.Y, m_taintVelocity.Z); + OdeNative.BodySetLinearVel(Body, m_taintVelocity.X, m_taintVelocity.Y, m_taintVelocity.Z); } } @@ -2667,7 +2667,7 @@ Console.WriteLine(" JointCreateFixed"); } */ - SafeNativeMethods.AllocateODEDataForThread(0); + OdeNative.AllocateODEDataForThread(0); _position.X = Utils.Clamp(_position.X, 0.5f, _parent_scene.WorldExtents.X - 0.5f); _position.Y = Utils.Clamp(_position.Y, 0.5f, _parent_scene.WorldExtents.Y - 0.5f); @@ -2682,8 +2682,8 @@ Console.WriteLine(" JointCreateFixed"); if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it - SafeNativeMethods.BodySetPosition(Body, _position.X, _position.Y, _position.Z); + OdeNative.BodySetLinearVel(Body, 0, 0, 0); // stop it + OdeNative.BodySetPosition(Body, _position.X, _position.Y, _position.Z); } if(m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) @@ -2730,11 +2730,11 @@ Console.WriteLine(" JointCreateFixed"); float m_minvelocity = 0; if (Body != IntPtr.Zero) // FIXME -> or if it is a joint { - SafeNativeMethods.Vector3 vec = SafeNativeMethods.BodyGetPosition(Body); - SafeNativeMethods.Quaternion ori = SafeNativeMethods.BodyGetQuaternion(Body); - SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); - SafeNativeMethods.Vector3 rotvel = SafeNativeMethods.BodyGetAngularVel(Body); - SafeNativeMethods.Vector3 torque = SafeNativeMethods.BodyGetTorque(Body); + OdeNative.Vector3 vec = OdeNative.BodyGetPosition(Body); + OdeNative.Quaternion ori = OdeNative.BodyGetQuaternion(Body); + OdeNative.Vector3 vel = OdeNative.BodyGetLinearVel(Body); + OdeNative.Vector3 rotvel = OdeNative.BodyGetAngularVel(Body); + OdeNative.Vector3 torque = OdeNative.BodyGetTorque(Body); _torque = new Vector3(torque.X, torque.Y, torque.Z); Vector3 l_position = Vector3.Zero; Quaternion l_orientation = Quaternion.Identity; @@ -2806,19 +2806,19 @@ Console.WriteLine(" JointCreateFixed"); outofBounds = true; // part near the border on outside if (l_position.X < 0) - Util.Clamp(l_position.X, -0.1f, -2f); + l_position.X = Util.Clamp(l_position.X, -0.1f, -2f); else - Util.Clamp(l_position.X, _parent_scene.WorldExtents.X + 0.1f, _parent_scene.WorldExtents.X + 2f); + l_position.X = Util.Clamp(l_position.X, _parent_scene.WorldExtents.X + 0.1f, _parent_scene.WorldExtents.X + 2f); if (l_position.Y < 0) - Util.Clamp(l_position.Y, -0.1f, -2f); + l_position.Y = Util.Clamp(l_position.Y, -0.1f, -2f); else - Util.Clamp(l_position.Y, _parent_scene.WorldExtents.Y + 0.1f, _parent_scene.WorldExtents.Y + 2f); + l_position.Y = Util.Clamp(l_position.Y, _parent_scene.WorldExtents.Y + 0.1f, _parent_scene.WorldExtents.Y + 2f); - SafeNativeMethods.BodySetPosition(Body, l_position.X, l_position.Y, l_position.Z); + OdeNative.BodySetPosition(Body, l_position.X, l_position.Y, l_position.Z); // stop it - SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); + OdeNative.BodySetAngularVel(Body, 0, 0, 0); + OdeNative.BodySetLinearVel(Body, 0, 0, 0); disableBodySoft(); _position = l_position; @@ -3011,7 +3011,7 @@ Console.WriteLine(" JointCreateFixed"); if (Amotor != IntPtr.Zero) { - SafeNativeMethods.JointDestroy(Amotor); + OdeNative.JointDestroy(Amotor); Amotor = IntPtr.Zero; } @@ -3041,19 +3041,19 @@ Console.WriteLine(" JointCreateFixed"); if(axisnum == 0) return; // stop it - SafeNativeMethods.BodySetTorque(Body, 0, 0, 0); - SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); + OdeNative.BodySetTorque(Body, 0, 0, 0); + OdeNative.BodySetAngularVel(Body, 0, 0, 0); - Amotor = SafeNativeMethods.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); - SafeNativeMethods.JointAttach(Amotor, Body, IntPtr.Zero); + Amotor = OdeNative.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); + OdeNative.JointAttach(Amotor, Body, IntPtr.Zero); - SafeNativeMethods.JointSetAMotorMode(Amotor, 0); + OdeNative.JointSetAMotorMode(Amotor, 0); - SafeNativeMethods.JointSetAMotorNumAxes(Amotor, axisnum); + OdeNative.JointSetAMotorNumAxes(Amotor, axisnum); // get current orientation to lock - SafeNativeMethods.Quaternion dcur = SafeNativeMethods.BodyGetQuaternion(Body); + OdeNative.Quaternion dcur = OdeNative.BodyGetQuaternion(Body); Quaternion curr; // crap convertion between identical things curr.X = dcur.X; curr.Y = dcur.Y; @@ -3066,17 +3066,17 @@ Console.WriteLine(" JointCreateFixed"); if (axisX) { ax = (new Vector3(1, 0, 0)) * curr; // rotate world X to current local X - SafeNativeMethods.JointSetAMotorAxis(Amotor, 0, 0, ax.X, ax.Y, ax.Z); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 0, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.LoStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.HiStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Vel, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Bounce, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.CFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.FMax, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.StopCFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.StopERP, 0.8f); + OdeNative.JointSetAMotorAxis(Amotor, 0, 0, ax.X, ax.Y, ax.Z); + OdeNative.JointSetAMotorAngle(Amotor, 0, 0); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.LoStop, 0f); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.HiStop, 0f); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.Vel, 0); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.FudgeFactor, 0.0001f); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.Bounce, 0f); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.CFM, 0f); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.FMax, 5e8f); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.StopCFM, 0f); + OdeNative.JointSetAMotorParam(Amotor, (int)OdeNative.JointParam.StopERP, 0.8f); i++; j = 256; // move to next axis set } @@ -3084,17 +3084,17 @@ Console.WriteLine(" JointCreateFixed"); if (axisY) { ax = (new Vector3(0, 1, 0)) * curr; - SafeNativeMethods.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); - SafeNativeMethods.JointSetAMotorAngle(Amotor, i, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.LoStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.HiStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Vel, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Bounce, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.CFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FMax, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopCFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopERP, 0.8f); + OdeNative.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); + OdeNative.JointSetAMotorAngle(Amotor, i, 0); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.LoStop, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.HiStop, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.Vel, 0); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.FudgeFactor, 0.0001f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.Bounce, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.CFM, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.FMax, 5e8f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.StopCFM, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.StopERP, 0.8f); i++; j += 256; } @@ -3102,17 +3102,17 @@ Console.WriteLine(" JointCreateFixed"); if (axisZ) { ax = (new Vector3(0, 0, 1)) * curr; - SafeNativeMethods.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); - SafeNativeMethods.JointSetAMotorAngle(Amotor, i, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.LoStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.HiStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Vel, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Bounce, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.CFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FMax, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopCFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopERP, 0.8f); + OdeNative.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); + OdeNative.JointSetAMotorAngle(Amotor, i, 0); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.LoStop, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.HiStop, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.Vel, 0); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.FudgeFactor, 0.0001f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.Bounce, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.CFM, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.FMax, 5e8f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.StopCFM, 0f); + OdeNative.JointSetAMotorParam(Amotor, j + (int)OdeNative.JointParam.StopERP, 0.8f); } } diff --git a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs index c731c6c86e..892032620f 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs @@ -61,12 +61,12 @@ namespace OpenSim.Region.PhysicsModule.ODE /// /// ODE contact array to be filled by the collision testing /// - SafeNativeMethods.ContactGeom[] contacts = new SafeNativeMethods.ContactGeom[5]; + OdeNative.ContactGeom[] contacts = new OdeNative.ContactGeom[5]; /// /// ODE near callback delegate /// - private SafeNativeMethods.NearCallback nearCallback; + private OdeNative.NearCallback nearCallback; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List m_contactResults = new List(); @@ -179,14 +179,14 @@ namespace OpenSim.Region.PhysicsModule.ODE len = 100f; // Create the ray - IntPtr ray = SafeNativeMethods.CreateRay(m_scene.space, len); - SafeNativeMethods.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); + IntPtr ray = OdeNative.CreateRay(m_scene.space, len); + OdeNative.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); // Collide test - SafeNativeMethods.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); + OdeNative.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); // Remove Ray - SafeNativeMethods.GeomDestroy(ray); + OdeNative.GeomDestroy(ray); // Define default results bool hitYN = false; @@ -230,14 +230,14 @@ namespace OpenSim.Region.PhysicsModule.ODE len = 100f; // Create the ray - IntPtr ray = SafeNativeMethods.CreateRay(m_scene.space, len); - SafeNativeMethods.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); + IntPtr ray = OdeNative.CreateRay(m_scene.space, len); + OdeNative.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); // Collide test - SafeNativeMethods.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); + OdeNative.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback); // Remove Ray - SafeNativeMethods.GeomDestroy(ray); + OdeNative.GeomDestroy(ray); // Find closest contact and object. lock (m_contactResults) @@ -258,7 +258,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // return; // Raytest against AABBs of spaces first, then dig into the spaces it hits for actual geoms. - if (SafeNativeMethods.GeomIsSpace(g1) || SafeNativeMethods.GeomIsSpace(g2)) + if (OdeNative.GeomIsSpace(g1) || OdeNative.GeomIsSpace(g2)) { if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) return; @@ -269,7 +269,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // contact points in the space try { - SafeNativeMethods.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); + OdeNative.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); } catch (AccessViolationException) { @@ -296,7 +296,7 @@ namespace OpenSim.Region.PhysicsModule.ODE lock (contacts) { - count = SafeNativeMethods.Collide(g1, g2, contacts.GetLength(0), contacts, SafeNativeMethods.ContactGeom.unmanagedSizeOf); + count = OdeNative.Collide(g1, g2, contacts.GetLength(0), contacts, OdeNative.ContactGeom.unmanagedSizeOf); } } catch (SEHException) diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 12a5fc37d3..9cc6e3c017 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -334,7 +334,7 @@ namespace OpenSim.Region.PhysicsModule.ODE private bool m_filterCollisions = true; - private SafeNativeMethods.NearCallback nearCallback; + private OdeNative.NearCallback nearCallback; /// /// Avatars in the physics scene. @@ -364,7 +364,7 @@ namespace OpenSim.Region.PhysicsModule.ODE /// /// Keep record of contacts in the physics loop so that we can remove duplicates. /// - private readonly List _perloopContact = new List(); + private readonly List _perloopContact = new List(); /// /// A dictionary of actors that should receive collision events. @@ -402,17 +402,17 @@ namespace OpenSim.Region.PhysicsModule.ODE /// private readonly List defects = new List(); - private SafeNativeMethods.ContactGeom[] contacts; + private OdeNative.ContactGeom[] contacts; private readonly DoubleDictionary RegionTerrain = new DoubleDictionary(); private readonly Dictionary TerrainHeightFieldHeights = new Dictionary(); - private SafeNativeMethods.Contact contact; - private SafeNativeMethods.Contact TerrainContact; - private SafeNativeMethods.Contact AvatarMovementprimContact; - private SafeNativeMethods.Contact AvatarMovementTerrainContact; - private SafeNativeMethods.Contact WaterContact; - private SafeNativeMethods.Contact[,] m_materialContacts; + private OdeNative.Contact contact; + private OdeNative.Contact TerrainContact; + private OdeNative.Contact AvatarMovementprimContact; + private OdeNative.Contact AvatarMovementTerrainContact; + private OdeNative.Contact WaterContact; + private OdeNative.Contact[,] m_materialContacts; private int m_physicsiterations = 10; private const float m_SkipFramesAtms = 0.40f; // Drop frames gracefully at a 400 ms lag @@ -450,8 +450,8 @@ namespace OpenSim.Region.PhysicsModule.ODE private bool avplanted = false; private bool av_av_collisions_off = false; - internal SafeNativeMethods.Vector3 xyz = new SafeNativeMethods.Vector3(128.1640f, 128.3079f, 25.7600f); - internal SafeNativeMethods.Vector3 hpr = new SafeNativeMethods.Vector3(125.5000f, -17.0000f, 0.0000f); + internal OdeNative.Vector3 xyz = new OdeNative.Vector3(128.1640f, 128.3079f, 25.7600f); + internal OdeNative.Vector3 hpr = new OdeNative.Vector3(125.5000f, -17.0000f, 0.0000f); private volatile int m_global_contactcount = 0; @@ -470,7 +470,7 @@ namespace OpenSim.Region.PhysicsModule.ODE public OdeScene(Scene pscene, IConfigSource psourceconfig, string pname, string pversion) { - SafeNativeMethods.AllocateODEDataForThread(~0U); + OdeNative.AllocateODEDataForThread(~0U); m_config = psourceconfig; m_frameWorkScene = pscene; @@ -516,11 +516,11 @@ namespace OpenSim.Region.PhysicsModule.ODE m_rayCastManager = new ODERayCastRequestManager(this); // Create the world and the first space - world = SafeNativeMethods.WorldCreate(); - space = SafeNativeMethods.HashSpaceCreate(IntPtr.Zero); - contactgroup = SafeNativeMethods.JointGroupCreate(0); + world = OdeNative.WorldCreate(); + space = OdeNative.HashSpaceCreate(IntPtr.Zero); + contactgroup = OdeNative.JointGroupCreate(0); - SafeNativeMethods.WorldSetAutoDisableFlag(world, false); + OdeNative.WorldSetAutoDisableFlag(world, false); } // Initialize from configs @@ -621,7 +621,7 @@ namespace OpenSim.Region.PhysicsModule.ODE } } - contacts = new SafeNativeMethods.ContactGeom[contactsPerCollision]; + contacts = new OdeNative.ContactGeom[contactsPerCollision]; spacesPerMeterX = 1.0f / metersInSpace; spacesPerMeterY = 1.0f / metersInSpace; @@ -650,7 +650,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // Centeral contact friction and bounce // ckrinke 11/10/08 Enabling soft_erp but not soft_cfm until I figure out why // an avatar falls through in Z but not in X or Y when walking on a prim. - contact.surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + contact.surface.mode |= OdeNative.ContactFlags.SoftERP; contact.surface.mu = nmAvatarObjectContactFriction; contact.surface.bounce = nmAvatarObjectContactBounce; contact.surface.soft_cfm = 0.010f; @@ -659,12 +659,12 @@ namespace OpenSim.Region.PhysicsModule.ODE // Terrain contact friction and Bounce // This is the *non* moving version. Use this when an avatar // isn't moving to keep it in place better - TerrainContact.surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + TerrainContact.surface.mode |= OdeNative.ContactFlags.SoftERP; TerrainContact.surface.mu = nmTerrainContactFriction; TerrainContact.surface.bounce = nmTerrainContactBounce; TerrainContact.surface.soft_erp = nmTerrainContactERP; - WaterContact.surface.mode |= (SafeNativeMethods.ContactFlags.SoftERP | SafeNativeMethods.ContactFlags.SoftCFM); + WaterContact.surface.mode |= (OdeNative.ContactFlags.SoftERP | OdeNative.ContactFlags.SoftCFM); WaterContact.surface.mu = 0f; // No friction WaterContact.surface.bounce = 0.0f; // No bounce WaterContact.surface.soft_cfm = 0.010f; @@ -679,7 +679,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // Terrain contact friction bounce and various error correcting calculations // Use this when an avatar is in contact with the terrain and moving. - AvatarMovementTerrainContact.surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + AvatarMovementTerrainContact.surface.mode |= OdeNative.ContactFlags.SoftERP; AvatarMovementTerrainContact.surface.mu = mTerrainContactFriction; AvatarMovementTerrainContact.surface.bounce = mTerrainContactBounce; AvatarMovementTerrainContact.surface.soft_erp = mTerrainContactERP; @@ -701,38 +701,38 @@ namespace OpenSim.Region.PhysicsModule.ODE Rubber = 6 */ - m_materialContacts = new SafeNativeMethods.Contact[7,2]; + m_materialContacts = new OdeNative.Contact[7,2]; - m_materialContacts[(int)Material.Stone, 0] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Stone, 0].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Stone, 0] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Stone, 0].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Stone, 0].surface.mu = nmAvatarObjectContactFriction; m_materialContacts[(int)Material.Stone, 0].surface.bounce = nmAvatarObjectContactBounce; m_materialContacts[(int)Material.Stone, 0].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Stone, 0].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Stone, 1] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Stone, 1].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Stone, 1] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Stone, 1].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Stone, 1].surface.mu = mAvatarObjectContactFriction; m_materialContacts[(int)Material.Stone, 1].surface.bounce = mAvatarObjectContactBounce; m_materialContacts[(int)Material.Stone, 1].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Stone, 1].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Metal, 0] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Metal, 0].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Metal, 0] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Metal, 0].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Metal, 0].surface.mu = nmAvatarObjectContactFriction; m_materialContacts[(int)Material.Metal, 0].surface.bounce = nmAvatarObjectContactBounce; m_materialContacts[(int)Material.Metal, 0].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Metal, 0].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Metal, 1] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Metal, 1].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Metal, 1] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Metal, 1].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Metal, 1].surface.mu = mAvatarObjectContactFriction; m_materialContacts[(int)Material.Metal, 1].surface.bounce = mAvatarObjectContactBounce; m_materialContacts[(int)Material.Metal, 1].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Metal, 1].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Glass, 0] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Glass, 0].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Glass, 0] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Glass, 0].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Glass, 0].surface.mu = 1f; m_materialContacts[(int)Material.Glass, 0].surface.bounce = 0.5f; m_materialContacts[(int)Material.Glass, 0].surface.soft_cfm = 0.010f; @@ -745,83 +745,83 @@ namespace OpenSim.Region.PhysicsModule.ODE private float mAvatarObjectContactFriction = 75f; private float mAvatarObjectContactBounce = 0.1f; */ - m_materialContacts[(int)Material.Glass, 1] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Glass, 1].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Glass, 1] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Glass, 1].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Glass, 1].surface.mu = 1f; m_materialContacts[(int)Material.Glass, 1].surface.bounce = 0.5f; m_materialContacts[(int)Material.Glass, 1].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Glass, 1].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Wood, 0] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Wood, 0].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Wood, 0] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Wood, 0].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Wood, 0].surface.mu = nmAvatarObjectContactFriction; m_materialContacts[(int)Material.Wood, 0].surface.bounce = nmAvatarObjectContactBounce; m_materialContacts[(int)Material.Wood, 0].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Wood, 0].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Wood, 1] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Wood, 1].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Wood, 1] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Wood, 1].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Wood, 1].surface.mu = mAvatarObjectContactFriction; m_materialContacts[(int)Material.Wood, 1].surface.bounce = mAvatarObjectContactBounce; m_materialContacts[(int)Material.Wood, 1].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Wood, 1].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Flesh, 0] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Flesh, 0].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Flesh, 0] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Flesh, 0].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Flesh, 0].surface.mu = nmAvatarObjectContactFriction; m_materialContacts[(int)Material.Flesh, 0].surface.bounce = nmAvatarObjectContactBounce; m_materialContacts[(int)Material.Flesh, 0].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Flesh, 0].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Flesh, 1] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Flesh, 1].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Flesh, 1] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Flesh, 1].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Flesh, 1].surface.mu = mAvatarObjectContactFriction; m_materialContacts[(int)Material.Flesh, 1].surface.bounce = mAvatarObjectContactBounce; m_materialContacts[(int)Material.Flesh, 1].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Flesh, 1].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Plastic, 0] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Plastic, 0].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Plastic, 0] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Plastic, 0].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Plastic, 0].surface.mu = nmAvatarObjectContactFriction; m_materialContacts[(int)Material.Plastic, 0].surface.bounce = nmAvatarObjectContactBounce; m_materialContacts[(int)Material.Plastic, 0].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Plastic, 0].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Plastic, 1] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Plastic, 1].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Plastic, 1] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Plastic, 1].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Plastic, 1].surface.mu = mAvatarObjectContactFriction; m_materialContacts[(int)Material.Plastic, 1].surface.bounce = mAvatarObjectContactBounce; m_materialContacts[(int)Material.Plastic, 1].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Plastic, 1].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Rubber, 0] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Rubber, 0].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Rubber, 0] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Rubber, 0].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Rubber, 0].surface.mu = nmAvatarObjectContactFriction; m_materialContacts[(int)Material.Rubber, 0].surface.bounce = nmAvatarObjectContactBounce; m_materialContacts[(int)Material.Rubber, 0].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Rubber, 0].surface.soft_erp = 0.010f; - m_materialContacts[(int)Material.Rubber, 1] = new SafeNativeMethods.Contact(); - m_materialContacts[(int)Material.Rubber, 1].surface.mode |= SafeNativeMethods.ContactFlags.SoftERP; + m_materialContacts[(int)Material.Rubber, 1] = new OdeNative.Contact(); + m_materialContacts[(int)Material.Rubber, 1].surface.mode |= OdeNative.ContactFlags.SoftERP; m_materialContacts[(int)Material.Rubber, 1].surface.mu = mAvatarObjectContactFriction; m_materialContacts[(int)Material.Rubber, 1].surface.bounce = mAvatarObjectContactBounce; m_materialContacts[(int)Material.Rubber, 1].surface.soft_cfm = 0.010f; m_materialContacts[(int)Material.Rubber, 1].surface.soft_erp = 0.010f; - SafeNativeMethods.HashSpaceSetLevels(space, HashspaceLow, HashspaceHigh); + OdeNative.HashSpaceSetLevels(space, HashspaceLow, HashspaceHigh); // Set the gravity,, don't disable things automatically (we set it explicitly on some things) - SafeNativeMethods.WorldSetGravity(world, gravityx, gravityy, gravityz); - SafeNativeMethods.WorldSetContactSurfaceLayer(world, contactsurfacelayer); + OdeNative.WorldSetGravity(world, gravityx, gravityy, gravityz); + OdeNative.WorldSetContactSurfaceLayer(world, contactsurfacelayer); - SafeNativeMethods.WorldSetLinearDamping(world, 256f); - SafeNativeMethods.WorldSetAngularDamping(world, 256f); - SafeNativeMethods.WorldSetAngularDampingThreshold(world, 256f); - SafeNativeMethods.WorldSetLinearDampingThreshold(world, 256f); - SafeNativeMethods.WorldSetMaxAngularSpeed(world, 256f); + OdeNative.WorldSetLinearDamping(world, 256f); + OdeNative.WorldSetAngularDamping(world, 256f); + OdeNative.WorldSetAngularDampingThreshold(world, 256f); + OdeNative.WorldSetLinearDampingThreshold(world, 256f); + OdeNative.WorldSetMaxAngularSpeed(world, 256f); - SafeNativeMethods.WorldSetQuickStepNumIterations(world, m_physicsiterations); + OdeNative.WorldSetQuickStepNumIterations(world, m_physicsiterations); //d.WorldSetContactMaxCorrectingVel(world, 1000.0f); for (int i = 0; i < staticPrimspace.GetLength(0); i++) @@ -847,7 +847,7 @@ namespace OpenSim.Region.PhysicsModule.ODE /// /// private int CollideGeoms( - IntPtr geom1, IntPtr geom2, int maxContacts, SafeNativeMethods.ContactGeom[] contactsArray, int contactGeomSize) + IntPtr geom1, IntPtr geom2, int maxContacts, OdeNative.ContactGeom[] contactsArray, int contactGeomSize) { int count; @@ -857,7 +857,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (CollectStats) m_nativeCollisionStartTick = Util.EnvironmentTickCount(); - count = SafeNativeMethods.Collide(geom1, geom2, maxContacts, contactsArray, contactGeomSize); + count = OdeNative.Collide(geom1, geom2, maxContacts, contactsArray, contactGeomSize); } // We do this outside the lock so that any waiting threads aren't held up, though the effect is probably @@ -883,7 +883,7 @@ namespace OpenSim.Region.PhysicsModule.ODE m_nativeCollisionStartTick = Util.EnvironmentTickCount(); } - SafeNativeMethods.SpaceCollide2(space1, space2, data, nearCallback); + OdeNative.SpaceCollide2(space1, space2, data, nearCallback); if (CollectStats && m_inCollisionTiming) { @@ -914,7 +914,7 @@ namespace OpenSim.Region.PhysicsModule.ODE // Test if we're colliding a geom with a space. // If so we have to drill down into the space recursively - if (SafeNativeMethods.GeomIsSpace(g1) || SafeNativeMethods.GeomIsSpace(g2)) + if (OdeNative.GeomIsSpace(g1) || OdeNative.GeomIsSpace(g2)) { if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) return; @@ -943,8 +943,8 @@ namespace OpenSim.Region.PhysicsModule.ODE if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) return; - IntPtr b1 = SafeNativeMethods.GeomGetBody(g1); - IntPtr b2 = SafeNativeMethods.GeomGetBody(g2); + IntPtr b1 = OdeNative.GeomGetBody(g1); + IntPtr b2 = OdeNative.GeomGetBody(g2); // d.GeomClassID id = d.GeomGetClass(g1); @@ -971,10 +971,10 @@ namespace OpenSim.Region.PhysicsModule.ODE if (g1 == g2) return; // Can't collide with yourself - if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && SafeNativeMethods.AreConnectedExcluding(b1, b2, SafeNativeMethods.JointType.Contact)) + if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && OdeNative.AreConnectedExcluding(b1, b2, OdeNative.JointType.Contact)) return; - count = CollideGeoms(g1, g2, contacts.Length, contacts, SafeNativeMethods.ContactGeom.unmanagedSizeOf); + count = CollideGeoms(g1, g2, contacts.Length, contacts, OdeNative.ContactGeom.unmanagedSizeOf); // All code after this is only relevant if we have any collisions if (count <= 0) @@ -1022,7 +1022,7 @@ namespace OpenSim.Region.PhysicsModule.ODE for (int i = 0; i < count; i++) { - SafeNativeMethods.ContactGeom curContact = contacts[i]; + OdeNative.ContactGeom curContact = contacts[i]; if (curContact.depth > maxDepthContact.PenetrationDepth) { @@ -1099,7 +1099,7 @@ namespace OpenSim.Region.PhysicsModule.ODE curContact.depth = 0.00000003f; p2.Velocity = p2.Velocity + new Vector3(0f, 0f, 0.5f); curContact.pos = - new SafeNativeMethods.Vector3(curContact.pos.X + (p1.Size.X/2), + new OdeNative.Vector3(curContact.pos.X + (p1.Size.X/2), curContact.pos.Y + (p1.Size.Y/2), curContact.pos.Z + (p1.Size.Z/2)); character.SetPidStatus(true); @@ -1116,7 +1116,7 @@ namespace OpenSim.Region.PhysicsModule.ODE curContact.depth = 0.00000003f; p1.Velocity = p1.Velocity + new Vector3(0f, 0f, 0.5f); curContact.pos = - new SafeNativeMethods.Vector3(curContact.pos.X + (p1.Size.X/2), + new OdeNative.Vector3(curContact.pos.X + (p1.Size.X/2), curContact.pos.Y + (p1.Size.Y/2), curContact.pos.Z + (p1.Size.Z/2)); character.SetPidStatus(true); @@ -1168,7 +1168,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref AvatarMovementTerrainContact); + joint = OdeNative.JointCreateContact(world, contactgroup, ref AvatarMovementTerrainContact); m_global_contactcount++; } } @@ -1182,7 +1182,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref TerrainContact); + joint = OdeNative.JointCreateContact(world, contactgroup, ref TerrainContact); m_global_contactcount++; } } @@ -1217,7 +1217,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref m_materialContacts[material, movintYN]); + joint = OdeNative.JointCreateContact(world, contactgroup, ref m_materialContacts[material, movintYN]); m_global_contactcount++; } } @@ -1243,7 +1243,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref m_materialContacts[material, movintYN]); + joint = OdeNative.JointCreateContact(world, contactgroup, ref m_materialContacts[material, movintYN]); m_global_contactcount++; } } @@ -1277,7 +1277,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref WaterContact); + joint = OdeNative.JointCreateContact(world, contactgroup, ref WaterContact); m_global_contactcount++; } //m_log.Info("[PHYSICS]: Prim Water Contact" + contact.depth); @@ -1294,7 +1294,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref AvatarMovementprimContact); + joint = OdeNative.JointCreateContact(world, contactgroup, ref AvatarMovementprimContact); m_global_contactcount++; } } @@ -1305,7 +1305,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref contact); + joint = OdeNative.JointCreateContact(world, contactgroup, ref contact); m_global_contactcount++; } } @@ -1326,7 +1326,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath) { - joint = SafeNativeMethods.JointCreateContact(world, contactgroup, ref m_materialContacts[material, 0]); + joint = OdeNative.JointCreateContact(world, contactgroup, ref m_materialContacts[material, 0]); m_global_contactcount++; } } @@ -1334,7 +1334,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (m_global_contactcount < maxContactsbeforedeath && joint != IntPtr.Zero) // stack collide! { - SafeNativeMethods.JointAttach(joint, b1, b2); + OdeNative.JointAttach(joint, b1, b2); m_global_contactcount++; } } @@ -1354,7 +1354,7 @@ namespace OpenSim.Region.PhysicsModule.ODE } } - private bool checkDupe(SafeNativeMethods.ContactGeom contactGeom, int atype) + private bool checkDupe(OdeNative.ContactGeom contactGeom, int atype) { if (!m_filterCollisions) return false; @@ -1363,7 +1363,7 @@ namespace OpenSim.Region.PhysicsModule.ODE ActorTypes at = (ActorTypes)atype; - foreach (SafeNativeMethods.ContactGeom contact in _perloopContact) + foreach (OdeNative.ContactGeom contact in _perloopContact) { //if ((contact.g1 == contactGeom.g1 && contact.g2 == contactGeom.g2)) //{ @@ -1550,7 +1550,7 @@ namespace OpenSim.Region.PhysicsModule.ODE List removeprims = null; foreach (OdePrim chr in _activeprims) { - if (chr.Body != IntPtr.Zero && SafeNativeMethods.BodyIsEnabled(chr.Body) && (!chr.m_disabled)) + if (chr.Body != IntPtr.Zero && OdeNative.BodyIsEnabled(chr.Body) && (!chr.m_disabled)) { try { @@ -1676,7 +1676,7 @@ namespace OpenSim.Region.PhysicsModule.ODE public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying) { - SafeNativeMethods.AllocateODEDataForThread(0); + OdeNative.AllocateODEDataForThread(0); OdeCharacter newAv = new OdeCharacter( @@ -1699,7 +1699,7 @@ namespace OpenSim.Region.PhysicsModule.ODE lock (OdeLock) { - SafeNativeMethods.AllocateODEDataForThread(0); + OdeNative.AllocateODEDataForThread(0); ((OdeCharacter) actor).Destroy(); } @@ -1756,7 +1756,7 @@ namespace OpenSim.Region.PhysicsModule.ODE OdePrim newPrim; lock (OdeLock) { - SafeNativeMethods.AllocateODEDataForThread(0); + OdeNative.AllocateODEDataForThread(0); newPrim = new OdePrim(name, this, pos, siz, rot, pbs, isphysical); lock (_prims) @@ -1914,12 +1914,12 @@ namespace OpenSim.Region.PhysicsModule.ODE //{ //int adfadf = 0; //} - if (SafeNativeMethods.SpaceQuery(currentspace, geom) && currentspace != IntPtr.Zero) + if (OdeNative.SpaceQuery(currentspace, geom) && currentspace != IntPtr.Zero) { - if (SafeNativeMethods.GeomIsSpace(currentspace)) + if (OdeNative.GeomIsSpace(currentspace)) { // waitForSpaceUnlock(currentspace); - SafeNativeMethods.SpaceRemove(currentspace, geom); + OdeNative.SpaceRemove(currentspace, geom); } else { @@ -1929,13 +1929,13 @@ namespace OpenSim.Region.PhysicsModule.ODE } else { - IntPtr sGeomIsIn = SafeNativeMethods.GeomGetSpace(geom); + IntPtr sGeomIsIn = OdeNative.GeomGetSpace(geom); if (sGeomIsIn != IntPtr.Zero) { - if (SafeNativeMethods.GeomIsSpace(currentspace)) + if (OdeNative.GeomIsSpace(currentspace)) { // waitForSpaceUnlock(sGeomIsIn); - SafeNativeMethods.SpaceRemove(sGeomIsIn, geom); + OdeNative.SpaceRemove(sGeomIsIn, geom); } else { @@ -1946,13 +1946,13 @@ namespace OpenSim.Region.PhysicsModule.ODE } //If there are no more geometries in the sub-space, we don't need it in the main space anymore - if (SafeNativeMethods.SpaceGetNumGeoms(currentspace) == 0) + if (OdeNative.SpaceGetNumGeoms(currentspace) == 0) { if (currentspace != IntPtr.Zero) { - if (SafeNativeMethods.GeomIsSpace(currentspace)) + if (OdeNative.GeomIsSpace(currentspace)) { - SafeNativeMethods.SpaceRemove(space, currentspace); + OdeNative.SpaceRemove(space, currentspace); // free up memory used by the space. resetSpaceArrayItemToZero(currentspace); @@ -1970,12 +1970,12 @@ namespace OpenSim.Region.PhysicsModule.ODE // this is a physical object that got disabled. ;.; if (currentspace != IntPtr.Zero && geom != IntPtr.Zero) { - if (SafeNativeMethods.SpaceQuery(currentspace, geom)) + if (OdeNative.SpaceQuery(currentspace, geom)) { - if (SafeNativeMethods.GeomIsSpace(currentspace)) + if (OdeNative.GeomIsSpace(currentspace)) { // waitForSpaceUnlock(currentspace); - SafeNativeMethods.SpaceRemove(currentspace, geom); + OdeNative.SpaceRemove(currentspace, geom); } else { @@ -1985,13 +1985,13 @@ namespace OpenSim.Region.PhysicsModule.ODE } else { - IntPtr sGeomIsIn = SafeNativeMethods.GeomGetSpace(geom); + IntPtr sGeomIsIn = OdeNative.GeomGetSpace(geom); if (sGeomIsIn != IntPtr.Zero) { - if (SafeNativeMethods.GeomIsSpace(sGeomIsIn)) + if (OdeNative.GeomIsSpace(sGeomIsIn)) { // waitForSpaceUnlock(sGeomIsIn); - SafeNativeMethods.SpaceRemove(sGeomIsIn, geom); + OdeNative.SpaceRemove(sGeomIsIn, geom); } else { @@ -2012,7 +2012,7 @@ namespace OpenSim.Region.PhysicsModule.ODE if (newspace == IntPtr.Zero) { newspace = createprimspace(iprimspaceArrItem[0], iprimspaceArrItem[1]); - SafeNativeMethods.HashSpaceSetLevels(newspace, HashspaceLow, HashspaceHigh); + OdeNative.HashSpaceSetLevels(newspace, HashspaceLow, HashspaceHigh); } return newspace; @@ -2027,11 +2027,11 @@ namespace OpenSim.Region.PhysicsModule.ODE internal IntPtr createprimspace(int iprimspaceArrItemX, int iprimspaceArrItemY) { // creating a new space for prim and inserting it into main space. - staticPrimspace[iprimspaceArrItemX, iprimspaceArrItemY] = SafeNativeMethods.HashSpaceCreate(IntPtr.Zero); - SafeNativeMethods.GeomSetCategoryBits(staticPrimspace[iprimspaceArrItemX, iprimspaceArrItemY], (int)CollisionCategories.Space); + staticPrimspace[iprimspaceArrItemX, iprimspaceArrItemY] = OdeNative.HashSpaceCreate(IntPtr.Zero); + OdeNative.GeomSetCategoryBits(staticPrimspace[iprimspaceArrItemX, iprimspaceArrItemY], (int)CollisionCategories.Space); // waitForSpaceUnlock(space); - SafeNativeMethods.SpaceSetSublevel(space, 1); - SafeNativeMethods.SpaceAdd(space, staticPrimspace[iprimspaceArrItemX, iprimspaceArrItemY]); + OdeNative.SpaceSetSublevel(space, 1); + OdeNative.SpaceAdd(space, staticPrimspace[iprimspaceArrItemX, iprimspaceArrItemY]); return staticPrimspace[iprimspaceArrItemX, iprimspaceArrItemY]; } @@ -2251,7 +2251,7 @@ namespace OpenSim.Region.PhysicsModule.ODE m_log.InfoFormat("[Ode] start processing pending actor operations"); int tstart = Util.EnvironmentTickCount(); - SafeNativeMethods.AllocateODEDataForThread(0); + OdeNative.AllocateODEDataForThread(0); lock (_taintedPrims) { @@ -2327,7 +2327,7 @@ namespace OpenSim.Region.PhysicsModule.ODE lock (OdeLock) { - SafeNativeMethods.AllocateODEDataForThread(~0U); + OdeNative.AllocateODEDataForThread(~0U); while (step_time > HalfOdeStep) { @@ -2476,12 +2476,12 @@ namespace OpenSim.Region.PhysicsModule.ODE } lock(SimulationLock) - SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); + OdeNative.WorldQuickStep(world, ODE_STEPSIZE); if (CollectStats) m_stats[ODENativeStepFrameMsStatName] += Util.EnvironmentTickCountSubtract(tempTick); - SafeNativeMethods.JointGroupEmpty(contactgroup); + OdeNative.JointGroupEmpty(contactgroup); } catch (Exception e) { @@ -2529,7 +2529,7 @@ namespace OpenSim.Region.PhysicsModule.ODE foreach (OdePrim prim in _activeprims) { - if (prim.IsPhysical && (SafeNativeMethods.BodyIsEnabled(prim.Body) || !prim._zeroFlag)) + if (prim.IsPhysical && (OdeNative.BodyIsEnabled(prim.Body) || !prim._zeroFlag)) { prim.UpdatePositionAndVelocity(); } @@ -2556,7 +2556,7 @@ namespace OpenSim.Region.PhysicsModule.ODE fwriter.Close(); } - SafeNativeMethods.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); + OdeNative.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); } latertickcount = Util.EnvironmentTickCountSubtract(tickCountFrameRun); @@ -2668,7 +2668,7 @@ namespace OpenSim.Region.PhysicsModule.ODE lock (OdeLock) { - SafeNativeMethods.AllocateODEDataForThread(~0U); + OdeNative.AllocateODEDataForThread(~0U); IntPtr GroundGeom = IntPtr.Zero; if (RegionTerrain.TryGetValue(pOffset, out GroundGeom)) @@ -2680,29 +2680,29 @@ namespace OpenSim.Region.PhysicsModule.ODE { TerrainHeightFieldHeights.Remove(GroundGeom); } - SafeNativeMethods.SpaceRemove(space, GroundGeom); - SafeNativeMethods.GeomDestroy(GroundGeom); + OdeNative.SpaceRemove(space, GroundGeom); + OdeNative.GeomDestroy(GroundGeom); } } - IntPtr HeightmapData = SafeNativeMethods.GeomHeightfieldDataCreate(); - SafeNativeMethods.GeomHeightfieldDataBuildSingle(HeightmapData, _heightmap, 0, + IntPtr HeightmapData = OdeNative.GeomHeightfieldDataCreate(); + OdeNative.GeomHeightfieldDataBuildSingle(HeightmapData, _heightmap, 0, heightmapWidth, heightmapHeight, (int)heightmapWidthSamples, (int)heightmapHeightSamples, scale, offset, thickness, wrap); - SafeNativeMethods.GeomHeightfieldDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1); - GroundGeom = SafeNativeMethods.CreateHeightfield(space, HeightmapData, 1); + OdeNative.GeomHeightfieldDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1); + GroundGeom = OdeNative.CreateHeightfield(space, HeightmapData, 1); if (GroundGeom != IntPtr.Zero) { - SafeNativeMethods.GeomSetCategoryBits(GroundGeom, (int)(CollisionCategories.Land)); - SafeNativeMethods.GeomSetCollideBits(GroundGeom, (int)(CollisionCategories.Space)); + OdeNative.GeomSetCategoryBits(GroundGeom, (int)(CollisionCategories.Land)); + OdeNative.GeomSetCollideBits(GroundGeom, (int)(CollisionCategories.Space)); } geom_name_map[GroundGeom] = "Terrain"; - SafeNativeMethods.Matrix3 R = new SafeNativeMethods.Matrix3(); + OdeNative.Matrix3 R = new OdeNative.Matrix3(); Quaternion q1 = Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), 1.5707f); Quaternion q2 = Quaternion.CreateFromAxisAngle(new Vector3(0, 1, 0), 1.5707f); @@ -2712,9 +2712,9 @@ namespace OpenSim.Region.PhysicsModule.ODE float angle; q1.GetAxisAngle(out v3, out angle); - SafeNativeMethods.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle); - SafeNativeMethods.GeomSetRotation(GroundGeom, ref R); - SafeNativeMethods.GeomSetPosition(GroundGeom, pOffset.X + regionsizeX * 0.5f, pOffset.Y + regionsizeY * 0.5f, 0.0f); + OdeNative.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle); + OdeNative.GeomSetRotation(GroundGeom, ref R); + OdeNative.GeomSetPosition(GroundGeom, pOffset.X + regionsizeX * 0.5f, pOffset.Y + regionsizeY * 0.5f, 0.0f); IntPtr testGround = IntPtr.Zero; if (RegionTerrain.TryGetValue(pOffset, out testGround)) { @@ -2752,7 +2752,7 @@ namespace OpenSim.Region.PhysicsModule.ODE _worldInitialized = false; - SafeNativeMethods.AllocateODEDataForThread(~0U); + OdeNative.AllocateODEDataForThread(~0U); if (m_rayCastManager != null) { @@ -2780,13 +2780,13 @@ namespace OpenSim.Region.PhysicsModule.ODE { if (TerrainHeightFieldHeights.ContainsKey(GroundGeom)) TerrainHeightFieldHeights.Remove(GroundGeom); - SafeNativeMethods.GeomDestroy(GroundGeom); + OdeNative.GeomDestroy(GroundGeom); } } try { - SafeNativeMethods.WorldDestroy(world); + OdeNative.WorldDestroy(world); world = IntPtr.Zero; } catch (AccessViolationException e) diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs index 2b63a6ad6b..5b9a927ae0 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde //#endif [SuppressUnmanagedCodeSecurityAttribute] - internal static class SafeNativeMethods + internal static class UBOdeNative { internal static dReal Infinity = dReal.MaxValue; internal static int NTotalBodies = 0; @@ -529,7 +529,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde unsafe { Vector3* vtmp = BodyGetAngularVelUnsafe(body); - return Unsafe.As(ref *vtmp); + return Unsafe.As(ref *vtmp); } } @@ -539,7 +539,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde unsafe { Vector3* vtmp = BodyGetAngularVelUnsafe(body); - return Unsafe.As(ref *vtmp); + return Unsafe.As(ref *vtmp); } } @@ -581,7 +581,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde unsafe { Vector3* vtmp = BodyGetLinearVelUnsafe(body); - return Unsafe.As(ref *vtmp); + return Unsafe.As(ref *vtmp); } } @@ -607,7 +607,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde unsafe { Vector3* vtmp = BodyGetPositionUnsafe(body); - return Unsafe.As(ref *vtmp); + return Unsafe.As(ref *vtmp); } } @@ -1064,7 +1064,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde unsafe { Vector3* vtmp = GeomGetPositionUnsafe(geom); - return Unsafe.As(ref *vtmp); + return Unsafe.As(ref *vtmp); } } diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs index d64156abd9..00a9d1e3ff 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECharacter.cs @@ -91,7 +91,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde int m_colliderObjectfilter = 0; int m_colliderGroundfilter = 0; - private SafeNativeMethods.Quaternion m_NativeOrientation2D; + private UBOdeNative.Quaternion m_NativeOrientation2D; private Vector3 _zeroPosition; internal Quaternion m_orientation; private Vector3 _velocity; @@ -156,7 +156,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde public IntPtr Amotor = IntPtr.Zero; - internal SafeNativeMethods.Mass ShellMass; + internal UBOdeNative.Mass ShellMass; public int m_eventsubscription = 0; private int m_cureventsubscription = 0; @@ -834,7 +834,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_pidControllerActive = true; _acceleration = accel; if (Body != IntPtr.Zero) - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodyEnable(Body); } /// @@ -905,19 +905,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde float l = sz - CapsuleRadius; CapsuleSizeZ = sz; - collider = SafeNativeMethods.CreateCapsule(m_parent_scene.TopSpace, CapsuleRadius, 2.0f * l); - SafeNativeMethods.GeomSetCategoryBits(collider, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(collider, (uint)m_collisionFlags); + collider = UBOdeNative.CreateCapsule(m_parent_scene.TopSpace, CapsuleRadius, 2.0f * l); + UBOdeNative.GeomSetCategoryBits(collider, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(collider, (uint)m_collisionFlags); // update mass m_mass = 8f * m_density * sx * sy * sz; - SafeNativeMethods.MassSetBoxTotal(out ShellMass, m_mass, 2f * sx, 2f * sy, 2f * sz); + UBOdeNative.MassSetBoxTotal(out ShellMass, m_mass, 2f * sx, 2f * sy, 2f * sz); m_massInvTimeScaled = m_mass * m_sceneInverseTimeStep; PID_D = basePID_D * m_massInvTimeScaled; PID_P = basePID_P * m_massInvTimeScaled; m_scenegravityForceZ = m_parent_scene.gravityz * m_mass; - Body = SafeNativeMethods.BodyCreate(m_parent_scene.world); + Body = UBOdeNative.BodyCreate(m_parent_scene.world); _zeroFlag = false; m_pidControllerActive = true; @@ -926,52 +926,52 @@ namespace OpenSim.Region.PhysicsModule.ubOde _velocity = Vector3.Zero; // SafeNativeMethods.BodySetAutoDisableFlag(Body,false); - SafeNativeMethods.BodySetAutoDisableFlag(Body, true); + UBOdeNative.BodySetAutoDisableFlag(Body, true); m_bodydisablecontrol = 0; - SafeNativeMethods.BodySetPosition(Body, _position.X, _position.Y, _position.Z); + UBOdeNative.BodySetPosition(Body, _position.X, _position.Y, _position.Z); - SafeNativeMethods.BodySetMass(Body, ref ShellMass); + UBOdeNative.BodySetMass(Body, ref ShellMass); //SafeNativeMethods.GeomSetBody(capsule, Body); - SafeNativeMethods.GeomSetBody(collider, Body); + UBOdeNative.GeomSetBody(collider, Body); // The purpose of the AMotor here is to keep the avatar's physical // surrogate from rotating while moving - Amotor = SafeNativeMethods.JointCreateAMotor(m_parent_scene.world, IntPtr.Zero); - SafeNativeMethods.JointAttach(Amotor, Body, IntPtr.Zero); + Amotor = UBOdeNative.JointCreateAMotor(m_parent_scene.world, IntPtr.Zero); + UBOdeNative.JointAttach(Amotor, Body, IntPtr.Zero); - SafeNativeMethods.JointSetAMotorMode(Amotor, 0); - SafeNativeMethods.JointSetAMotorNumAxes(Amotor, 3); - SafeNativeMethods.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); - SafeNativeMethods.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); - SafeNativeMethods.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); + UBOdeNative.JointSetAMotorMode(Amotor, 0); + UBOdeNative.JointSetAMotorNumAxes(Amotor, 3); + UBOdeNative.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); + UBOdeNative.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); + UBOdeNative.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 0, 0); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 1, 0); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 2, 0); + UBOdeNative.JointSetAMotorAngle(Amotor, 0, 0); + UBOdeNative.JointSetAMotorAngle(Amotor, 1, 0); + UBOdeNative.JointSetAMotorAngle(Amotor, 2, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.StopCFM, 0f); // make it HARD - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.StopCFM2, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.StopCFM3, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.StopERP, 0.8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.StopERP2, 0.8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.StopERP3, 0.8f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.StopCFM, 0f); // make it HARD + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.StopCFM2, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.StopCFM3, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.StopERP, 0.8f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.StopERP2, 0.8f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.StopERP3, 0.8f); // These lowstops and high stops are effectively (no wiggle room) - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -1e-5f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 1e-5f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -1e-5f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 1e-5f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -1e-5f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 1e-5f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -1e-5f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 1e-5f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -1e-5f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 1e-5f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -1e-5f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 1e-5f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Vel, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Vel2, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Vel3, 0); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.Vel, 0); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.Vel2, 0); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.Vel3, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.FMax, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.FMax2, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.FMax3, 5e8f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.FMax, 5e8f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.FMax2, 5e8f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)dParam.FMax3, 5e8f); } /// @@ -983,14 +983,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde // Kill the Amotor if (Amotor != IntPtr.Zero) { - SafeNativeMethods.JointDestroy(Amotor); + UBOdeNative.JointDestroy(Amotor); Amotor = IntPtr.Zero; } if (Body != IntPtr.Zero) { //kill the body - SafeNativeMethods.BodyDestroy(Body); + UBOdeNative.BodyDestroy(Body); Body = IntPtr.Zero; } @@ -1014,7 +1014,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { m_parent_scene.actor_name_map.Remove(collider); //m_parent_scene.waitForSpaceUnlock(m_parent_scene.CharsSpace); - SafeNativeMethods.GeomDestroy(collider); + UBOdeNative.GeomDestroy(collider); collider = IntPtr.Zero; } } @@ -1053,8 +1053,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde } [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal bool Collide(IntPtr other, bool reverse, ref SafeNativeMethods.ContactGeom contact, - ref SafeNativeMethods.ContactGeom altContact, ref bool useAltcontact, ref bool feetcollision) + internal bool Collide(IntPtr other, bool reverse, ref UBOdeNative.ContactGeom contact, + ref UBOdeNative.ContactGeom altContact, ref bool useAltcontact, ref bool feetcollision) { feetcollision = false; useAltcontact = false; @@ -1067,11 +1067,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde offset.X = contact.pos.X - _position.X; offset.Y = contact.pos.Y - _position.Y; - SafeNativeMethods.GeomClassID gtype = SafeNativeMethods.GeomGetClass(other); + UBOdeNative.GeomClassID gtype = UBOdeNative.GeomGetClass(other); - if (gtype == SafeNativeMethods.GeomClassID.SphereClass && SafeNativeMethods.GeomGetBody(other) != IntPtr.Zero) + if (gtype == UBOdeNative.GeomClassID.SphereClass && UBOdeNative.GeomGetBody(other) != IntPtr.Zero) { - if (SafeNativeMethods.GeomSphereGetRadius(other) < 0.5) + if (UBOdeNative.GeomSphereGetRadius(other) < 0.5) return true; } @@ -1082,7 +1082,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde feetcollision = true; if (h < boneOff) { - CollideNormal = Unsafe.As(ref contact.normal); + CollideNormal = Unsafe.As(ref contact.normal); IsColliding = true; } } @@ -1095,7 +1095,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde feetcollision = true; if (h < boneOff) { - CollideNormal = Unsafe.As(ref contact.normal); + CollideNormal = Unsafe.As(ref contact.normal); IsColliding = true; } @@ -1124,7 +1124,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (reverse) { - altContact.normal = Unsafe.As(ref offset); + altContact.normal = Unsafe.As(ref offset); } else { @@ -1145,25 +1145,25 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body == IntPtr.Zero) return; - if (!SafeNativeMethods.BodyIsEnabled(Body)) + if (!UBOdeNative.BodyIsEnabled(Body)) { if (++m_bodydisablecontrol < 50) return; // clear residuals - SafeNativeMethods.BodySetAngularVel(Body, 0f, 0f, 0f); - SafeNativeMethods.BodySetLinearVel(Body, 0f, 0f, 0f); + UBOdeNative.BodySetAngularVel(Body, 0f, 0f, 0f); + UBOdeNative.BodySetLinearVel(Body, 0f, 0f, 0f); _zeroFlag = true; - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodyEnable(Body); } m_bodydisablecontrol = 0; // the Amotor still lets avatar rotation to drift during colisions // so force it back to identity - SafeNativeMethods.BodySetQuaternion(Body, ref m_NativeOrientation2D); + UBOdeNative.BodySetQuaternion(Body, ref m_NativeOrientation2D); - _position = SafeNativeMethods.BodyGetPositionOMV(Body); + _position = UBOdeNative.BodyGetPositionOMV(Body); // check outbounds forcing to be in world bool fixbody = false; if ((Single.IsNaN(_position.X) || Single.IsInfinity(_position.X))) @@ -1207,7 +1207,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (fixbody) { m_freemove = false; - SafeNativeMethods.BodySetPosition(Body, _position.X, _position.Y, _position.Z); + UBOdeNative.BodySetPosition(Body, _position.X, _position.Y, _position.Z); } if (!m_pidControllerActive) @@ -1240,7 +1240,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde } } - Vector3 vel = SafeNativeMethods.BodyGetLinearVelOMV(Body); + Vector3 vel = UBOdeNative.BodyGetLinearVelOMV(Body); //****************************************** // colide with land @@ -1579,7 +1579,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde } if ((vec.Z != 0 || vec.X != 0 || vec.Y != 0)) - SafeNativeMethods.BodyAddForce(Body, vec.X, vec.Y, vec.Z); + UBOdeNative.BodyAddForce(Body, vec.X, vec.Y, vec.Z); if (_zeroFlag) { @@ -1594,7 +1594,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde a = (_velocity - a) * m_sceneInverseTimeStep; SetSmooth(ref _acceleration, ref a, 2); - m_rotationalVelocity = SafeNativeMethods.BodyGetAngularVelOMVforAvatar(Body); + m_rotationalVelocity = UBOdeNative.BodyGetAngularVelOMVforAvatar(Body); } } @@ -1779,7 +1779,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_cureventsubscription < m_eventsubscription) return; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) return; lock (CollisionEventsThisFrame) @@ -1895,19 +1895,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde float l = sz - CapsuleRadius; CapsuleSizeZ= sz; - SafeNativeMethods.GeomCapsuleSetParams(collider, CapsuleRadius, 2f * l); + UBOdeNative.GeomCapsuleSetParams(collider, CapsuleRadius, 2f * l); m_mass = 8f * m_density * sx * sy * sz; // update mass m_massInvTimeScaled = m_mass * m_sceneInverseTimeStep; PID_D = basePID_D * m_massInvTimeScaled; PID_P = basePID_P * m_massInvTimeScaled; - SafeNativeMethods.MassSetBoxTotal(out ShellMass, m_mass, 2f * sx, 2f * sy, 2f * sz); - SafeNativeMethods.BodySetMass(Body, ref ShellMass); + UBOdeNative.MassSetBoxTotal(out ShellMass, m_mass, 2f * sx, 2f * sy, 2f * sz); + UBOdeNative.BodySetMass(Body, ref ShellMass); m_scenegravityForceZ = m_parent_scene.gravityz * m_mass; _position.Z += sz - oldsz; - SafeNativeMethods.BodySetPosition(Body, _position.X, _position.Y, _position.Z); + UBOdeNative.BodySetPosition(Body, _position.X, _position.Y, _position.Z); UpdateAABB2D(); @@ -1930,8 +1930,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetPosition(Body, newPos.X, newPos.Y, newPos.Z); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetPosition(Body, newPos.X, newPos.Y, newPos.Z); + UBOdeNative.BodyEnable(Body); } _position = newPos; UpdateAABB2D(); @@ -1959,12 +1959,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetQuaternion(Body, ref m_NativeOrientation2D); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetQuaternion(Body, ref m_NativeOrientation2D); + UBOdeNative.BodyEnable(Body); } } else if (Body != IntPtr.Zero) - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodyEnable(Body); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1975,8 +1975,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); + UBOdeNative.BodyEnable(Body); } } @@ -1987,7 +1987,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde //m_freemove = false; m_targetVelocity = newVel; if (Body != IntPtr.Zero) - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodyEnable(Body); } /* [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -2062,8 +2062,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero) { if (newForce.X != 0f || newForce.Y != 0f || newForce.Z != 0) - SafeNativeMethods.BodyAddForce(Body, newForce.X, newForce.Y, newForce.Z); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodyAddForce(Body, newForce.X, newForce.Y, newForce.Z); + UBOdeNative.BodyEnable(Body); } } @@ -2076,8 +2076,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetLinearVel(Body, newmomentum.X, newmomentum.Y, newmomentum.Z); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetLinearVel(Body, newmomentum.X, newmomentum.Y, newmomentum.Z); + UBOdeNative.BodyEnable(Body); } } diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODECollision.cs b/OpenSim/Region/PhysicsModules/ubOde/ODECollision.cs index 9aabe8ea58..de9a400264 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODECollision.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODECollision.cs @@ -8,7 +8,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde public partial class ODEScene { internal bool CollideSpheres(Vector3 p1, float r1, Vector3 p2, float r2, - ref SafeNativeMethods.ContactGeom c) + ref UBOdeNative.ContactGeom c) { float rsum = r1 + r2; Vector3 delta = p1 - p2; @@ -17,7 +17,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde return false; if (d < 1e-6f) { - c.pos = Unsafe.As(ref p1); + c.pos = Unsafe.As(ref p1); c.normal.X = 1; c.normal.Y = 0; c.normal.Z = 0; @@ -30,11 +30,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde float k = r1 - 0.5f * c.depth; delta *= 1.0f / d; - c.normal = Unsafe.As(ref delta); + c.normal = Unsafe.As(ref delta); delta *= k; delta = p1 - delta; - c.pos = Unsafe.As(ref delta); + c.pos = Unsafe.As(ref delta); return true; } @@ -187,13 +187,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde contactSharedForJoints.surface.mu = 0; contactSharedForJoints.surface.bounce = 0; - contactSharedForJoints.geom.pos = Unsafe.As(ref SharedChrContact.Position); - contactSharedForJoints.geom.normal = Unsafe.As(ref SharedChrContact.SurfaceNormal); + contactSharedForJoints.geom.pos = Unsafe.As(ref SharedChrContact.Position); + contactSharedForJoints.geom.normal = Unsafe.As(ref SharedChrContact.SurfaceNormal); contactSharedForJoints.geom.depth = SharedChrContact.PenetrationDepth; IntPtr Joint = CreateCharContacJoint(); if (Joint == IntPtr.Zero) return; - SafeNativeMethods.JointAttach(Joint, p1.Body, p2.Body); + UBOdeNative.JointAttach(Joint, p1.Body, p2.Body); if (p1.CollisionScore < float.MaxValue) p1.CollisionScore += 1.0f; diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs index 222848d899..048af80fbc 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs @@ -336,9 +336,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_amEfect = 1.0f ; // turn it on m_amDecay = 1.0f - 1.0f / m_angularMotorDecayTimescale; - if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) + if (rootPrim.Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(rootPrim.Body) && !rootPrim.m_isSelected && !rootPrim.m_disabled) - SafeNativeMethods.BodyEnable(rootPrim.Body); + UBOdeNative.BodyEnable(rootPrim.Body); break; case Vehicle.LINEAR_FRICTION_TIMESCALE: @@ -355,9 +355,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_lmEfect = 1.0f; // turn it on m_ffactor = 0.0f; - if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) + if (rootPrim.Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(rootPrim.Body) && !rootPrim.m_isSelected && !rootPrim.m_disabled) - SafeNativeMethods.BodyEnable(rootPrim.Body); + UBOdeNative.BodyEnable(rootPrim.Body); break; case Vehicle.LINEAR_MOTOR_OFFSET: m_linearMotorOffset = new Vector3(pValue, pValue, pValue); @@ -393,9 +393,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_amEfect = 1.0f; // turn it on m_amDecay = 1.0f - 1.0f / m_angularMotorDecayTimescale; - if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) + if (rootPrim.Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(rootPrim.Body) && !rootPrim.m_isSelected && !rootPrim.m_disabled) - SafeNativeMethods.BodyEnable(rootPrim.Body); + UBOdeNative.BodyEnable(rootPrim.Body); break; case Vehicle.LINEAR_FRICTION_TIMESCALE: if (pValue.X < m_timestep) pValue.X = m_timestep; @@ -413,9 +413,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_lmDecay = 1.0f - 1.0f / m_linearMotorDecayTimescale; m_ffactor = 0.0f; - if (rootPrim.Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(rootPrim.Body) + if (rootPrim.Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(rootPrim.Body) && !rootPrim.m_isSelected && !rootPrim.m_disabled) - SafeNativeMethods.BodyEnable(rootPrim.Body); + UBOdeNative.BodyEnable(rootPrim.Body); break; case Vehicle.LINEAR_MOTOR_OFFSET: m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); @@ -764,9 +764,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde { IntPtr Body = rootPrim.Body; - SafeNativeMethods.BodyGetMass(Body, out SafeNativeMethods.Mass dmass); + UBOdeNative.BodyGetMass(Body, out UBOdeNative.Mass dmass); - Quaternion objrotq = SafeNativeMethods.BodyGetQuaternionOMV(Body); + Quaternion objrotq = UBOdeNative.BodyGetQuaternionOMV(Body); Quaternion rotq = objrotq; // rotq = rotation of object rotq *= m_referenceFrame; // rotq is now rotation in vehicle reference frame Quaternion irotq = Quaternion.Inverse(rotq); @@ -774,12 +774,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde Vector3 tmpV; Vector3 force = Vector3.Zero; // actually linear aceleration until mult by mass in world frame Vector3 torque = Vector3.Zero;// actually angular aceleration until mult by Inertia in vehicle frame - SafeNativeMethods.Vector3 dtorque = new(); + UBOdeNative.Vector3 dtorque = new(); - Vector3 curVel = SafeNativeMethods.BodyGetLinearVelOMV(Body); // velocity in world + Vector3 curVel = UBOdeNative.BodyGetLinearVelOMV(Body); // velocity in world Vector3 curLocalVel = curVel * irotq; // current velocity in local - Vector3 curAngVel = SafeNativeMethods.BodyGetAngularVelOMV(Body); // angular velocity in world + Vector3 curAngVel = UBOdeNative.BodyGetAngularVelOMV(Body); // angular velocity in world Vector3 curLocalAngVel = curAngVel * irotq; // current angular velocity in local float ldampZ = 0; @@ -820,7 +820,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { // have offset, do it now tmpV *= dmass.mass; - SafeNativeMethods.BodyAddForceAtRelPos(Body, tmpV.X, tmpV.Y, tmpV.Z, m_linearMotorOffset.X, m_linearMotorOffset.Y, m_linearMotorOffset.Z); + UBOdeNative.BodyAddForceAtRelPos(Body, tmpV.X, tmpV.Y, tmpV.Z, m_linearMotorOffset.X, m_linearMotorOffset.Y, m_linearMotorOffset.Z); } else { @@ -842,7 +842,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde // hover if (m_VhoverTimescale < 300 && rootPrim.m_prim_geom != IntPtr.Zero) { - SafeNativeMethods.Vector3 pos = SafeNativeMethods.GeomGetPosition(rootPrim.m_prim_geom); + UBOdeNative.Vector3 pos = UBOdeNative.GeomGetPosition(rootPrim.m_prim_geom); pos.Z -= 0.21f; // minor offset that seems to be always there in sl float t = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y); @@ -1156,7 +1156,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (force.X != 0f || force.Y != 0f || force.Z != 0f) { - SafeNativeMethods.BodyAddForce(Body, force.X, force.Y, force.Z); + UBOdeNative.BodyAddForce(Body, force.X, force.Y, force.Z); } if (torque.X != 0f || torque.Y != 0f || torque.Z != 0f) @@ -1166,15 +1166,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde dtorque.Y = torque.Y; dtorque.Z = torque.Z; - SafeNativeMethods.MultiplyM3V3(out SafeNativeMethods.Vector3 dvtmp, ref dmass.I, ref dtorque); - SafeNativeMethods.BodyAddRelTorque(Body, dvtmp.X, dvtmp.Y, dvtmp.Z); // add torque in object frame + UBOdeNative.MultiplyM3V3(out UBOdeNative.Vector3 dvtmp, ref dmass.I, ref dtorque); + UBOdeNative.BodyAddRelTorque(Body, dvtmp.X, dvtmp.Y, dvtmp.Z); // add torque in object frame } torque = rootPrim.m_torque; torque += rootPrim.m_angularForceacc; rootPrim.m_angularForceacc = Vector3.Zero; if (torque.X != 0f || torque.Y != 0f || torque.Z != 0f) - SafeNativeMethods.BodyAddTorque(Body,torque.X, torque.Y, torque.Z); + UBOdeNative.BodyAddTorque(Body,torque.X, torque.Y, torque.Z); } } } diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs index 1735a4dfb9..4508f47519 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs @@ -58,9 +58,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Util.IsWindows()) Util.LoadArchSpecificWindowsDll("ubode.dll"); - SafeNativeMethods.InitODE(); + UBOdeNative.InitODE(); - string ode_config = SafeNativeMethods.GetConfiguration(); + string ode_config = UBOdeNative.GetConfiguration(); if (string.IsNullOrEmpty(ode_config)) { m_log.Error("[ubODE] Native ode library version not supported"); diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index e829b43c19..f85f738540 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs @@ -160,7 +160,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde private float m_physCost; private float m_streamCost; - internal SafeNativeMethods.Mass primdMass; // prim inertia information on it's own referencial + internal UBOdeNative.Mass primdMass; // prim inertia information on it's own referencial private PhysicsInertiaData m_InertiaOverride; float primMass; // prim own mass float primVolume; // prim own volume; @@ -491,7 +491,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde // double buffering if(m_fakeInertiaOverride != null) { - SafeNativeMethods.Mass objdmass = new(); + UBOdeNative.Mass objdmass = new(); objdmass.I.M00 = m_fakeInertiaOverride.Inertia.X; objdmass.I.M11 = m_fakeInertiaOverride.Inertia.Y; objdmass.I.M22 = m_fakeInertiaOverride.Inertia.Z; @@ -500,9 +500,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde if(MathF.Abs(m_fakeInertiaOverride.InertiaRotation.W) < 0.999) { - SafeNativeMethods.Matrix3 inertiarotmat = new(); - SafeNativeMethods.RfromQ(ref inertiarotmat, ref m_fakeInertiaOverride.InertiaRotation); - SafeNativeMethods.MassRotate(ref objdmass, ref inertiarotmat); + UBOdeNative.Matrix3 inertiarotmat = new(); + UBOdeNative.RfromQ(ref inertiarotmat, ref m_fakeInertiaOverride.InertiaRotation); + UBOdeNative.MassRotate(ref objdmass, ref inertiarotmat); } inertia.TotalMass = m_fakeInertiaOverride.TotalMass; @@ -526,13 +526,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde return inertia; } - SafeNativeMethods.Vector3 dtmp; - SafeNativeMethods.Mass m = new(); + UBOdeNative.Vector3 dtmp; + UBOdeNative.Mass m = new(); lock(m_parentScene.OdeLock) { - SafeNativeMethods.AllocateODEDataForThread(0); - dtmp = SafeNativeMethods.GeomGetOffsetPosition(m_prim_geom); - SafeNativeMethods.BodyGetMass(Body, out m); + UBOdeNative.AllocateODEDataForThread(0); + dtmp = UBOdeNative.GeomGetOffsetPosition(m_prim_geom); + UBOdeNative.BodyGetMass(Body, out m); } Vector3 cm = new(-dtmp.X, -dtmp.Y, -dtmp.Z); @@ -568,16 +568,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde { lock (m_parentScene.OdeLock) { - SafeNativeMethods.AllocateODEDataForThread(0); + UBOdeNative.AllocateODEDataForThread(0); if (!childPrim && Body != IntPtr.Zero) { - return SafeNativeMethods.BodyGetPositionOMV(Body); + return UBOdeNative.BodyGetPositionOMV(Body); } else if (m_prim_geom != IntPtr.Zero) { - Vector3 Ptot = SafeNativeMethods.GeomGetPositionOMV(m_prim_geom); - Quaternion q = SafeNativeMethods.GeomGetQuaternionOMV(m_prim_geom); + Vector3 Ptot = UBOdeNative.GeomGetPositionOMV(m_prim_geom); + Quaternion q = UBOdeNative.GeomGetQuaternionOMV(m_prim_geom); Ptot += m_OBBOffset * q; return Ptot; /* @@ -996,16 +996,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_lastposition = m_position; _velocity = Vector3.Zero; - SafeNativeMethods.AllocateODEDataForThread(0); + UBOdeNative.AllocateODEDataForThread(0); m_lastVelocity = _velocity; if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) m_vehicle.Stop(); if(Body != IntPtr.Zero) - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it + UBOdeNative.BodySetLinearVel(Body, 0, 0, 0); // stop it if (m_prim_geom != IntPtr.Zero) - SafeNativeMethods.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); + UBOdeNative.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); m_outbounds = false; changeDisable(false); @@ -1026,17 +1026,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_lastposition = m_position; m_lastorientation = m_orientation; - SafeNativeMethods.AllocateODEDataForThread(0); + UBOdeNative.AllocateODEDataForThread(0); if(Body != IntPtr.Zero) { - m_rotationalVelocity = SafeNativeMethods.BodyGetAngularVelOMV(Body); - _velocity = SafeNativeMethods.BodyGetLinearVelOMV(Body); + m_rotationalVelocity = UBOdeNative.BodyGetAngularVelOMV(Body); + _velocity = UBOdeNative.BodyGetLinearVelOMV(Body); - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it - SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); + UBOdeNative.BodySetLinearVel(Body, 0, 0, 0); // stop it + UBOdeNative.BodySetAngularVel(Body, 0, 0, 0); } if(m_prim_geom != IntPtr.Zero) - SafeNativeMethods.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); + UBOdeNative.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); disableBodySoft(); // stop collisions UnSubscribeEvents(); } @@ -1247,7 +1247,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde SentEmptyCollisionsEvent = true; //_parent_scene.RemoveCollisionEventReporting(this); } - else if(Body == IntPtr.Zero || (SafeNativeMethods.BodyIsEnabled(Body) && m_bodydisablecontrol >= 0 )) + else if(Body == IntPtr.Zero || (UBOdeNative.BodyIsEnabled(Body) && m_bodydisablecontrol >= 0 )) { SentEmptyCollisionsEvent = false; CollisionEvents.Clear(); @@ -1449,16 +1449,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (prm.m_NoColide) { - SafeNativeMethods.GeomSetCategoryBits(prm.m_prim_geom, 0); + UBOdeNative.GeomSetCategoryBits(prm.m_prim_geom, 0); if (m_isphysical) - SafeNativeMethods.GeomSetCollideBits(prm.m_prim_geom, (int)CollisionCategories.Land); + UBOdeNative.GeomSetCollideBits(prm.m_prim_geom, (int)CollisionCategories.Land); else - SafeNativeMethods.GeomSetCollideBits(prm.m_prim_geom, 0); + UBOdeNative.GeomSetCollideBits(prm.m_prim_geom, 0); } else { - SafeNativeMethods.GeomSetCategoryBits(prm.m_prim_geom, (uint)prm.m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prm.m_prim_geom, (uint)prm.m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(prm.m_prim_geom, (uint)prm.m_collisionCategories); + UBOdeNative.GeomSetCollideBits(prm.m_prim_geom, (uint)prm.m_collisionFlags); } } } @@ -1466,22 +1466,22 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_NoColide) { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, (uint)CollisionCategories.Land); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, 0); + UBOdeNative.GeomSetCollideBits(m_prim_geom, (uint)CollisionCategories.Land); if (m_collide_geom != m_prim_geom && m_collide_geom != IntPtr.Zero) { - SafeNativeMethods.GeomSetCategoryBits(m_collide_geom, 0); - SafeNativeMethods.GeomSetCollideBits(m_collide_geom, (uint)CollisionCategories.Land); + UBOdeNative.GeomSetCategoryBits(m_collide_geom, 0); + UBOdeNative.GeomSetCollideBits(m_collide_geom, (uint)CollisionCategories.Land); } } else { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); if (m_collide_geom != m_prim_geom && m_collide_geom != IntPtr.Zero) { - SafeNativeMethods.GeomSetCategoryBits(m_collide_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(m_collide_geom, (uint)m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(m_collide_geom, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(m_collide_geom, (uint)m_collisionFlags); } } } @@ -1494,7 +1494,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Amotor != IntPtr.Zero) { - SafeNativeMethods.JointDestroy(Amotor); + UBOdeNative.JointDestroy(Amotor); Amotor = IntPtr.Zero; } @@ -1521,19 +1521,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde if(axisnum == 0) return; // stop it - SafeNativeMethods.BodySetTorque(Body, 0, 0, 0); - SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); + UBOdeNative.BodySetTorque(Body, 0, 0, 0); + UBOdeNative.BodySetAngularVel(Body, 0, 0, 0); - Amotor = SafeNativeMethods.JointCreateAMotor(m_parentScene.world, IntPtr.Zero); - SafeNativeMethods.JointAttach(Amotor, Body, IntPtr.Zero); + Amotor = UBOdeNative.JointCreateAMotor(m_parentScene.world, IntPtr.Zero); + UBOdeNative.JointAttach(Amotor, Body, IntPtr.Zero); - SafeNativeMethods.JointSetAMotorMode(Amotor, 0); + UBOdeNative.JointSetAMotorMode(Amotor, 0); - SafeNativeMethods.JointSetAMotorNumAxes(Amotor, axisnum); + UBOdeNative.JointSetAMotorNumAxes(Amotor, axisnum); // get current orientation to lock - Quaternion curr= SafeNativeMethods.BodyGetQuaternionOMV(Body); + Quaternion curr= UBOdeNative.BodyGetQuaternionOMV(Body); Vector3 ax; int i = 0; @@ -1541,17 +1541,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (axisX) { ax = (new Vector3(1, 0, 0)) * curr; // rotate world X to current local X - SafeNativeMethods.JointSetAMotorAxis(Amotor, 0, 0, ax.X, ax.Y, ax.Z); - SafeNativeMethods.JointSetAMotorAngle(Amotor, 0, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.LoStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.HiStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Vel, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.Bounce, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.CFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.FMax, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.StopCFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, (int)SafeNativeMethods.JointParam.StopERP, 0.8f); + UBOdeNative.JointSetAMotorAxis(Amotor, 0, 0, ax.X, ax.Y, ax.Z); + UBOdeNative.JointSetAMotorAngle(Amotor, 0, 0); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.LoStop, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.HiStop, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.Vel, 0); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.FudgeFactor, 0.0001f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.Bounce, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.CFM, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.FMax, 5e8f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.StopCFM, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, (int)UBOdeNative.JointParam.StopERP, 0.8f); i++; j = 256; // move to next axis set } @@ -1559,17 +1559,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (axisY) { ax = (new Vector3(0, 1, 0)) * curr; - SafeNativeMethods.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); - SafeNativeMethods.JointSetAMotorAngle(Amotor, i, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.LoStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.HiStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Vel, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Bounce, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.CFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FMax, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopCFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopERP, 0.8f); + UBOdeNative.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); + UBOdeNative.JointSetAMotorAngle(Amotor, i, 0); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.LoStop, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.HiStop, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.Vel, 0); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.FudgeFactor, 0.0001f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.Bounce, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.CFM, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.FMax, 5e8f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.StopCFM, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.StopERP, 0.8f); i++; j += 256; } @@ -1577,17 +1577,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (axisZ) { ax = (new Vector3(0, 0, 1)) * curr; - SafeNativeMethods.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); - SafeNativeMethods.JointSetAMotorAngle(Amotor, i, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.LoStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.HiStop, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Vel, 0); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FudgeFactor, 0.0001f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.Bounce, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.CFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.FMax, 5e8f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopCFM, 0f); - SafeNativeMethods.JointSetAMotorParam(Amotor, j + (int)SafeNativeMethods.JointParam.StopERP, 0.8f); + UBOdeNative.JointSetAMotorAxis(Amotor, i, 0, ax.X, ax.Y, ax.Z); + UBOdeNative.JointSetAMotorAngle(Amotor, i, 0); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.LoStop, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.HiStop, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.Vel, 0); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.FudgeFactor, 0.0001f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.Bounce, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.CFM, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.FMax, 5e8f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.StopCFM, 0f); + UBOdeNative.JointSetAMotorParam(Amotor, j + (int)UBOdeNative.JointParam.StopERP, 0.8f); } } @@ -1601,21 +1601,21 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_NoColide) { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, 0); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, 0); if (m_isphysical) { - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, (uint)CollisionCategories.Land); + UBOdeNative.GeomSetCollideBits(m_prim_geom, (uint)CollisionCategories.Land); } else { - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, 0); - SafeNativeMethods.GeomDisable(m_prim_geom); + UBOdeNative.GeomSetCollideBits(m_prim_geom, 0); + UBOdeNative.GeomDisable(m_prim_geom); } } else { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); } UpdatePrimBodyData(); @@ -1678,12 +1678,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde try { - _triMeshData = SafeNativeMethods.GeomTriMeshDataCreate(); + _triMeshData = UBOdeNative.GeomTriMeshDataCreate(); - SafeNativeMethods.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); - SafeNativeMethods.GeomTriMeshDataPreprocess(_triMeshData); + UBOdeNative.GeomTriMeshDataBuildSimple(_triMeshData, vertices, vertexStride, vertexCount, indices, indexCount, triStride); + UBOdeNative.GeomTriMeshDataPreprocess(_triMeshData); - geo = SafeNativeMethods.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null); + geo = UBOdeNative.CreateTriMesh(m_targetSpace, _triMeshData, null, null, null); } catch (Exception e) @@ -1693,7 +1693,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { try { - SafeNativeMethods.GeomTriMeshDataDestroy(_triMeshData); + UBOdeNative.GeomTriMeshDataDestroy(_triMeshData); } catch { @@ -1749,7 +1749,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { // it's a sphere try { - geo = SafeNativeMethods.CreateSphere(m_targetSpace, m_size.X * 0.5f); + geo = UBOdeNative.CreateSphere(m_targetSpace, m_size.X * 0.5f); } catch (Exception e) { @@ -1761,7 +1761,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde {// do it as a box try { - geo = SafeNativeMethods.CreateBox(m_targetSpace, m_size.X, m_size.Y, m_size.Z); + geo = UBOdeNative.CreateBox(m_targetSpace, m_size.X, m_size.Y, m_size.Z); } catch (Exception e) { @@ -1783,10 +1783,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde try { - SafeNativeMethods.GeomDestroy(m_prim_geom); + UBOdeNative.GeomDestroy(m_prim_geom); if (_triMeshData != IntPtr.Zero) { - SafeNativeMethods.GeomTriMeshDataDestroy(_triMeshData); + UBOdeNative.GeomTriMeshDataDestroy(_triMeshData); _triMeshData = IntPtr.Zero; } } @@ -1838,8 +1838,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde ApplyCollisionCatFlags(); _zeroFlag = true; - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } resetCollisionAccounting(); @@ -1858,7 +1858,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_collisionCategories = 0; m_collisionFlags = 0; ApplyCollisionCatFlags(); - SafeNativeMethods.BodyDisable(Body); + UBOdeNative.BodyDisable(Body); } } } @@ -1886,35 +1886,35 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_log.Warn("[PHYSICS]: MakeBody called having a body"); } - if (SafeNativeMethods.GeomGetBody(m_prim_geom) != IntPtr.Zero) + if (UBOdeNative.GeomGetBody(m_prim_geom) != IntPtr.Zero) { - SafeNativeMethods.GeomSetBody(m_prim_geom, IntPtr.Zero); + UBOdeNative.GeomSetBody(m_prim_geom, IntPtr.Zero); m_log.Warn("[PHYSICS]: MakeBody root geom already had a body"); } bool noInertiaOverride = (m_InertiaOverride == null); - Body = SafeNativeMethods.BodyCreate(m_parentScene.world); + Body = UBOdeNative.BodyCreate(m_parentScene.world); // set the body rotation - SafeNativeMethods.Matrix3 mymat = new(); - SafeNativeMethods.RfromQ(ref mymat, ref m_orientation); - SafeNativeMethods.BodySetRotation(Body, ref mymat); + UBOdeNative.Matrix3 mymat = new(); + UBOdeNative.RfromQ(ref mymat, ref m_orientation); + UBOdeNative.BodySetRotation(Body, ref mymat); - SafeNativeMethods.Mass objdmass = new(); + UBOdeNative.Mass objdmass = new(); if (noInertiaOverride) { objdmass = primdMass; - SafeNativeMethods.MassRotate(ref objdmass, ref mymat); + UBOdeNative.MassRotate(ref objdmass, ref mymat); } // recompute full object inertia if needed if (childrenPrim.Count > 0) { - SafeNativeMethods.Matrix3 mat = new(); - SafeNativeMethods.Mass tmpdmass; + UBOdeNative.Matrix3 mat = new(); + UBOdeNative.Mass tmpdmass; Vector3 rcm; rcm = m_position; @@ -1929,66 +1929,66 @@ namespace OpenSim.Region.PhysicsModule.ubOde continue; } - SafeNativeMethods.RfromQ(ref mat, ref prm.m_orientation); + UBOdeNative.RfromQ(ref mat, ref prm.m_orientation); // fix prim colision cats - if (SafeNativeMethods.GeomGetBody(prm.m_prim_geom) != IntPtr.Zero) + if (UBOdeNative.GeomGetBody(prm.m_prim_geom) != IntPtr.Zero) { - SafeNativeMethods.GeomSetBody(prm.m_prim_geom, IntPtr.Zero); + UBOdeNative.GeomSetBody(prm.m_prim_geom, IntPtr.Zero); m_log.Warn("[PHYSICS]: MakeBody child geom already had a body"); } - SafeNativeMethods.GeomClearOffset(prm.m_prim_geom); - SafeNativeMethods.GeomSetBody(prm.m_prim_geom, Body); + UBOdeNative.GeomClearOffset(prm.m_prim_geom); + UBOdeNative.GeomSetBody(prm.m_prim_geom, Body); prm.Body = Body; - SafeNativeMethods.GeomSetOffsetWorldRotation(prm.m_prim_geom, ref mat); // set relative rotation + UBOdeNative.GeomSetOffsetWorldRotation(prm.m_prim_geom, ref mat); // set relative rotation if(noInertiaOverride) { tmpdmass = prm.primdMass; - SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); + UBOdeNative.MassRotate(ref tmpdmass, ref mat); Vector3 ppos = prm.m_position; ppos -= rcm; // refer inertia to root prim center of mass position - SafeNativeMethods.MassTranslate(ref tmpdmass, + UBOdeNative.MassTranslate(ref tmpdmass, ppos.X, ppos.Y, ppos.Z); - SafeNativeMethods.MassAdd(ref objdmass, ref tmpdmass); // add to total object inertia + UBOdeNative.MassAdd(ref objdmass, ref tmpdmass); // add to total object inertia } } } } - SafeNativeMethods.GeomClearOffset(m_prim_geom); // make sure we don't have a hidden offset + UBOdeNative.GeomClearOffset(m_prim_geom); // make sure we don't have a hidden offset // associate root geom with body - SafeNativeMethods.GeomSetBody(m_prim_geom, Body); + UBOdeNative.GeomSetBody(m_prim_geom, Body); if(noInertiaOverride) - SafeNativeMethods.BodySetPosition(Body, m_position.X + objdmass.c.X, m_position.Y + objdmass.c.Y, m_position.Z + objdmass.c.Z); + UBOdeNative.BodySetPosition(Body, m_position.X + objdmass.c.X, m_position.Y + objdmass.c.Y, m_position.Z + objdmass.c.Z); else { Vector3 ncm = m_InertiaOverride.CenterOfMass * m_orientation; - SafeNativeMethods.BodySetPosition(Body, + UBOdeNative.BodySetPosition(Body, m_position.X + ncm.X, m_position.Y + ncm.Y, m_position.Z + ncm.Z); } - SafeNativeMethods.GeomSetOffsetWorldPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); + UBOdeNative.GeomSetOffsetWorldPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); if(noInertiaOverride) { - SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body + UBOdeNative.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body Quaternion mr = Quaternion.Conjugate(m_orientation); - SafeNativeMethods.RfromQ(ref mymat, ref mr); - SafeNativeMethods.MassRotate(ref objdmass, ref mymat); + UBOdeNative.RfromQ(ref mymat, ref mr); + UBOdeNative.MassRotate(ref objdmass, ref mymat); - SafeNativeMethods.BodySetMass(Body, ref objdmass); + UBOdeNative.BodySetMass(Body, ref objdmass); m_mass = objdmass.mass; } else @@ -2005,29 +2005,29 @@ namespace OpenSim.Region.PhysicsModule.ubOde if(MathF.Abs(m_InertiaOverride.InertiaRotation.W) < 0.999f) { - SafeNativeMethods.Matrix3 inertiarotmat = new(); - SafeNativeMethods.RfromQ(ref inertiarotmat, ref m_InertiaOverride.InertiaRotation); - SafeNativeMethods.MassRotate(ref objdmass, ref inertiarotmat); + UBOdeNative.Matrix3 inertiarotmat = new(); + UBOdeNative.RfromQ(ref inertiarotmat, ref m_InertiaOverride.InertiaRotation); + UBOdeNative.MassRotate(ref objdmass, ref inertiarotmat); } - SafeNativeMethods.BodySetMass(Body, ref objdmass); + UBOdeNative.BodySetMass(Body, ref objdmass); m_mass = objdmass.mass; } // disconnect from world gravity so we can apply buoyancy - SafeNativeMethods.BodySetGravityMode(Body, false); + UBOdeNative.BodySetGravityMode(Body, false); - SafeNativeMethods.BodySetAutoDisableFlag(Body, true); - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodySetAutoDisableAngularThreshold(Body, 0.001f); - SafeNativeMethods.BodySetAutoDisableLinearThreshold(Body, 0.01f); - SafeNativeMethods.BodySetDamping(Body, .002f, .0005f); + UBOdeNative.BodySetAutoDisableFlag(Body, true); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodySetAutoDisableAngularThreshold(Body, 0.001f); + UBOdeNative.BodySetAutoDisableLinearThreshold(Body, 0.01f); + UBOdeNative.BodySetDamping(Body, .002f, .0005f); if (m_targetSpace != IntPtr.Zero) { //m_parentScene.waitForSpaceUnlock(m_targetSpace); - if (SafeNativeMethods.SpaceQuery(m_targetSpace, m_prim_geom)) - SafeNativeMethods.SpaceRemove(m_targetSpace, m_prim_geom); + if (UBOdeNative.SpaceQuery(m_targetSpace, m_prim_geom)) + UBOdeNative.SpaceRemove(m_targetSpace, m_prim_geom); } if (childrenPrim.Count == 0) @@ -2037,23 +2037,23 @@ namespace OpenSim.Region.PhysicsModule.ubOde } else { - m_targetSpace = SafeNativeMethods.SimpleSpaceCreate(m_parentScene.ActiveSpace); - SafeNativeMethods.SpaceSetSublevel(m_targetSpace, 0); - SafeNativeMethods.SpaceSetCleanup(m_targetSpace, false); + m_targetSpace = UBOdeNative.SimpleSpaceCreate(m_parentScene.ActiveSpace); + UBOdeNative.SpaceSetSublevel(m_targetSpace, 0); + UBOdeNative.SpaceSetCleanup(m_targetSpace, false); - SafeNativeMethods.GeomSetCategoryBits(m_targetSpace, (uint)(CollisionCategories.Space | + UBOdeNative.GeomSetCategoryBits(m_targetSpace, (uint)(CollisionCategories.Space | CollisionCategories.Geom | CollisionCategories.Phantom | CollisionCategories.VolumeDtc )); - SafeNativeMethods.GeomSetCollideBits(m_targetSpace, 0); + UBOdeNative.GeomSetCollideBits(m_targetSpace, 0); m_collide_geom = m_targetSpace; } - if (SafeNativeMethods.SpaceQuery(m_targetSpace, m_prim_geom)) + if (UBOdeNative.SpaceQuery(m_targetSpace, m_prim_geom)) m_log.Debug("[PRIM]: parent already in target space"); else - SafeNativeMethods.SpaceAdd(m_targetSpace, m_prim_geom); + UBOdeNative.SpaceAdd(m_targetSpace, m_prim_geom); if (m_delaySelect) { @@ -2077,7 +2077,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde continue; Vector3 ppos = prm.m_position; - SafeNativeMethods.GeomSetOffsetWorldPosition(prm.m_prim_geom, ppos.X, ppos.Y, ppos.Z); // set relative position + UBOdeNative.GeomSetOffsetWorldPosition(prm.m_prim_geom, ppos.X, ppos.Y, ppos.Z); // set relative position IntPtr prmspace = prm.m_targetSpace; if (prmspace != m_targetSpace) @@ -2085,14 +2085,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (prmspace != IntPtr.Zero) { //m_parentScene.waitForSpaceUnlock(prmspace); - if (SafeNativeMethods.SpaceQuery(prmspace, prmgeom)) - SafeNativeMethods.SpaceRemove(prmspace, prmgeom); + if (UBOdeNative.SpaceQuery(prmspace, prmgeom)) + UBOdeNative.SpaceRemove(prmspace, prmgeom); } prm.m_targetSpace = m_targetSpace; - if (SafeNativeMethods.SpaceQuery(m_targetSpace, prmgeom)) + if (UBOdeNative.SpaceQuery(m_targetSpace, prmgeom)) m_log.Debug("[PRIM]: child already in target space"); else - SafeNativeMethods.SpaceAdd(m_targetSpace, prmgeom); + UBOdeNative.SpaceAdd(m_targetSpace, prmgeom); } prm.m_collisionscore = 0; @@ -2112,13 +2112,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_isSelected || m_disabled) { - SafeNativeMethods.BodyDisable(Body); + UBOdeNative.BodyDisable(Body); _zeroFlag = true; } else { - SafeNativeMethods.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z); - SafeNativeMethods.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z); + UBOdeNative.BodySetAngularVel(Body, m_rotationalVelocity.X, m_rotationalVelocity.Y, m_rotationalVelocity.Z); + UBOdeNative.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z); _zeroFlag = false; m_bodydisablecontrol = 0; @@ -2151,16 +2151,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_NoColide) { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, 0); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, 0); + UBOdeNative.GeomSetCollideBits(m_prim_geom, 0); } else { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); } UpdateDataFromGeom(); - SafeNativeMethods.GeomSetBody(m_prim_geom, IntPtr.Zero); + UBOdeNative.GeomSetBody(m_prim_geom, IntPtr.Zero); SetInStaticSpace(this); } @@ -2187,13 +2187,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (prm.m_NoColide) { - SafeNativeMethods.GeomSetCategoryBits(prm.m_prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prm.m_prim_geom, 0); + UBOdeNative.GeomSetCategoryBits(prm.m_prim_geom, 0); + UBOdeNative.GeomSetCollideBits(prm.m_prim_geom, 0); } else { - SafeNativeMethods.GeomSetCategoryBits(prm.m_prim_geom, (uint)prm.m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prm.m_prim_geom, (uint)prm.m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(prm.m_prim_geom, (uint)prm.m_collisionCategories); + UBOdeNative.GeomSetCollideBits(prm.m_prim_geom, (uint)prm.m_collisionFlags); } prm.UpdateDataFromGeom(); SetInStaticSpace(prm); @@ -2205,11 +2205,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde } if (Amotor != IntPtr.Zero) { - SafeNativeMethods.JointDestroy(Amotor); + UBOdeNative.JointDestroy(Amotor); Amotor = IntPtr.Zero; } m_parentScene.remActiveGroup(this); - SafeNativeMethods.BodyDestroy(Body); + UBOdeNative.BodyDestroy(Body); } Body = IntPtr.Zero; } @@ -2219,24 +2219,24 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void FixInertia(Vector3 NewPos,Quaternion newrot) { - SafeNativeMethods.BodyGetMass(Body, out SafeNativeMethods.Mass tmpdmass); - SafeNativeMethods.Mass objdmass = tmpdmass; + UBOdeNative.BodyGetMass(Body, out UBOdeNative.Mass tmpdmass); + UBOdeNative.Mass objdmass = tmpdmass; - SafeNativeMethods.Vector3 dobjpos; - SafeNativeMethods.Vector3 thispos; + UBOdeNative.Vector3 dobjpos; + UBOdeNative.Vector3 thispos; // get current object position and rotation - dobjpos = SafeNativeMethods.BodyGetPosition(Body); + dobjpos = UBOdeNative.BodyGetPosition(Body); // get prim own inertia in its local frame tmpdmass = primdMass; // transform to object frame - SafeNativeMethods.Matrix3 mat = SafeNativeMethods.GeomGetOffsetRotation(m_prim_geom); - SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); + UBOdeNative.Matrix3 mat = UBOdeNative.GeomGetOffsetRotation(m_prim_geom); + UBOdeNative.MassRotate(ref tmpdmass, ref mat); - thispos = SafeNativeMethods.GeomGetOffsetPosition(m_prim_geom); - SafeNativeMethods.MassTranslate(ref tmpdmass, + thispos = UBOdeNative.GeomGetOffsetPosition(m_prim_geom); + UBOdeNative.MassTranslate(ref tmpdmass, thispos.X, thispos.Y, thispos.Z); @@ -2249,68 +2249,68 @@ namespace OpenSim.Region.PhysicsModule.ubOde // update to new position and orientation m_position = NewPos; - SafeNativeMethods.GeomSetOffsetWorldPosition(m_prim_geom, NewPos.X, NewPos.Y, NewPos.Z); + UBOdeNative.GeomSetOffsetWorldPosition(m_prim_geom, NewPos.X, NewPos.Y, NewPos.Z); m_orientation = newrot; - SafeNativeMethods.Quaternion quat = new() + UBOdeNative.Quaternion quat = new() { X = newrot.X, Y = newrot.Y, Z = newrot.Z, W = newrot.W }; - SafeNativeMethods.GeomSetOffsetWorldQuaternion(m_prim_geom, ref quat); + UBOdeNative.GeomSetOffsetWorldQuaternion(m_prim_geom, ref quat); - mat = SafeNativeMethods.GeomGetOffsetRotation(m_prim_geom); - SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); + mat = UBOdeNative.GeomGetOffsetRotation(m_prim_geom); + UBOdeNative.MassRotate(ref tmpdmass, ref mat); - thispos = SafeNativeMethods.GeomGetOffsetPosition(m_prim_geom); - SafeNativeMethods.MassTranslate(ref tmpdmass, + thispos = UBOdeNative.GeomGetOffsetPosition(m_prim_geom); + UBOdeNative.MassTranslate(ref tmpdmass, thispos.X, thispos.Y, thispos.Z); - SafeNativeMethods.MassAdd(ref objdmass, ref tmpdmass); + UBOdeNative.MassAdd(ref objdmass, ref tmpdmass); // fix all positions - IntPtr g = SafeNativeMethods.BodyGetFirstGeom(Body); + IntPtr g = UBOdeNative.BodyGetFirstGeom(Body); while (g != IntPtr.Zero) { - thispos = SafeNativeMethods.GeomGetOffsetPosition(g); + thispos = UBOdeNative.GeomGetOffsetPosition(g); thispos.X -= objdmass.c.X; thispos.Y -= objdmass.c.Y; thispos.Z -= objdmass.c.Z; - SafeNativeMethods.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); - g = SafeNativeMethods.dBodyGetNextGeom(g); + UBOdeNative.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); + g = UBOdeNative.dBodyGetNextGeom(g); } - SafeNativeMethods.BodyVectorToWorld(Body,objdmass.c.X, objdmass.c.Y, objdmass.c.Z,out thispos); + UBOdeNative.BodyVectorToWorld(Body,objdmass.c.X, objdmass.c.Y, objdmass.c.Z,out thispos); - SafeNativeMethods.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); - SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body - SafeNativeMethods.BodySetMass(Body, ref objdmass); + UBOdeNative.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); + UBOdeNative.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body + UBOdeNative.BodySetMass(Body, ref objdmass); m_mass = objdmass.mass; } private void FixInertia(Vector3 NewPos) { - SafeNativeMethods.Matrix3 primmat; - SafeNativeMethods.Mass tmpdmass; - SafeNativeMethods.Mass primmass; + UBOdeNative.Matrix3 primmat; + UBOdeNative.Mass tmpdmass; + UBOdeNative.Mass primmass; - SafeNativeMethods.Vector3 dobjpos; - SafeNativeMethods.Vector3 thispos; + UBOdeNative.Vector3 dobjpos; + UBOdeNative.Vector3 thispos; - SafeNativeMethods.BodyGetMass(Body, out SafeNativeMethods.Mass objdmass); + UBOdeNative.BodyGetMass(Body, out UBOdeNative.Mass objdmass); // get prim own inertia in its local frame primmass = primdMass; // transform to object frame - primmat = SafeNativeMethods.GeomGetOffsetRotation(m_prim_geom); - SafeNativeMethods.MassRotate(ref primmass, ref primmat); + primmat = UBOdeNative.GeomGetOffsetRotation(m_prim_geom); + UBOdeNative.MassRotate(ref primmass, ref primmat); tmpdmass = primmass; - thispos = SafeNativeMethods.GeomGetOffsetPosition(m_prim_geom); - SafeNativeMethods.MassTranslate(ref tmpdmass, + thispos = UBOdeNative.GeomGetOffsetPosition(m_prim_geom); + UBOdeNative.MassTranslate(ref tmpdmass, thispos.X, thispos.Y, thispos.Z); @@ -2320,56 +2320,56 @@ namespace OpenSim.Region.PhysicsModule.ubOde // update to new position m_position = NewPos; - SafeNativeMethods.GeomSetOffsetWorldPosition(m_prim_geom, NewPos.X, NewPos.Y, NewPos.Z); + UBOdeNative.GeomSetOffsetWorldPosition(m_prim_geom, NewPos.X, NewPos.Y, NewPos.Z); - thispos = SafeNativeMethods.GeomGetOffsetPosition(m_prim_geom); - SafeNativeMethods.MassTranslate(ref primmass, + thispos = UBOdeNative.GeomGetOffsetPosition(m_prim_geom); + UBOdeNative.MassTranslate(ref primmass, thispos.X, thispos.Y, thispos.Z); - SafeNativeMethods.MassAdd(ref objdmass, ref primmass); + UBOdeNative.MassAdd(ref objdmass, ref primmass); // fix all positions - IntPtr g = SafeNativeMethods.BodyGetFirstGeom(Body); + IntPtr g = UBOdeNative.BodyGetFirstGeom(Body); while (g != IntPtr.Zero) { - thispos = SafeNativeMethods.GeomGetOffsetPosition(g); + thispos = UBOdeNative.GeomGetOffsetPosition(g); thispos.X -= objdmass.c.X; thispos.Y -= objdmass.c.Y; thispos.Z -= objdmass.c.Z; - SafeNativeMethods.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); - g = SafeNativeMethods.dBodyGetNextGeom(g); + UBOdeNative.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); + g = UBOdeNative.dBodyGetNextGeom(g); } - SafeNativeMethods.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); + UBOdeNative.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); // get current object position and rotation - dobjpos = SafeNativeMethods.BodyGetPosition(Body); + dobjpos = UBOdeNative.BodyGetPosition(Body); - SafeNativeMethods.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); - SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body - SafeNativeMethods.BodySetMass(Body, ref objdmass); + UBOdeNative.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); + UBOdeNative.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body + UBOdeNative.BodySetMass(Body, ref objdmass); m_mass = objdmass.mass; } private void FixInertia(Quaternion newrot) { - SafeNativeMethods.Matrix3 mat; - SafeNativeMethods.Quaternion quat = new(); + UBOdeNative.Matrix3 mat; + UBOdeNative.Quaternion quat = new(); - SafeNativeMethods.Vector3 dobjpos; - SafeNativeMethods.Vector3 thispos; + UBOdeNative.Vector3 dobjpos; + UBOdeNative.Vector3 thispos; - SafeNativeMethods.BodyGetMass(Body, out SafeNativeMethods.Mass objdmass); + UBOdeNative.BodyGetMass(Body, out UBOdeNative.Mass objdmass); // get prim own inertia in its local frame - SafeNativeMethods.Mass tmpdmass = primdMass; - mat = SafeNativeMethods.GeomGetOffsetRotation(m_prim_geom); - SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); + UBOdeNative.Mass tmpdmass = primdMass; + mat = UBOdeNative.GeomGetOffsetRotation(m_prim_geom); + UBOdeNative.MassRotate(ref tmpdmass, ref mat); // transform to object frame - thispos = SafeNativeMethods.GeomGetOffsetPosition(m_prim_geom); - SafeNativeMethods.MassTranslate(ref tmpdmass, + thispos = UBOdeNative.GeomGetOffsetPosition(m_prim_geom); + UBOdeNative.MassTranslate(ref tmpdmass, thispos.X, thispos.Y, thispos.Z); @@ -2383,37 +2383,37 @@ namespace OpenSim.Region.PhysicsModule.ubOde quat.Y = newrot.Y; quat.Z = newrot.Z; quat.W = newrot.W; - SafeNativeMethods.GeomSetOffsetWorldQuaternion(m_prim_geom, ref quat); + UBOdeNative.GeomSetOffsetWorldQuaternion(m_prim_geom, ref quat); tmpdmass = primdMass; - mat = SafeNativeMethods.GeomGetOffsetRotation(m_prim_geom); - SafeNativeMethods.MassRotate(ref tmpdmass, ref mat); - SafeNativeMethods.MassTranslate(ref tmpdmass, + mat = UBOdeNative.GeomGetOffsetRotation(m_prim_geom); + UBOdeNative.MassRotate(ref tmpdmass, ref mat); + UBOdeNative.MassTranslate(ref tmpdmass, thispos.X, thispos.Y, thispos.Z); - SafeNativeMethods.MassAdd(ref objdmass, ref tmpdmass); + UBOdeNative.MassAdd(ref objdmass, ref tmpdmass); // fix all positions - IntPtr g = SafeNativeMethods.BodyGetFirstGeom(Body); + IntPtr g = UBOdeNative.BodyGetFirstGeom(Body); while (g != IntPtr.Zero) { - thispos = SafeNativeMethods.GeomGetOffsetPosition(g); + thispos = UBOdeNative.GeomGetOffsetPosition(g); thispos.X -= objdmass.c.X; thispos.Y -= objdmass.c.Y; thispos.Z -= objdmass.c.Z; - SafeNativeMethods.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); - g = SafeNativeMethods.dBodyGetNextGeom(g); + UBOdeNative.GeomSetOffsetPosition(g, thispos.X, thispos.Y, thispos.Z); + g = UBOdeNative.dBodyGetNextGeom(g); } - SafeNativeMethods.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); + UBOdeNative.BodyVectorToWorld(Body, objdmass.c.X, objdmass.c.Y, objdmass.c.Z, out thispos); // get current object position and rotation - dobjpos = SafeNativeMethods.BodyGetPosition(Body); + dobjpos = UBOdeNative.BodyGetPosition(Body); - SafeNativeMethods.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); - SafeNativeMethods.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body - SafeNativeMethods.BodySetMass(Body, ref objdmass); + UBOdeNative.BodySetPosition(Body, dobjpos.X + thispos.X, dobjpos.Y + thispos.Y, dobjpos.Z + thispos.Z); + UBOdeNative.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body + UBOdeNative.BodySetMass(Body, ref objdmass); m_mass = objdmass.mass; } @@ -2431,9 +2431,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_mass = primMass; // just in case - SafeNativeMethods.MassSetBoxTotal(out primdMass, primMass, 2.0f * m_OBB.X, 2.0f * m_OBB.Y, 2.0f * m_OBB.Z); + UBOdeNative.MassSetBoxTotal(out primdMass, primMass, 2.0f * m_OBB.X, 2.0f * m_OBB.Y, 2.0f * m_OBB.Z); - SafeNativeMethods.MassTranslate(ref primdMass, + UBOdeNative.MassTranslate(ref primdMass, m_OBBOffset.X, m_OBBOffset.Y, m_OBBOffset.Z); @@ -2488,7 +2488,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (prm.Body != IntPtr.Zero) { if (prm.m_prim_geom != IntPtr.Zero) - SafeNativeMethods.GeomSetBody(prm.m_prim_geom, IntPtr.Zero); + UBOdeNative.GeomSetBody(prm.m_prim_geom, IntPtr.Zero); if (prm.Body != prim.Body) prm.DestroyBody(); // don't loose bodies around prm.Body = IntPtr.Zero; @@ -2505,7 +2505,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (prim.Body != IntPtr.Zero) { if (prim.m_prim_geom != IntPtr.Zero) - SafeNativeMethods.GeomSetBody(prim.m_prim_geom, IntPtr.Zero); + UBOdeNative.GeomSetBody(prim.m_prim_geom, IntPtr.Zero); prim.DestroyBody(); // don't loose bodies around prim.Body = IntPtr.Zero; } @@ -2530,7 +2530,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_prim_geom != IntPtr.Zero) { - m_orientation = SafeNativeMethods.GeomGetQuaternionOMV(m_prim_geom); + m_orientation = UBOdeNative.GeomGetQuaternionOMV(m_prim_geom); /* // Debug float qlen = _orientation.Length(); @@ -2538,7 +2538,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_log.WarnFormat("[PHYSICS]: Got nonnorm quaternion from geom in Object {0} norm {1}", Name, qlen); */ m_orientation.Normalize(); - m_position = SafeNativeMethods.GeomGetPositionOMV(m_prim_geom); + m_position = UBOdeNative.GeomGetPositionOMV(m_prim_geom); } } @@ -2666,7 +2666,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (Amotor != IntPtr.Zero) { - SafeNativeMethods.JointDestroy(Amotor); + UBOdeNative.JointDestroy(Amotor); Amotor = IntPtr.Zero; } } @@ -2725,10 +2725,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero) { - SafeNativeMethods.BodySetForce(Body, 0f, 0f, 0f); - SafeNativeMethods.BodySetTorque(Body, 0f, 0f, 0f); - SafeNativeMethods.BodySetLinearVel(Body, 0f, 0f, 0f); - SafeNativeMethods.BodySetAngularVel(Body, 0f, 0f, 0f); + UBOdeNative.BodySetForce(Body, 0f, 0f, 0f); + UBOdeNative.BodySetTorque(Body, 0f, 0f, 0f); + UBOdeNative.BodySetLinearVel(Body, 0f, 0f, 0f); + UBOdeNative.BodySetAngularVel(Body, 0f, 0f, 0f); } } @@ -2769,7 +2769,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (newval) { if (!childPrim && Body != IntPtr.Zero) - SafeNativeMethods.BodyDisable(Body); + UBOdeNative.BodyDisable(Body); if (m_delaySelect || m_isphysical) { @@ -2788,13 +2788,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (prm.m_NoColide) { - SafeNativeMethods.GeomSetCategoryBits(prm.m_prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(prm.m_prim_geom, 0); + UBOdeNative.GeomSetCategoryBits(prm.m_prim_geom, 0); + UBOdeNative.GeomSetCollideBits(prm.m_prim_geom, 0); } else { - SafeNativeMethods.GeomSetCategoryBits(prm.m_prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(prm.m_prim_geom, (uint)m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(prm.m_prim_geom, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(prm.m_prim_geom, (uint)m_collisionFlags); } } prm.m_delaySelect = false; @@ -2805,22 +2805,22 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_NoColide) { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, 0); - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, 0); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, 0); + UBOdeNative.GeomSetCollideBits(m_prim_geom, 0); if (m_collide_geom != m_prim_geom && m_collide_geom != IntPtr.Zero) { - SafeNativeMethods.GeomSetCategoryBits(m_collide_geom, 0); - SafeNativeMethods.GeomSetCollideBits(m_collide_geom, 0); + UBOdeNative.GeomSetCategoryBits(m_collide_geom, 0); + UBOdeNative.GeomSetCollideBits(m_collide_geom, 0); } } else { - SafeNativeMethods.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(m_prim_geom, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(m_prim_geom, (uint)m_collisionFlags); if (m_collide_geom != m_prim_geom && m_collide_geom != IntPtr.Zero) { - SafeNativeMethods.GeomSetCategoryBits(m_collide_geom, (uint)m_collisionCategories); - SafeNativeMethods.GeomSetCollideBits(m_collide_geom, (uint)m_collisionFlags); + UBOdeNative.GeomSetCategoryBits(m_collide_geom, (uint)m_collisionCategories); + UBOdeNative.GeomSetCollideBits(m_collide_geom, (uint)m_collisionFlags); } } } @@ -2839,8 +2839,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Body != IntPtr.Zero && !m_disabled) { _zeroFlag = true; - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -2869,11 +2869,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde else if (m_forcePosOrRotation && Body != IntPtr.Zero && m_position.NotEqual(newPos)) { FixInertia(newPos); - if (!SafeNativeMethods.BodyIsEnabled(Body)) + if (!UBOdeNative.BodyIsEnabled(Body)) { _zeroFlag = true; - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } } @@ -2881,14 +2881,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_position.NotEqual(newPos)) { - SafeNativeMethods.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); + UBOdeNative.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); m_position = newPos; } - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { _zeroFlag = true; - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } } @@ -2898,7 +2898,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_position.NotEqual(newPos)) { - SafeNativeMethods.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); + UBOdeNative.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); m_position = newPos; m_targetSpace = m_parentScene.MoveGeomToStaticSpace(m_prim_geom, m_targetSpace); @@ -2937,14 +2937,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (newOri.NotEqual(m_orientation)) { - SafeNativeMethods.Quaternion myrot = new() + UBOdeNative.Quaternion myrot = new() { X = newOri.X, Y = newOri.Y, Z = newOri.Z, W = newOri.W }; - SafeNativeMethods.GeomSetQuaternion(m_prim_geom, ref myrot); + UBOdeNative.GeomSetQuaternion(m_prim_geom, ref myrot); m_orientation = newOri; if (Body != IntPtr.Zero) @@ -2953,11 +2953,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde createAMotor(m_angularlocks); } } - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { _zeroFlag = true; - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } } @@ -2967,14 +2967,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (newOri.NotEqual(m_orientation)) { - SafeNativeMethods.Quaternion myrot = new() + UBOdeNative.Quaternion myrot = new() { X = newOri.X, Y = newOri.Y, Z = newOri.Z, W = newOri.W }; - SafeNativeMethods.GeomSetQuaternion(m_prim_geom, ref myrot); + UBOdeNative.GeomSetQuaternion(m_prim_geom, ref myrot); m_orientation = newOri; } } @@ -3000,28 +3000,28 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (newOri.NotEqual(m_orientation)) { - SafeNativeMethods.Quaternion myrot = new() + UBOdeNative.Quaternion myrot = new() { X = newOri.X, Y = newOri.Y, Z = newOri.Z, W = newOri.W }; - SafeNativeMethods.GeomSetQuaternion(m_prim_geom, ref myrot); + UBOdeNative.GeomSetQuaternion(m_prim_geom, ref myrot); m_orientation = newOri; if (Body != IntPtr.Zero && m_angularlocks != 0) createAMotor(m_angularlocks); } if (m_position.NotEqual(newPos)) { - SafeNativeMethods.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); + UBOdeNative.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); m_position = newPos; } - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { _zeroFlag = true; - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } } @@ -3034,20 +3034,20 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (newOri.NotEqual(m_orientation)) { - SafeNativeMethods.Quaternion myrot = new() + UBOdeNative.Quaternion myrot = new() { X = newOri.X, Y = newOri.Y, Z = newOri.Z, W = newOri.W }; - SafeNativeMethods.GeomSetQuaternion(m_prim_geom, ref myrot); + UBOdeNative.GeomSetQuaternion(m_prim_geom, ref myrot); m_orientation = newOri; } if (newPos.NotEqual(m_position)) { - SafeNativeMethods.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); + UBOdeNative.GeomSetPosition(m_prim_geom, newPos.X, newPos.Y, newPos.Z); m_position = newPos; m_targetSpace = m_parentScene.MoveGeomToStaticSpace(m_prim_geom, m_targetSpace); @@ -3136,15 +3136,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_prim_geom != IntPtr.Zero) { - SafeNativeMethods.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); - SafeNativeMethods.Quaternion myrot = new() + UBOdeNative.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); + UBOdeNative.Quaternion myrot = new() { X = m_orientation.X, Y = m_orientation.Y, Z = m_orientation.Z, W = m_orientation.W }; - SafeNativeMethods.GeomSetQuaternion(m_prim_geom, ref myrot); + UBOdeNative.GeomSetQuaternion(m_prim_geom, ref myrot); } if (!m_isphysical) @@ -3215,15 +3215,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_prim_geom != IntPtr.Zero) { - SafeNativeMethods.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); - SafeNativeMethods.Quaternion myrot = new() + UBOdeNative.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); + UBOdeNative.Quaternion myrot = new() { X = m_orientation.X, Y = m_orientation.Y, Z = m_orientation.Z, W = m_orientation.W }; - SafeNativeMethods.GeomSetQuaternion(m_prim_geom, ref myrot); + UBOdeNative.GeomSetQuaternion(m_prim_geom, ref myrot); } if (m_isphysical) @@ -3276,10 +3276,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_disabled) enableBodySoft(); - else if (!SafeNativeMethods.BodyIsEnabled(Body)) + else if (!UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } m_torque = newtorque; @@ -3290,10 +3290,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changeForce(Vector3 force) { m_force = force; - if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3310,10 +3310,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_disabled) enableBodySoft(); - else if (!SafeNativeMethods.BodyIsEnabled(Body)) + else if (!UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } } @@ -3334,10 +3334,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_disabled) enableBodySoft(); - else if (!SafeNativeMethods.BodyIsEnabled(Body)) + else if (!UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } } @@ -3361,12 +3361,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_disabled) enableBodySoft(); - else if (!SafeNativeMethods.BodyIsEnabled(Body)) + else if (!UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } - SafeNativeMethods.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); + UBOdeNative.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); } //resetCollisionAccounting(); } @@ -3389,12 +3389,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (m_disabled) enableBodySoft(); - else if (!SafeNativeMethods.BodyIsEnabled(Body)) + else if (!UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } - SafeNativeMethods.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z); + UBOdeNative.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z); } //resetCollisionAccounting(); } @@ -3467,10 +3467,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde return; m_vehicle.ProcessFloatVehicleParam((Vehicle)fp.param, fp.value); - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3480,10 +3480,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_vehicle == null) return; m_vehicle.ProcessVectorVehicleParam((Vehicle)vp.param, vp.value); - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3493,10 +3493,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_vehicle == null) return; m_vehicle.ProcessRotationVehicleParam((Vehicle)qp.param, qp.value); - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3506,10 +3506,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_vehicle == null) return; m_vehicle.ProcessVehicleFlags(bp.param, bp.value); - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3517,10 +3517,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changeBuoyancy(float b) { m_buoyancy = b; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3528,10 +3528,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changePIDTarget(Vector3 trg) { m_PIDTarget = trg; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3539,10 +3539,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changePIDTau(float tau) { m_PIDTau = tau; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3550,10 +3550,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changePIDActive(bool val) { m_usePID = val; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3563,10 +3563,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_PIDHoverHeight = val; if (val == 0) m_useHoverPID = false; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3574,10 +3574,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changePIDHoverType(PIDHoverType type) { m_PIDHoverType = type; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3585,10 +3585,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changePIDHoverTau(float tau) { m_PIDHoverTau = tau; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3596,10 +3596,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde private void changePIDHoverActive(bool active) { m_useHoverPID = active; - if (Body != IntPtr.Zero && !SafeNativeMethods.BodyIsEnabled(Body)) + if (Body != IntPtr.Zero && !UBOdeNative.BodyIsEnabled(Body)) { - SafeNativeMethods.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, m_body_autodisable_frames); + UBOdeNative.BodyEnable(Body); } } @@ -3620,7 +3620,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (!childPrim && m_isphysical && Body != IntPtr.Zero && !m_disabled && !m_isSelected && !m_building && !m_outbounds) { - if (!SafeNativeMethods.BodyIsEnabled(Body)) + if (!UBOdeNative.BodyIsEnabled(Body)) { // let vehicles sleep if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) @@ -3630,11 +3630,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde return; // clear residuals - SafeNativeMethods.BodySetAngularVel(Body,0f,0f,0f); - SafeNativeMethods.BodySetLinearVel(Body,0f,0f,0f); + UBOdeNative.BodySetAngularVel(Body,0f,0f,0f); + UBOdeNative.BodySetLinearVel(Body,0f,0f,0f); _zeroFlag = true; - SafeNativeMethods.BodySetAutoDisableSteps(Body, 1); - SafeNativeMethods.BodyEnable(Body); + UBOdeNative.BodySetAutoDisableSteps(Body, 1); + UBOdeNative.BodyEnable(Body); m_bodydisablecontrol = -3; } @@ -3652,7 +3652,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde float fy = 0; float fz = 0; - Vector3 lpos = SafeNativeMethods.GeomGetPositionOMV(m_prim_geom); // root position that is seem by rest of simulator + Vector3 lpos = UBOdeNative.GeomGetPositionOMV(m_prim_geom); // root position that is seem by rest of simulator if (m_usePID && m_PIDTau > 0) { @@ -3660,8 +3660,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde _target_velocity = m_PIDTarget - lpos; if (_target_velocity.ApproxZero(0.02f)) { - SafeNativeMethods.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); + UBOdeNative.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); + UBOdeNative.BodySetLinearVel(Body, 0, 0, 0); return; } else @@ -3684,7 +3684,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde _target_velocity *= tmp; } - SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); + UBOdeNative.Vector3 vel = UBOdeNative.BodyGetLinearVel(Body); fx = (_target_velocity.X - vel.X) * m_sceneInverseTimeStep; fy = (_target_velocity.Y - vel.Y) * m_sceneInverseTimeStep; fz = (_target_velocity.Z - vel.Z) * m_sceneInverseTimeStep; @@ -3719,15 +3719,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_targetHoverHeight > groundHeight || m_isVolumeDetect) { - SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body); + UBOdeNative.Vector3 vel = UBOdeNative.BodyGetLinearVel(Body); fz = (m_targetHoverHeight - lpos.Z); // if error is zero, use position control; otherwise, velocity control if (MathF.Abs(fz) < 0.01f) { - SafeNativeMethods.BodySetPosition(Body, lpos.X, lpos.Y, m_targetHoverHeight); - SafeNativeMethods.BodySetLinearVel(Body, vel.X, vel.Y, 0); + UBOdeNative.BodySetPosition(Body, lpos.X, lpos.Y, m_targetHoverHeight); + UBOdeNative.BodySetLinearVel(Body, vel.X, vel.Y, 0); } else { @@ -3771,7 +3771,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); if (fz != 0 || fx != 0 || fy != 0) { - SafeNativeMethods.BodyAddForce(Body, fx, fy, fz); + UBOdeNative.BodyAddForce(Body, fx, fy, fz); //Console.WriteLine("AddForce " + fx + "," + fy + "," + fz); } @@ -3779,7 +3779,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_angularForceacc = Vector3.Zero; if (trq.X != 0 || trq.Y != 0 || trq.Z != 0) { - SafeNativeMethods.BodyAddTorque(Body, trq.X, trq.Y, trq.Z); + UBOdeNative.BodyAddTorque(Body, trq.X, trq.Y, trq.Z); } } else @@ -3796,12 +3796,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde if(m_bodydisablecontrol < 0) return; - bool bodyenabled = SafeNativeMethods.BodyIsEnabled(Body); + bool bodyenabled = UBOdeNative.BodyIsEnabled(Body); if (bodyenabled || !_zeroFlag) { bool lastZeroFlag = _zeroFlag; - Vector3 lpos = SafeNativeMethods.GeomGetPositionOMV(m_prim_geom); + Vector3 lpos = UBOdeNative.GeomGetPositionOMV(m_prim_geom); // check outside region if (lpos.Z < -100 || lpos.Z > 100000f) @@ -3813,9 +3813,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde _velocity = Vector3.Zero; m_rotationalVelocity = Vector3.Zero; - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it - SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); // stop it - SafeNativeMethods.BodySetPosition(Body, lpos.X, lpos.Y, lpos.Z); // put it somewhere + UBOdeNative.BodySetLinearVel(Body, 0, 0, 0); // stop it + UBOdeNative.BodySetAngularVel(Body, 0, 0, 0); // stop it + UBOdeNative.BodySetPosition(Body, lpos.X, lpos.Y, lpos.Z); // put it somewhere m_lastposition = m_position; m_lastorientation = m_orientation; @@ -3855,12 +3855,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_lastposition = m_position; m_lastorientation = m_orientation; - _velocity = SafeNativeMethods.BodyGetLinearVelOMV(Body); - m_rotationalVelocity = SafeNativeMethods.BodyGetAngularVelOMV(Body); + _velocity = UBOdeNative.BodyGetLinearVelOMV(Body); + m_rotationalVelocity = UBOdeNative.BodyGetAngularVelOMV(Body); - SafeNativeMethods.BodySetLinearVel(Body, 0, 0, 0); // stop it - SafeNativeMethods.BodySetAngularVel(Body, 0, 0, 0); - SafeNativeMethods.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); + UBOdeNative.BodySetLinearVel(Body, 0, 0, 0); // stop it + UBOdeNative.BodySetAngularVel(Body, 0, 0, 0); + UBOdeNative.GeomSetPosition(m_prim_geom, m_position.X, m_position.Y, m_position.Z); disableBodySoft(); // stop collisions UnSubscribeEvents(); @@ -3868,7 +3868,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde return; } - Quaternion ori = SafeNativeMethods.GeomGetQuaternionOMV(m_prim_geom); + Quaternion ori = UBOdeNative.GeomGetQuaternionOMV(m_prim_geom); // decide if moving // use positions since this are integrated quantities @@ -3923,7 +3923,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde } else { - Vector3 vel = SafeNativeMethods.BodyGetLinearVelOMV(Body); + Vector3 vel = UBOdeNative.BodyGetLinearVelOMV(Body); m_acceleration = _velocity; if (vel.ApproxZero(0.005f)) { @@ -3942,7 +3942,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_acceleration = Vector3.Zero; } - vel = SafeNativeMethods.BodyGetAngularVelOMV(Body); + vel = UBOdeNative.BodyGetAngularVelOMV(Body); if (vel.ApproxZero(0.0001f)) { m_rotationalVelocity = Vector3.Zero; @@ -3984,7 +3984,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde return true; } - internal static void DMassSubPartFromObj(ref SafeNativeMethods.Mass part, ref SafeNativeMethods.Mass theobj) + internal static void DMassSubPartFromObj(ref UBOdeNative.Mass part, ref UBOdeNative.Mass theobj) { // assumes object center of mass is zero float smass = part.mass; diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs index 40fa5d1328..9fd5593bed 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODERayCastRequestManager.cs @@ -54,7 +54,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde /// Scene that created this object. /// private readonly ODEScene m_scene; - private readonly SafeNativeMethods.ContactGeom[] m_contacts; + private readonly UBOdeNative.ContactGeom[] m_contacts; IntPtr ray; // the ray. we only need one for our lifetime @@ -66,7 +66,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde /// /// ODE near callback delegate /// - private readonly SafeNativeMethods.NearCallback nearCallback; + private readonly UBOdeNative.NearCallback nearCallback; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly List m_contactResults = new(ResultsMaxCount); private readonly object m_contactResultsLock = new(); @@ -79,8 +79,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_scene = pScene; m_contacts = pScene.m_contacts; nearCallback = near; - ray = SafeNativeMethods.CreateRay(IntPtr.Zero, 1.0f); - SafeNativeMethods.GeomSetCategoryBits(ray, 0); + ray = UBOdeNative.CreateRay(IntPtr.Zero, 1.0f); + UBOdeNative.GeomSetCategoryBits(ray, 0); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -135,22 +135,22 @@ namespace OpenSim.Region.PhysicsModule.ubOde unchecked { CollisionContactGeomsPerTest = ((CurrentRayFilter & RayFilterFlags.ContactsUnImportant) != 0) ? - CurrentMaxCount | (int)SafeNativeMethods.CONTACTS_UNIMPORTANT : CurrentMaxCount; + CurrentMaxCount | (int)UBOdeNative.CONTACTS_UNIMPORTANT : CurrentMaxCount; } int backfacecull = ((CurrentRayFilter & RayFilterFlags.BackFaceCull) == 0 ? 0 : 1); - SafeNativeMethods.GeomRaySetParams(ray, 0, backfacecull); + UBOdeNative.GeomRaySetParams(ray, 0, backfacecull); if (req.callbackMethod is RaycastCallback) { // if we only want one get only one per Collision pair saving memory CurrentRayFilter |= RayFilterFlags.ClosestHit; - SafeNativeMethods.GeomRaySetClosestHit(ray, 1); + UBOdeNative.GeomRaySetClosestHit(ray, 1); } else { int closestHit = ((CurrentRayFilter & RayFilterFlags.ClosestHit) == 0 ? 0 : 1); - SafeNativeMethods.GeomRaySetClosestHit(ray, closestHit); + UBOdeNative.GeomRaySetClosestHit(ray, closestHit); } if (geom == IntPtr.Zero) @@ -170,14 +170,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (catflags != 0) { - SafeNativeMethods.GeomSetCollideBits(ray, (uint)catflags); + UBOdeNative.GeomSetCollideBits(ray, (uint)catflags); doSpaceRay(req); } } else { // if we select a geom don't use filters - SafeNativeMethods.GeomSetCollideBits(ray, (uint)CollisionCategories.All); + UBOdeNative.GeomSetCollideBits(ray, (uint)CollisionCategories.All); doGeomRay(req,geom); } @@ -210,12 +210,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde [MethodImpl(MethodImplOptions.AggressiveInlining)] private void doSpaceRay(ODERayRequest req) { - SafeNativeMethods.GeomRaySetLength(ray, req.length); - SafeNativeMethods.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); + UBOdeNative.GeomRaySetLength(ray, req.length); + UBOdeNative.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); // Collide tests if ((CurrentRayFilter & FilterActiveSpace) != 0) - SafeNativeMethods.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); + UBOdeNative.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); if ((CurrentRayFilter & RayFilterFlags.agent) != 0) { @@ -233,7 +233,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde } if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) - SafeNativeMethods.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); + UBOdeNative.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) { @@ -247,7 +247,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { float tmp2 = req.length * req.length - tmp + 2500; tmp2 = (float)Math.Sqrt(tmp2); - SafeNativeMethods.GeomRaySetLength(ray, tmp2); + UBOdeNative.GeomRaySetLength(ray, tmp2); } } CollideRayTerrain(m_scene.TerrainGeom); @@ -301,11 +301,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde [MethodImpl(MethodImplOptions.AggressiveInlining)] private void doGeomRay(ODERayRequest req, IntPtr geom) { - SafeNativeMethods.GeomRaySetLength(ray, req.length); - SafeNativeMethods.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); + UBOdeNative.GeomRaySetLength(ray, req.length); + UBOdeNative.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z); // Collide test - SafeNativeMethods.SpaceCollide2(ray, geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test + UBOdeNative.SpaceCollide2(ray, geom, IntPtr.Zero, nearCallback); // still do this to have full AABB pre test if (req.callbackMethod is RaycastCallback callback) { @@ -358,11 +358,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (m_contactResults.Count >= CurrentMaxCount) return; - if (SafeNativeMethods.GeomIsSpace(g2)) + if (UBOdeNative.GeomIsSpace(g2)) { try { - SafeNativeMethods.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); + UBOdeNative.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback); } catch (Exception e) { @@ -374,7 +374,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde int count; try { - count = SafeNativeMethods.CollidePtr(g1, g2, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, SafeNativeMethods.SizeOfContactGeom); + count = UBOdeNative.CollidePtr(g1, g2, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, UBOdeNative.SizeOfContactGeom); } catch (Exception e) { @@ -409,14 +409,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde // Loop all contacts, build results. for (int i = 0; i < count; ++i) { - ref SafeNativeMethods.ContactGeom curCtg = ref m_contacts[i]; + ref UBOdeNative.ContactGeom curCtg = ref m_contacts[i]; lock (m_contactResultsLock) { m_contactResults.Add(new ContactResult { ConsumerID = ID, - Pos = Unsafe.As(ref curCtg.pos), - Normal = Unsafe.As(ref curCtg.normal), + Pos = Unsafe.As(ref curCtg.pos), + Normal = Unsafe.As(ref curCtg.normal), Depth = curCtg.depth }); if (m_contactResults.Count >= CurrentMaxCount) @@ -427,9 +427,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde else { // keep only closest contact - ref SafeNativeMethods.ContactGeom curCtg = ref m_contacts[0]; - SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); - SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); + ref UBOdeNative.ContactGeom curCtg = ref m_contacts[0]; + SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); + SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); float depth = curCtg.depth; SharedCollisionResult.Depth = depth; @@ -438,8 +438,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde curCtg = ref m_contacts[i]; if (curCtg.depth < depth) { - SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); - SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); + SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); + SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); depth = curCtg.depth; SharedCollisionResult.Depth = depth; } @@ -457,7 +457,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde int count; try { - count = SafeNativeMethods.CollidePtr(ray, chr.collider, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, SafeNativeMethods.SizeOfContactGeom); + count = UBOdeNative.CollidePtr(ray, chr.collider, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, UBOdeNative.SizeOfContactGeom); if (count == 0) return; } @@ -474,14 +474,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde // Loop all contacts, build results. for (int i = 0; i < count; i++) { - ref SafeNativeMethods.ContactGeom curCtg = ref m_contacts[i]; + ref UBOdeNative.ContactGeom curCtg = ref m_contacts[i]; lock (m_contactResultsLock) { m_contactResults.Add(new ContactResult { ConsumerID = id, - Pos = Unsafe.As(ref curCtg.pos), - Normal = Unsafe.As(ref curCtg.normal), + Pos = Unsafe.As(ref curCtg.pos), + Normal = Unsafe.As(ref curCtg.normal), Depth = curCtg.depth }); if (m_contactResults.Count >= CurrentMaxCount) @@ -492,9 +492,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde else { // keep only closest contact - ref SafeNativeMethods.ContactGeom curCtg = ref m_contacts[0]; - SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); - SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); + ref UBOdeNative.ContactGeom curCtg = ref m_contacts[0]; + SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); + SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); float depth = curCtg.depth; SharedCollisionResult.Depth = depth; @@ -503,8 +503,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde curCtg = ref m_contacts[i]; if (curCtg.depth < depth) { - SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); - SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); + SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); + SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); depth = curCtg.depth; SharedCollisionResult.Depth = depth; } @@ -525,7 +525,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde int count; try { - count = SafeNativeMethods.CollidePtr(ray, terrain, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, SafeNativeMethods.SizeOfContactGeom); + count = UBOdeNative.CollidePtr(ray, terrain, CollisionContactGeomsPerTest, m_scene.ContactgeomsArray, UBOdeNative.SizeOfContactGeom); if (count == 0) return; } @@ -541,14 +541,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde // Loop all contacts, build results. for (int i = 0; i < count; i++) { - ref SafeNativeMethods.ContactGeom curCtg = ref m_contacts[i]; + ref UBOdeNative.ContactGeom curCtg = ref m_contacts[i]; lock (m_contactResultsLock) { m_contactResults.Add(new ContactResult { ConsumerID = 0, - Pos = Unsafe.As(ref curCtg.pos), - Normal = Unsafe.As(ref curCtg.normal), + Pos = Unsafe.As(ref curCtg.pos), + Normal = Unsafe.As(ref curCtg.normal), Depth = curCtg.depth }); if (m_contactResults.Count >= CurrentMaxCount) @@ -559,9 +559,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde else { // keep only closest contact - ref SafeNativeMethods.ContactGeom curCtg = ref m_contacts[0]; - SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); - SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); + ref UBOdeNative.ContactGeom curCtg = ref m_contacts[0]; + SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); + SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); float depth = curCtg.depth; SharedCollisionResult.Depth = depth; @@ -570,8 +570,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde curCtg = ref m_contacts[i]; if (curCtg.depth < depth) { - SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); - SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); + SharedCollisionResult.Pos = Unsafe.As(ref curCtg.pos); + SharedCollisionResult.Normal = Unsafe.As(ref curCtg.normal); depth = curCtg.depth; SharedCollisionResult.Depth = depth; } @@ -590,7 +590,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if (ray != IntPtr.Zero) { - SafeNativeMethods.GeomDestroy(ray); + UBOdeNative.GeomDestroy(ray); ray = IntPtr.Zero; } } diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index e16f68ad08..2535355287 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -171,7 +171,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde //private int threadid = 0; - const SafeNativeMethods.ContactFlags commomContactFlags = SafeNativeMethods.ContactFlags.Bounce | SafeNativeMethods.ContactFlags.Approx1; + const UBOdeNative.ContactFlags commomContactFlags = UBOdeNative.ContactFlags.Bounce | UBOdeNative.ContactFlags.Approx1; const float commomContactERP = 0.75f; const float commonContactCFM = 0.0001f; const float commomContactSLIP = 0f; @@ -220,7 +220,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde public int bodyFramesAutoDisable = 10; - private SafeNativeMethods.NearCallback NearCallback; + private UBOdeNative.NearCallback NearCallback; private readonly Dictionary _prims = new(); private readonly HashSet _characters = new(); @@ -243,12 +243,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde private readonly int contactsPerCollision = 80; internal IntPtr ContactgeomsArray = IntPtr.Zero; - internal SafeNativeMethods.ContactGeom[] m_contacts; + internal UBOdeNative.ContactGeom[] m_contacts; internal GCHandle m_contactsHandler; private IntPtr GlobalContactsArray; - private SafeNativeMethods.Contact contactSharedForJoints = new(); + private UBOdeNative.Contact contactSharedForJoints = new(); const int maxContactJoints = 6000; private volatile int ContactJointCount = 0; @@ -340,7 +340,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde /// private void Initialization() { - SafeNativeMethods.AllocateODEDataForThread(~0U); + UBOdeNative.AllocateODEDataForThread(~0U); NearCallback = DefaultNearCallback; @@ -356,12 +356,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde // Create the world and the first space try { - world = SafeNativeMethods.WorldCreate(); - TopSpace = SafeNativeMethods.SimpleSpaceCreate(IntPtr.Zero); - ActiveSpace = SafeNativeMethods.SimpleSpaceCreate(TopSpace); + world = UBOdeNative.WorldCreate(); + TopSpace = UBOdeNative.SimpleSpaceCreate(IntPtr.Zero); + ActiveSpace = UBOdeNative.SimpleSpaceCreate(TopSpace); float sx = m_regionWidth + 16; float sy = m_regionHeight + 16; - SafeNativeMethods.Vector3 px = new(sx * 0.5f, sy * 0.5f, 0); + UBOdeNative.Vector3 px = new(sx * 0.5f, sy * 0.5f, 0); if (sx < sy) sx = sy; int dp = Util.intLog2((uint)sx); @@ -369,42 +369,42 @@ namespace OpenSim.Region.PhysicsModule.ubOde dp = 8; else if(dp < 4) dp = 4; - StaticSpace = SafeNativeMethods.QuadTreeSpaceCreate(TopSpace, ref px, ref px, dp); + StaticSpace = UBOdeNative.QuadTreeSpaceCreate(TopSpace, ref px, ref px, dp); } catch { } // move to high level - SafeNativeMethods.SpaceSetSublevel(ActiveSpace, 1); - SafeNativeMethods.SpaceSetSublevel(StaticSpace, 1); + UBOdeNative.SpaceSetSublevel(ActiveSpace, 1); + UBOdeNative.SpaceSetSublevel(StaticSpace, 1); - SafeNativeMethods.GeomSetCategoryBits(ActiveSpace, (uint)(CollisionCategories.Space | + UBOdeNative.GeomSetCategoryBits(ActiveSpace, (uint)(CollisionCategories.Space | CollisionCategories.Geom | CollisionCategories.Character | CollisionCategories.Phantom | CollisionCategories.VolumeDtc )); - SafeNativeMethods.GeomSetCollideBits(ActiveSpace, (uint)(CollisionCategories.Space | + UBOdeNative.GeomSetCollideBits(ActiveSpace, (uint)(CollisionCategories.Space | CollisionCategories.Geom | CollisionCategories.Character | CollisionCategories.Phantom | CollisionCategories.VolumeDtc )); - SafeNativeMethods.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space | + UBOdeNative.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space | CollisionCategories.Geom | //CollisionCategories.Land | //CollisionCategories.Water | CollisionCategories.Phantom | CollisionCategories.VolumeDtc )); - SafeNativeMethods.GeomSetCollideBits(StaticSpace, 0); + UBOdeNative.GeomSetCollideBits(StaticSpace, 0); - JointContactGroup = SafeNativeMethods.JointGroupCreate(maxContactJoints + 1); + JointContactGroup = UBOdeNative.JointGroupCreate(maxContactJoints + 1); //contactgroup - SafeNativeMethods.WorldSetAutoDisableFlag(world, false); + UBOdeNative.WorldSetAutoDisableFlag(world, false); } @@ -450,30 +450,30 @@ namespace OpenSim.Region.PhysicsModule.ubOde maximumAngularVelocity = 0.49f * heartbeat *(float)Math.PI; maxAngVelocitySQ = maximumAngularVelocity * maximumAngularVelocity; - SafeNativeMethods.WorldSetCFM(world, commonContactCFM); - SafeNativeMethods.WorldSetERP(world, commomContactERP); + UBOdeNative.WorldSetCFM(world, commonContactCFM); + UBOdeNative.WorldSetERP(world, commomContactERP); - SafeNativeMethods.WorldSetGravity(world, gravityx, gravityy, gravityz); + UBOdeNative.WorldSetGravity(world, gravityx, gravityy, gravityz); - SafeNativeMethods.WorldSetLinearDamping(world, 0.001f); - SafeNativeMethods.WorldSetAngularDamping(world, 0.002f); - SafeNativeMethods.WorldSetAngularDampingThreshold(world, 0f); - SafeNativeMethods.WorldSetLinearDampingThreshold(world, 0f); - SafeNativeMethods.WorldSetMaxAngularSpeed(world, maximumAngularVelocity); + UBOdeNative.WorldSetLinearDamping(world, 0.001f); + UBOdeNative.WorldSetAngularDamping(world, 0.002f); + UBOdeNative.WorldSetAngularDampingThreshold(world, 0f); + UBOdeNative.WorldSetLinearDampingThreshold(world, 0f); + UBOdeNative.WorldSetMaxAngularSpeed(world, maximumAngularVelocity); - SafeNativeMethods.WorldSetQuickStepNumIterations(world, m_physicsiterations); + UBOdeNative.WorldSetQuickStepNumIterations(world, m_physicsiterations); - SafeNativeMethods.WorldSetContactSurfaceLayer(world, contactsurfacelayer); - SafeNativeMethods.WorldSetContactMaxCorrectingVel(world, 60.0f); + UBOdeNative.WorldSetContactSurfaceLayer(world, contactsurfacelayer); + UBOdeNative.WorldSetContactMaxCorrectingVel(world, 60.0f); HalfOdeStep = ODE_STEPSIZE * 0.5f; odetimestepMS = (int)(1000.0f * ODE_STEPSIZE + 0.5f); - m_contacts = new SafeNativeMethods.ContactGeom[contactsPerCollision]; + m_contacts = new UBOdeNative.ContactGeom[contactsPerCollision]; m_contactsHandler = GCHandle.Alloc(m_contacts, GCHandleType.Pinned); ContactgeomsArray = m_contactsHandler.AddrOfPinnedObject(); - GlobalContactsArray = Marshal.AllocHGlobal((maxContactJoints + 100) * SafeNativeMethods.SizeOfContact); + GlobalContactsArray = Marshal.AllocHGlobal((maxContactJoints + 100) * UBOdeNative.SizeOfContact); contactSharedForJoints.geom.g1 = IntPtr.Zero; contactSharedForJoints.geom.g2 = IntPtr.Zero; @@ -535,7 +535,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde #region Collision Detection [MethodImpl(MethodImplOptions.AggressiveInlining)] - private IntPtr CreateContacJoint(ref SafeNativeMethods.ContactGeom contactGeom, bool smooth) + private IntPtr CreateContacJoint(ref UBOdeNative.ContactGeom contactGeom, bool smooth) { if (ContactJointCount >= maxContactJoints) return IntPtr.Zero; @@ -545,9 +545,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde contactSharedForJoints.geom.pos = contactGeom.pos; contactSharedForJoints.geom.normal = contactGeom.normal; - IntPtr contact = new(GlobalContactsArray.ToInt64() + (Int64)(ContactJointCount * SafeNativeMethods.SizeOfContact)); + IntPtr contact = new(GlobalContactsArray.ToInt64() + (Int64)(ContactJointCount * UBOdeNative.SizeOfContact)); Marshal.StructureToPtr(contactSharedForJoints, contact, false); - return SafeNativeMethods.JointCreateContactPtr(world, JointContactGroup, contact); + return UBOdeNative.JointCreateContactPtr(world, JointContactGroup, contact); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -555,12 +555,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde { ContactJointCount++; - IntPtr contact = new(GlobalContactsArray.ToInt64() + (Int64)(ContactJointCount * SafeNativeMethods.SizeOfContact)); + IntPtr contact = new(GlobalContactsArray.ToInt64() + (Int64)(ContactJointCount * UBOdeNative.SizeOfContact)); Marshal.StructureToPtr(contactSharedForJoints, contact, false); - return SafeNativeMethods.JointCreateContactPtr(world, JointContactGroup, contact); + return UBOdeNative.JointCreateContactPtr(world, JointContactGroup, contact); } - SafeNativeMethods.ContactGeom altWorkContact = new(); + UBOdeNative.ContactGeom altWorkContact = new(); /// /// This is our near callback. A geometry is near a body @@ -580,14 +580,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (g1 == IntPtr.Zero || g2 == IntPtr.Zero) return; - if (SafeNativeMethods.GeomIsSpace(g1) || SafeNativeMethods.GeomIsSpace(g2)) + if (UBOdeNative.GeomIsSpace(g1) || UBOdeNative.GeomIsSpace(g2)) { // We'll be calling near recursivly if one // of them is a space to find all of the // contact points in the space try { - SafeNativeMethods.SpaceCollide2(g1, g2, IntPtr.Zero, DefaultNearCallback); + UBOdeNative.SpaceCollide2(g1, g2, IntPtr.Zero, DefaultNearCallback); } catch (AccessViolationException) { @@ -603,14 +603,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde int count = 0; try { - if (SafeNativeMethods.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || - SafeNativeMethods.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) + if (UBOdeNative.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || + UBOdeNative.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) { - int cflags = unchecked((int)(1 | SafeNativeMethods.CONTACTS_UNIMPORTANT)); - count = SafeNativeMethods.CollidePtr(g1, g2, cflags, ContactgeomsArray, SafeNativeMethods.SizeOfContactGeom); + int cflags = unchecked((int)(1 | UBOdeNative.CONTACTS_UNIMPORTANT)); + count = UBOdeNative.CollidePtr(g1, g2, cflags, ContactgeomsArray, UBOdeNative.SizeOfContactGeom); } else - count = SafeNativeMethods.CollidePtr(g1, g2, contactsPerCollision, ContactgeomsArray, SafeNativeMethods.SizeOfContactGeom); + count = UBOdeNative.CollidePtr(g1, g2, contactsPerCollision, ContactgeomsArray, UBOdeNative.SizeOfContactGeom); } catch (SEHException) { @@ -644,7 +644,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde // do volume detection case if ((p1.IsVolumeDtc || p2.IsVolumeDtc)) { - ref SafeNativeMethods.ContactGeom curctc0 = ref m_contacts[0]; + ref UBOdeNative.ContactGeom curctc0 = ref m_contacts[0]; ContactPoint volDepthContact = new( new Vector3(curctc0.pos.X, curctc0.pos.Y, curctc0.pos.Z), new Vector3(curctc0.normal.X, curctc0.normal.Y, curctc0.normal.Z), @@ -710,8 +710,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde //if (relVlenSQ > 0.01f) // mu *= frictionMovementMult; - if (SafeNativeMethods.GeomGetClass(g2) == SafeNativeMethods.GeomClassID.TriMeshClass && - SafeNativeMethods.GeomGetClass(g1) == SafeNativeMethods.GeomClassID.TriMeshClass) + if (UBOdeNative.GeomGetClass(g2) == UBOdeNative.GeomClassID.TriMeshClass && + UBOdeNative.GeomGetClass(g1) == UBOdeNative.GeomClassID.TriMeshClass) smoothMesh = true; break; @@ -725,7 +725,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde // mu *= frictionMovementMult; p1.CollidingGround = true; - if (SafeNativeMethods.GeomGetClass(g1) == SafeNativeMethods.GeomClassID.TriMeshClass) + if (UBOdeNative.GeomGetClass(g1) == UBOdeNative.GeomClassID.TriMeshClass) smoothMesh = true; break; @@ -751,7 +751,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde //if (Math.Abs(v2.X) > 0.1f || Math.Abs(v2.Y) > 0.1f) // mu *= frictionMovementMult; - if (SafeNativeMethods.GeomGetClass(g2) == SafeNativeMethods.GeomClassID.TriMeshClass) + if (UBOdeNative.GeomGetClass(g2) == UBOdeNative.GeomClassID.TriMeshClass) smoothMesh = true; } else @@ -784,12 +784,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (dop1ava || dop2ava) smoothMesh = false; - IntPtr b1 = SafeNativeMethods.GeomGetBody(g1); - IntPtr b2 = SafeNativeMethods.GeomGetBody(g2); + IntPtr b1 = UBOdeNative.GeomGetBody(g1); + IntPtr b2 = UBOdeNative.GeomGetBody(g2); for (int i = 0; i < count; ++i) { - ref SafeNativeMethods.ContactGeom curctc = ref m_contacts[i]; + ref UBOdeNative.ContactGeom curctc = ref m_contacts[i]; noskip = true; useAltcontact = false; @@ -832,7 +832,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Joint == IntPtr.Zero) break; - SafeNativeMethods.JointAttach(Joint, b1, b2); + UBOdeNative.JointAttach(Joint, b1, b2); ncontacts++; @@ -840,14 +840,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde { maxDepth = curctc.depth; maxDepthContact.PenetrationDepth = maxDepth; - maxDepthContact.Position = Unsafe.As(ref curctc.pos); + maxDepthContact.Position = Unsafe.As(ref curctc.pos); maxDepthContact.CharacterFeet = FeetCollision; } if (curctc.depth < minDepth) { minDepth = curctc.depth; - maxDepthContact.SurfaceNormal = Unsafe.As(ref curctc.normal); + maxDepthContact.SurfaceNormal = Unsafe.As(ref curctc.normal); } } } @@ -870,14 +870,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde return; //if (SafeNativeMethods.GeomIsSpace(g1) || SafeNativeMethods.GeomIsSpace(g2)) - if (SafeNativeMethods.GeomIsSpace(g2)) + if (UBOdeNative.GeomIsSpace(g2)) { // We'll be calling near recursivly if one // of them is a space to find all of the // contact points in the space try { - SafeNativeMethods.SpaceCollide2(g1, g2, IntPtr.Zero, CharPrimNearCallback); + UBOdeNative.SpaceCollide2(g1, g2, IntPtr.Zero, CharPrimNearCallback); } catch (AccessViolationException) { @@ -890,13 +890,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde int count = 0; try { - if (SafeNativeMethods.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) + if (UBOdeNative.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) { - int cflags = unchecked((int)(1 | SafeNativeMethods.CONTACTS_UNIMPORTANT)); - count = SafeNativeMethods.CollidePtr(g1, g2, cflags, ContactgeomsArray, SafeNativeMethods.SizeOfContactGeom); + int cflags = unchecked((int)(1 | UBOdeNative.CONTACTS_UNIMPORTANT)); + count = UBOdeNative.CollidePtr(g1, g2, cflags, ContactgeomsArray, UBOdeNative.SizeOfContactGeom); } else - count = SafeNativeMethods.CollidePtr(g1, g2, contactsPerCollision, ContactgeomsArray, SafeNativeMethods.SizeOfContactGeom); + count = UBOdeNative.CollidePtr(g1, g2, contactsPerCollision, ContactgeomsArray, UBOdeNative.SizeOfContactGeom); } catch (SEHException) { @@ -930,7 +930,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde // do volume detection case if (p2.IsVolumeDtc) { - ref SafeNativeMethods.ContactGeom curctc0 = ref m_contacts[0]; + ref UBOdeNative.ContactGeom curctc0 = ref m_contacts[0]; ContactPoint volDepthContact = new( new Vector3(curctc0.pos.X, curctc0.pos.Y, curctc0.pos.Z), new Vector3(curctc0.normal.X, curctc0.normal.Y, curctc0.normal.Z), @@ -958,12 +958,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde bool useAltcontact; - IntPtr b1 = SafeNativeMethods.GeomGetBody(g1); - IntPtr b2 = SafeNativeMethods.GeomGetBody(g2); + IntPtr b1 = UBOdeNative.GeomGetBody(g1); + IntPtr b2 = UBOdeNative.GeomGetBody(g2); for (int i = 0; i < count; ++i) { - ref SafeNativeMethods.ContactGeom curctc = ref m_contacts[i]; + ref UBOdeNative.ContactGeom curctc = ref m_contacts[i]; useAltcontact = false; if ((((OdeCharacter)p1).Collide(g2, false, ref curctc, ref altWorkContact, ref useAltcontact, ref FeetCollision))) @@ -977,7 +977,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (Joint == IntPtr.Zero) break; - SafeNativeMethods.JointAttach(Joint, b1, b2); + UBOdeNative.JointAttach(Joint, b1, b2); ncontacts++; @@ -985,14 +985,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde { maxDepth = curctc.depth; accountContact.PenetrationDepth = maxDepth; - accountContact.Position = Unsafe.As(ref curctc.pos); + accountContact.Position = Unsafe.As(ref curctc.pos); accountContact.CharacterFeet = FeetCollision; } if (curctc.depth < minDepth) { minDepth = curctc.depth; - accountContact.SurfaceNormal = Unsafe.As(ref curctc.normal); + accountContact.SurfaceNormal = Unsafe.As(ref curctc.normal); } } } @@ -1113,8 +1113,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde chr.IsColliding = false; chr.CollidingObj = false; - SafeNativeMethods.SpaceCollide2(chr.collider, StaticSpace, IntPtr.Zero, CharPrimNearCallback); - SafeNativeMethods.SpaceCollide2(chr.collider, ActiveSpace, IntPtr.Zero, CharPrimNearCallback); + UBOdeNative.SpaceCollide2(chr.collider, StaticSpace, IntPtr.Zero, CharPrimNearCallback); + UBOdeNative.SpaceCollide2(chr.collider, ActiveSpace, IntPtr.Zero, CharPrimNearCallback); } } else @@ -1131,8 +1131,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde chr.CollidingObj = false; // do colisions with static space - SafeNativeMethods.SpaceCollide2(chr.collider, StaticSpace, IntPtr.Zero, CharPrimNearCallback); - SafeNativeMethods.SpaceCollide2(chr.collider, ActiveSpace, IntPtr.Zero, CharPrimNearCallback); + UBOdeNative.SpaceCollide2(chr.collider, StaticSpace, IntPtr.Zero, CharPrimNearCallback); + UBOdeNative.SpaceCollide2(chr.collider, ActiveSpace, IntPtr.Zero, CharPrimNearCallback); float mx = chr._AABB2D.minx; float Mx = chr._AABB2D.maxx; @@ -1175,7 +1175,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { aprim.CollisionScore = 0; aprim.IsColliding = false; - if(!aprim.m_outbounds && SafeNativeMethods.BodyIsEnabled(aprim.Body)) + if(!aprim.m_outbounds && UBOdeNative.BodyIsEnabled(aprim.Body)) aprim.clearSleeperCollisions(); } } @@ -1186,11 +1186,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde { foreach (OdePrim aprim in _activegroups) { - if(!aprim.m_outbounds && SafeNativeMethods.BodyIsEnabled(aprim.Body) && + if(!aprim.m_outbounds && UBOdeNative.BodyIsEnabled(aprim.Body) && aprim.m_collide_geom != IntPtr.Zero) { - SafeNativeMethods.SpaceCollide2(StaticSpace, aprim.m_collide_geom, IntPtr.Zero, NearCallback); - SafeNativeMethods.SpaceCollide2(TerrainGeom, aprim.m_collide_geom, IntPtr.Zero, NearCallback); + UBOdeNative.SpaceCollide2(StaticSpace, aprim.m_collide_geom, IntPtr.Zero, NearCallback); + UBOdeNative.SpaceCollide2(TerrainGeom, aprim.m_collide_geom, IntPtr.Zero, NearCallback); } } } @@ -1202,7 +1202,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde // colide active amoung them try { - SafeNativeMethods.SpaceCollide(ActiveSpace, IntPtr.Zero, NearCallback); + UBOdeNative.SpaceCollide(ActiveSpace, IntPtr.Zero, NearCallback); } catch (Exception e) { @@ -1483,16 +1483,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde return StaticSpace; // else remove it from its current space - if (currentspace != IntPtr.Zero && SafeNativeMethods.SpaceQuery(currentspace, geom)) + if (currentspace != IntPtr.Zero && UBOdeNative.SpaceQuery(currentspace, geom)) { - if (SafeNativeMethods.GeomIsSpace(currentspace)) + if (UBOdeNative.GeomIsSpace(currentspace)) { //waitForSpaceUnlock(currentspace); - SafeNativeMethods.SpaceRemove(currentspace, geom); + UBOdeNative.SpaceRemove(currentspace, geom); - if (SafeNativeMethods.SpaceGetSublevel(currentspace) == 0 && SafeNativeMethods.SpaceGetNumGeoms(currentspace) == 0) + if (UBOdeNative.SpaceGetSublevel(currentspace) == 0 && UBOdeNative.SpaceGetNumGeoms(currentspace) == 0) { - SafeNativeMethods.SpaceDestroy(currentspace); + UBOdeNative.SpaceDestroy(currentspace); } } else @@ -1503,17 +1503,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde } else { - currentspace = SafeNativeMethods.GeomGetSpace(geom); + currentspace = UBOdeNative.GeomGetSpace(geom); if (currentspace != IntPtr.Zero) { - if (SafeNativeMethods.GeomIsSpace(currentspace)) + if (UBOdeNative.GeomIsSpace(currentspace)) { //waitForSpaceUnlock(currentspace); - SafeNativeMethods.SpaceRemove(currentspace, geom); + UBOdeNative.SpaceRemove(currentspace, geom); - if (SafeNativeMethods.SpaceGetSublevel(currentspace) == 0 && SafeNativeMethods.SpaceGetNumGeoms(currentspace) == 0) + if (UBOdeNative.SpaceGetSublevel(currentspace) == 0 && UBOdeNative.SpaceGetNumGeoms(currentspace) == 0) { - SafeNativeMethods.SpaceDestroy(currentspace); + UBOdeNative.SpaceDestroy(currentspace); } } } @@ -1521,10 +1521,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde // put the geom in the newspace //waitForSpaceUnlock(StaticSpace); - if(SafeNativeMethods.SpaceQuery(StaticSpace, geom)) + if(UBOdeNative.SpaceQuery(StaticSpace, geom)) m_log.Info("[Physics]: 'MoveGeomToStaticSpace' geom already in static space:" + geom); else - SafeNativeMethods.SpaceAdd(StaticSpace, geom); + UBOdeNative.SpaceAdd(StaticSpace, geom); return StaticSpace; } @@ -1573,7 +1573,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_log.InfoFormat("[ubOde] start processing pending actor operations"); int tstart = Util.EnvironmentTickCount(); - SafeNativeMethods.AllocateODEDataForThread(~0U); + UBOdeNative.AllocateODEDataForThread(~0U); while (ChangesQueue.TryDequeue(out ODEchangeitem item)) { @@ -1659,7 +1659,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde //double rayTime = 0; - SafeNativeMethods.AllocateODEDataForThread(~0U); + UBOdeNative.AllocateODEDataForThread(~0U); while (ChangesQueue.TryDequeue(out ODEchangeitem item)) { @@ -1697,7 +1697,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde { foreach (OdeCharacter actor in _characters) { - lock (SimulationLock) actor.Move(); } } @@ -1707,7 +1706,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde { foreach (OdePrim aprim in _activegroups) { - lock (SimulationLock) aprim.Move(); } } @@ -1753,7 +1751,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde { if(pobj.Body != IntPtr.Zero && !pobj.m_isSelected && !pobj.m_disabled && !pobj.m_building && - !SafeNativeMethods.BodyIsEnabled(pobj.Body)) + !UBOdeNative.BodyIsEnabled(pobj.Body)) sleepers.Add(pobj); } } @@ -1771,8 +1769,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde // do a ode simulation step lock (SimulationLock) { - SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); - SafeNativeMethods.JointGroupEmpty(JointContactGroup); + UBOdeNative.WorldQuickStep(world, ODE_STEPSIZE); + UBOdeNative.JointGroupEmpty(JointContactGroup); } //qstepTIme += Util.GetTimeStampMS() - tmpTime; @@ -1793,18 +1791,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde } */ //tmpTime = Util.GetTimeStampMS(); - //lock (SimulationLock) + lock (_activegroups) { - lock (_activegroups) { + foreach (OdePrim actor in _activegroups) { - foreach (OdePrim actor in _activegroups) + if (actor.IsPhysical) { - if (actor.IsPhysical) - { - lock (SimulationLock) - actor.UpdatePositionAndVelocity(framecount); - } + actor.UpdatePositionAndVelocity(framecount); } } } @@ -1881,7 +1875,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde int ngeoms = SafeNativeMethods.NTotalGeoms; */ - //looptimeMS /= nodeframes; //collisionTime /= nodeframes; //qstepTIme /= nodeframes; @@ -1893,8 +1886,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde //if(looptimeMS > .05) { - - } fps = (float)nodeframes * ODE_STEPSIZE / reqTimeStep; @@ -2086,12 +2077,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde lock(SimulationLock) lock (OdeLock) { - SafeNativeMethods.AllocateODEDataForThread(~0U); + UBOdeNative.AllocateODEDataForThread(~0U); if (TerrainGeom != IntPtr.Zero) { actor_name_map.Remove(TerrainGeom); - SafeNativeMethods.GeomDestroy(TerrainGeom); + UBOdeNative.GeomDestroy(TerrainGeom); } if (m_terrainHeightsHandler.IsAllocated) @@ -2107,16 +2098,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde m_lastRegionWidth = m_regionWidth; m_lastRegionHeight = m_regionHeight; - HeightmapData = SafeNativeMethods.GeomOSTerrainDataCreate(); - SafeNativeMethods.GeomOSTerrainDataBuild(HeightmapData, m_terrainHeightsHandler.AddrOfPinnedObject(), 0, 1.0f, + HeightmapData = UBOdeNative.GeomOSTerrainDataCreate(); + UBOdeNative.GeomOSTerrainDataBuild(HeightmapData, m_terrainHeightsHandler.AddrOfPinnedObject(), 0, 1.0f, m_heightmapWidthSamples, m_heightmapHeightSamples, 1, 0); - TerrainGeom = SafeNativeMethods.CreateOSTerrain(TopSpace, HeightmapData, 1); + TerrainGeom = UBOdeNative.CreateOSTerrain(TopSpace, HeightmapData, 1); if (TerrainGeom != IntPtr.Zero) { - SafeNativeMethods.GeomSetCategoryBits(TerrainGeom, (uint)(CollisionCategories.Land)); - SafeNativeMethods.GeomSetCollideBits(TerrainGeom, 0); + UBOdeNative.GeomSetCategoryBits(TerrainGeom, (uint)(CollisionCategories.Land)); + UBOdeNative.GeomSetCollideBits(TerrainGeom, 0); PhysicsActor pa = new NullPhysicsActor(); pa.Name = "Terrain"; @@ -2125,7 +2116,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde //geom_name_map[GroundGeom] = "Terrain"; - SafeNativeMethods.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); + UBOdeNative.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); } else m_terrainHeightsHandler.Free(); @@ -2191,8 +2182,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde lock(SimulationLock) lock (OdeLock) { - SafeNativeMethods.GeomOSTerrainDataSetBounds(HeightmapData, minH, maxH); - SafeNativeMethods.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); + UBOdeNative.GeomOSTerrainDataSetBounds(HeightmapData, minH, maxH); + UBOdeNative.GeomSetPosition(TerrainGeom, m_regionWidth * 0.5f, m_regionHeight * 0.5f, 0.0f); } } @@ -2213,7 +2204,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (world == IntPtr.Zero) return; - SafeNativeMethods.AllocateODEDataForThread(~0U); + UBOdeNative.AllocateODEDataForThread(~0U); if (m_meshWorker != null) m_meshWorker.Stop(); @@ -2246,7 +2237,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde if (TerrainGeom != IntPtr.Zero) { - SafeNativeMethods.GeomDestroy(TerrainGeom); + UBOdeNative.GeomDestroy(TerrainGeom); TerrainGeom = IntPtr.Zero; } @@ -2266,7 +2257,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde GlobalContactsArray = IntPtr.Zero; } - SafeNativeMethods.WorldDestroy(world); + UBOdeNative.WorldDestroy(world); world = IntPtr.Zero; //d.CloseODE(); } diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs b/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs index 3f86ab2a64..37f46bd72e 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODESitAvatar.cs @@ -71,8 +71,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde IntPtr geom = ((OdePrim)actor).m_prim_geom; - Vector3 geopos = SafeNativeMethods.GeomGetPositionOMV(geom); - Quaternion geomOri = SafeNativeMethods.GeomGetQuaternionOMV(geom); + Vector3 geopos = UBOdeNative.GeomGetPositionOMV(geom); + Quaternion geomOri = UBOdeNative.GeomGetQuaternionOMV(geom); //Vector3 geopos = actor.Position; //Quaternion geomOri = actor.Orientation; @@ -115,11 +115,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde offset = rayResults[0].Pos - geopos; - SafeNativeMethods.GeomClassID geoclass = SafeNativeMethods.GeomGetClass(geom); + UBOdeNative.GeomClassID geoclass = UBOdeNative.GeomGetClass(geom); - if (geoclass == SafeNativeMethods.GeomClassID.SphereClass) + if (geoclass == UBOdeNative.GeomClassID.SphereClass) { - float r = SafeNativeMethods.GeomSphereGetRadius(geom); + float r = UBOdeNative.GeomSphereGetRadius(geom); offset.Normalize(); offset *= r; diff --git a/bin/lib64/libode-x86_64.so b/bin/lib64/libode-x86_64.so deleted file mode 100755 index b2857277b0..0000000000 Binary files a/bin/lib64/libode-x86_64.so and /dev/null differ diff --git a/bin/lib64/libode.dylib b/bin/lib64/libode.dylib deleted file mode 100755 index 4ffcdd7f46..0000000000 Binary files a/bin/lib64/libode.dylib and /dev/null differ diff --git a/bin/lib64/ode.dll b/bin/lib64/ode.dll deleted file mode 100755 index b8e34145b8..0000000000 Binary files a/bin/lib64/ode.dll and /dev/null differ diff --git a/bin/libode.dylib b/bin/libode.dylib deleted file mode 100644 index 4ffcdd7f46..0000000000 Binary files a/bin/libode.dylib and /dev/null differ diff --git a/bin/libode.so b/bin/libode.so deleted file mode 100644 index b2857277b0..0000000000 Binary files a/bin/libode.so and /dev/null differ