diff options
Diffstat (limited to 'libraries/ode-0.9/contrib/Ode.NET')
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs | 18 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs | 58 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua | 19 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Ode/AssemblyInfo.cs | 18 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Ode/Ode.cs | 1732 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Ode/premake.lua | 31 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/README.TXT | 73 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Tests/BoxStack.cs | 260 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/Tests/premake.lua | 27 | ||||
-rw-r--r-- | libraries/ode-0.9/contrib/Ode.NET/premake.lua | 29 |
10 files changed, 2265 insertions, 0 deletions
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs new file mode 100644 index 0000000..8d2b86a --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs | |||
@@ -0,0 +1,18 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using System.Runtime.CompilerServices; | ||
4 | using System.Runtime.InteropServices; | ||
5 | |||
6 | [assembly: AssemblyTitle("Drawstuff.NET")] | ||
7 | [assembly: AssemblyDescription("")] | ||
8 | [assembly: AssemblyConfiguration("")] | ||
9 | [assembly: AssemblyCompany("")] | ||
10 | [assembly: AssemblyProduct("Ode.NET")] | ||
11 | [assembly: AssemblyCopyright("")] | ||
12 | [assembly: AssemblyTrademark("")] | ||
13 | [assembly: AssemblyCulture("")] | ||
14 | [assembly: ComVisible(false)] | ||
15 | [assembly: Guid("b2a39dd4-dd67-4e8a-af70-d3b412da8850")] | ||
16 | [assembly: AssemblyVersion("0.7.0.0")] | ||
17 | [assembly: AssemblyFileVersion("0.7.0.0")] | ||
18 | [assembly: CLSCompliantAttribute(true)] | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs new file mode 100644 index 0000000..aa84966 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs | |||
@@ -0,0 +1,58 @@ | |||
1 | using System; | ||
2 | using System.Runtime.InteropServices; | ||
3 | using Ode.NET; | ||
4 | |||
5 | namespace Drawstuff.NET | ||
6 | { | ||
7 | #if dDOUBLE | ||
8 | using dReal = System.Double; | ||
9 | #else | ||
10 | using dReal = System.Single; | ||
11 | #endif | ||
12 | |||
13 | public static class ds | ||
14 | { | ||
15 | public const int VERSION = 2; | ||
16 | |||
17 | public enum Texture | ||
18 | { | ||
19 | None, | ||
20 | Wood | ||
21 | } | ||
22 | |||
23 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
24 | public delegate void CallbackFunction(int arg); | ||
25 | |||
26 | [StructLayout(LayoutKind.Sequential)] | ||
27 | public struct Functions | ||
28 | { | ||
29 | public int version; | ||
30 | public CallbackFunction start; | ||
31 | public CallbackFunction step; | ||
32 | public CallbackFunction command; | ||
33 | public CallbackFunction stop; | ||
34 | public string path_to_textures; | ||
35 | } | ||
36 | |||
37 | [DllImport("drawstuff", EntryPoint="dsDrawBox")] | ||
38 | public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides); | ||
39 | |||
40 | [DllImport("drawstuff", EntryPoint = "dsDrawCapsule")] | ||
41 | public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius); | ||
42 | |||
43 | [DllImport("drawstuff", EntryPoint = "dsDrawConvex")] | ||
44 | public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); | ||
45 | |||
46 | [DllImport("drawstuff", EntryPoint="dsSetColor")] | ||
47 | public static extern void SetColor(float red, float green, float blue); | ||
48 | |||
49 | [DllImport("drawstuff", EntryPoint="dsSetTexture")] | ||
50 | public static extern void SetTexture(Texture texture); | ||
51 | |||
52 | [DllImport("drawstuff", EntryPoint="dsSetViewpoint")] | ||
53 | public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr); | ||
54 | |||
55 | [DllImport("drawstuff", EntryPoint="dsSimulationLoop")] | ||
56 | public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn); | ||
57 | } | ||
58 | } | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua new file mode 100644 index 0000000..d777ffb --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua | |||
@@ -0,0 +1,19 @@ | |||
1 | package.name = "Drawstuff.NET" | ||
2 | package.kind = "dll" | ||
3 | package.language = "c#" | ||
4 | |||
5 | if (options["with-doubles"]) then | ||
6 | package.defines = { "dDOUBLE" } | ||
7 | else | ||
8 | package.defines = { "dSINGLE " } | ||
9 | end | ||
10 | |||
11 | package.links = { | ||
12 | "System", | ||
13 | "Ode.NET" | ||
14 | } | ||
15 | |||
16 | package.files = { | ||
17 | "AssemblyInfo.cs", | ||
18 | "Drawstuff.cs" | ||
19 | } | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Ode/AssemblyInfo.cs b/libraries/ode-0.9/contrib/Ode.NET/Ode/AssemblyInfo.cs new file mode 100644 index 0000000..6a8c2b6 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Ode/AssemblyInfo.cs | |||
@@ -0,0 +1,18 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using System.Runtime.CompilerServices; | ||
4 | using System.Runtime.InteropServices; | ||
5 | |||
6 | [assembly: AssemblyTitle("Ode.NET")] | ||
7 | [assembly: AssemblyDescription("")] | ||
8 | [assembly: AssemblyConfiguration("")] | ||
9 | [assembly: AssemblyCompany("")] | ||
10 | [assembly: AssemblyProduct("Ode.NET")] | ||
11 | [assembly: AssemblyCopyright("")] | ||
12 | [assembly: AssemblyTrademark("")] | ||
13 | [assembly: AssemblyCulture("")] | ||
14 | [assembly: ComVisible(false)] | ||
15 | [assembly: Guid("1347a35e-c32b-4ff6-8064-7d10b2cc113b")] | ||
16 | [assembly: AssemblyVersion("0.7.0.0")] | ||
17 | [assembly: AssemblyFileVersion("0.7.0.0")] | ||
18 | [assembly: CLSCompliantAttribute(true)] | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Ode/Ode.cs b/libraries/ode-0.9/contrib/Ode.NET/Ode/Ode.cs new file mode 100644 index 0000000..0603810 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Ode/Ode.cs | |||
@@ -0,0 +1,1732 @@ | |||
1 | using System; | ||
2 | using System.Runtime.InteropServices; | ||
3 | using System.Security; | ||
4 | |||
5 | namespace Ode.NET | ||
6 | { | ||
7 | #if dDOUBLE | ||
8 | using dReal = System.Double; | ||
9 | #else | ||
10 | using dReal = System.Single; | ||
11 | #endif | ||
12 | |||
13 | public static class d | ||
14 | { | ||
15 | public static dReal Infinity = dReal.MaxValue; | ||
16 | |||
17 | #region Flags and Enumerations | ||
18 | |||
19 | [Flags] | ||
20 | public enum ContactFlags : int | ||
21 | { | ||
22 | Mu2 = 0x001, | ||
23 | FDir1 = 0x002, | ||
24 | Bounce = 0x004, | ||
25 | SoftERP = 0x008, | ||
26 | SoftCFM = 0x010, | ||
27 | Motion1 = 0x020, | ||
28 | Motion2 = 0x040, | ||
29 | Slip1 = 0x080, | ||
30 | Slip2 = 0x100, | ||
31 | Approx0 = 0x0000, | ||
32 | Approx1_1 = 0x1000, | ||
33 | Approx1_2 = 0x2000, | ||
34 | Approx1 = 0x3000 | ||
35 | } | ||
36 | |||
37 | public enum GeomClassID : int | ||
38 | { | ||
39 | SphereClass, | ||
40 | BoxClass, | ||
41 | CapsuleClass, | ||
42 | CylinderClass, | ||
43 | PlaneClass, | ||
44 | RayClass, | ||
45 | ConvexClass, | ||
46 | GeomTransformClass, | ||
47 | TriMeshClass, | ||
48 | HeightfieldClass, | ||
49 | FirstSpaceClass, | ||
50 | SimpleSpaceClass = FirstSpaceClass, | ||
51 | HashSpaceClass, | ||
52 | QuadTreeSpaceClass, | ||
53 | LastSpaceClass = QuadTreeSpaceClass, | ||
54 | FirstUserClass, | ||
55 | LastUserClass = FirstUserClass + MaxUserClasses - 1, | ||
56 | NumClasses, | ||
57 | MaxUserClasses = 4 | ||
58 | } | ||
59 | |||
60 | public enum JointType : int | ||
61 | { | ||
62 | None, | ||
63 | Ball, | ||
64 | Hinge, | ||
65 | Slider, | ||
66 | Contact, | ||
67 | Universal, | ||
68 | Hinge2, | ||
69 | Fixed, | ||
70 | Null, | ||
71 | AMotor, | ||
72 | LMotor, | ||
73 | Plane2D | ||
74 | } | ||
75 | |||
76 | public enum JointParam : int | ||
77 | { | ||
78 | LoStop, | ||
79 | HiStop, | ||
80 | Vel, | ||
81 | FMax, | ||
82 | FudgeFactor, | ||
83 | Bounce, | ||
84 | CFM, | ||
85 | StopERP, | ||
86 | StopCFM, | ||
87 | SuspensionERP, | ||
88 | SuspensionCFM, | ||
89 | LoStop2 = 256, | ||
90 | HiStop2, | ||
91 | Vel2, | ||
92 | FMax2, | ||
93 | FudgeFactor2, | ||
94 | Bounce2, | ||
95 | CFM2, | ||
96 | StopERP2, | ||
97 | StopCFM2, | ||
98 | SuspensionERP2, | ||
99 | SuspensionCFM2, | ||
100 | LoStop3 = 512, | ||
101 | HiStop3, | ||
102 | Vel3, | ||
103 | FMax3, | ||
104 | FudgeFactor3, | ||
105 | Bounce3, | ||
106 | CFM3, | ||
107 | StopERP3, | ||
108 | StopCFM3, | ||
109 | SuspensionERP3, | ||
110 | SuspensionCFM3 | ||
111 | } | ||
112 | |||
113 | #endregion | ||
114 | |||
115 | #region Callbacks | ||
116 | |||
117 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
118 | public delegate int AABBTestFn(IntPtr o1, IntPtr o2, ref AABB aabb); | ||
119 | |||
120 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
121 | public delegate int ColliderFn(IntPtr o1, IntPtr o2, int flags, out ContactGeom contact, int skip); | ||
122 | |||
123 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
124 | public delegate void GetAABBFn(IntPtr geom, out AABB aabb); | ||
125 | |||
126 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
127 | public delegate ColliderFn GetColliderFnFn(int num); | ||
128 | |||
129 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
130 | public delegate void GeomDtorFn(IntPtr o); | ||
131 | |||
132 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
133 | public delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z); | ||
134 | |||
135 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
136 | public delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2); | ||
137 | |||
138 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
139 | public delegate int TriCallback(IntPtr trimesh, IntPtr refObject, int triangleIndex); | ||
140 | |||
141 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
142 | public delegate int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount); | ||
143 | |||
144 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
145 | public delegate int TriRayCallback(IntPtr trimesh, IntPtr ray, int triangleIndex, dReal u, dReal v); | ||
146 | |||
147 | #endregion | ||
148 | |||
149 | #region Structs | ||
150 | |||
151 | [StructLayout(LayoutKind.Sequential)] | ||
152 | public struct AABB | ||
153 | { | ||
154 | public dReal MinX, MaxX; | ||
155 | public dReal MinY, MaxY; | ||
156 | public dReal MinZ, MaxZ; | ||
157 | } | ||
158 | |||
159 | |||
160 | [StructLayout(LayoutKind.Sequential)] | ||
161 | public struct Contact | ||
162 | { | ||
163 | public SurfaceParameters surface; | ||
164 | public ContactGeom geom; | ||
165 | public Vector3 fdir1; | ||
166 | } | ||
167 | |||
168 | |||
169 | [StructLayout(LayoutKind.Sequential)] | ||
170 | public struct ContactGeom | ||
171 | { | ||
172 | public static readonly int SizeOf = Marshal.SizeOf(typeof(ContactGeom)); | ||
173 | |||
174 | public Vector3 pos; | ||
175 | public Vector3 normal; | ||
176 | public dReal depth; | ||
177 | public IntPtr g1; | ||
178 | public IntPtr g2; | ||
179 | public int side1; | ||
180 | public int side2; | ||
181 | } | ||
182 | |||
183 | [StructLayout(LayoutKind.Sequential)] | ||
184 | public struct GeomClass | ||
185 | { | ||
186 | public int bytes; | ||
187 | public GetColliderFnFn collider; | ||
188 | public GetAABBFn aabb; | ||
189 | public AABBTestFn aabb_test; | ||
190 | public GeomDtorFn dtor; | ||
191 | } | ||
192 | |||
193 | |||
194 | [StructLayout(LayoutKind.Sequential)] | ||
195 | public struct JointFeedback | ||
196 | { | ||
197 | public Vector3 f1; | ||
198 | public Vector3 t1; | ||
199 | public Vector3 f2; | ||
200 | public Vector3 t2; | ||
201 | } | ||
202 | |||
203 | |||
204 | [StructLayout(LayoutKind.Sequential)] | ||
205 | public struct Mass | ||
206 | { | ||
207 | public dReal mass; | ||
208 | public Vector4 c; | ||
209 | public Matrix3 I; | ||
210 | } | ||
211 | |||
212 | |||
213 | [StructLayout(LayoutKind.Sequential)] | ||
214 | public struct Matrix3 | ||
215 | { | ||
216 | public Matrix3(dReal m00, dReal m10, dReal m20, dReal m01, dReal m11, dReal m21, dReal m02, dReal m12, dReal m22) | ||
217 | { | ||
218 | M00 = m00; M10 = m10; M20 = m20; _m30 = 0.0f; | ||
219 | M01 = m01; M11 = m11; M21 = m21; _m31 = 0.0f; | ||
220 | M02 = m02; M12 = m12; M22 = m22; _m32 = 0.0f; | ||
221 | } | ||
222 | public dReal M00, M10, M20; | ||
223 | private dReal _m30; | ||
224 | public dReal M01, M11, M21; | ||
225 | private dReal _m31; | ||
226 | public dReal M02, M12, M22; | ||
227 | private dReal _m32; | ||
228 | } | ||
229 | |||
230 | [StructLayout(LayoutKind.Sequential)] | ||
231 | public struct Matrix4 | ||
232 | { | ||
233 | public Matrix4(dReal m00, dReal m10, dReal m20, dReal m30, | ||
234 | dReal m01, dReal m11, dReal m21, dReal m31, | ||
235 | dReal m02, dReal m12, dReal m22, dReal m32, | ||
236 | dReal m03, dReal m13, dReal m23, dReal m33) | ||
237 | { | ||
238 | M00 = m00; M10 = m10; M20 = m20; M30 = m30; | ||
239 | M01 = m01; M11 = m11; M21 = m21; M31 = m31; | ||
240 | M02 = m02; M12 = m12; M22 = m22; M32 = m32; | ||
241 | M03 = m03; M13 = m13; M23 = m23; M33 = m33; | ||
242 | } | ||
243 | public dReal M00, M10, M20, M30; | ||
244 | public dReal M01, M11, M21, M31; | ||
245 | public dReal M02, M12, M22, M32; | ||
246 | public dReal M03, M13, M23, M33; | ||
247 | } | ||
248 | |||
249 | [StructLayout(LayoutKind.Sequential)] | ||
250 | public struct Quaternion | ||
251 | { | ||
252 | public dReal W, X, Y, Z; | ||
253 | } | ||
254 | |||
255 | |||
256 | [StructLayout(LayoutKind.Sequential)] | ||
257 | public struct SurfaceParameters | ||
258 | { | ||
259 | public ContactFlags mode; | ||
260 | public dReal mu; | ||
261 | public dReal mu2; | ||
262 | public dReal bounce; | ||
263 | public dReal bounce_vel; | ||
264 | public dReal soft_erp; | ||
265 | public dReal soft_cfm; | ||
266 | public dReal motion1; | ||
267 | public dReal motion2; | ||
268 | public dReal slip1; | ||
269 | public dReal slip2; | ||
270 | } | ||
271 | |||
272 | |||
273 | [StructLayout(LayoutKind.Sequential)] | ||
274 | public struct Vector3 | ||
275 | { | ||
276 | public Vector3(dReal x, dReal y, dReal z) | ||
277 | { | ||
278 | X = x; Y = y; Z = z; _w = 0.0f; | ||
279 | } | ||
280 | public dReal X, Y, Z; | ||
281 | private dReal _w; | ||
282 | } | ||
283 | |||
284 | |||
285 | [StructLayout(LayoutKind.Sequential)] | ||
286 | public struct Vector4 | ||
287 | { | ||
288 | public Vector4(dReal x, dReal y, dReal z, dReal w) | ||
289 | { | ||
290 | X = x; Y = y; Z = z; W = w; | ||
291 | } | ||
292 | public dReal X, Y, Z, W; | ||
293 | } | ||
294 | |||
295 | #endregion | ||
296 | |||
297 | [DllImport("ode", EntryPoint = "dAreConnected"), SuppressUnmanagedCodeSecurity] | ||
298 | public static extern bool AreConnected(IntPtr b1, IntPtr b2); | ||
299 | |||
300 | [DllImport("ode", EntryPoint = "dAreConnectedExcluding"), SuppressUnmanagedCodeSecurity] | ||
301 | public static extern bool AreConnectedExcluding(IntPtr b1, IntPtr b2, JointType joint_type); | ||
302 | |||
303 | [DllImport("ode", EntryPoint = "dBodyAddForce"), SuppressUnmanagedCodeSecurity] | ||
304 | public static extern void BodyAddForce(IntPtr body, dReal fx, dReal fy, dReal fz); | ||
305 | |||
306 | [DllImport("ode", EntryPoint = "dBodyAddForceAtPos"), SuppressUnmanagedCodeSecurity] | ||
307 | public static extern void BodyAddForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | ||
308 | |||
309 | [DllImport("ode", EntryPoint = "dBodyAddForceAtRelPos"), SuppressUnmanagedCodeSecurity] | ||
310 | public static extern void BodyAddForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | ||
311 | |||
312 | [DllImport("ode", EntryPoint = "dBodyAddRelForce"), SuppressUnmanagedCodeSecurity] | ||
313 | public static extern void BodyAddRelForce(IntPtr body, dReal fx, dReal fy, dReal fz); | ||
314 | |||
315 | [DllImport("ode", EntryPoint = "dBodyAddRelForceAtPos"), SuppressUnmanagedCodeSecurity] | ||
316 | public static extern void BodyAddRelForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | ||
317 | |||
318 | [DllImport("ode", EntryPoint = "dBodyAddRelForceAtRelPos"), SuppressUnmanagedCodeSecurity] | ||
319 | public static extern void BodyAddRelForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz); | ||
320 | |||
321 | [DllImport("ode", EntryPoint = "dBodyAddRelTorque"), SuppressUnmanagedCodeSecurity] | ||
322 | public static extern void BodyAddRelTorque(IntPtr body, dReal fx, dReal fy, dReal fz); | ||
323 | |||
324 | [DllImport("ode", EntryPoint = "dBodyAddTorque"), SuppressUnmanagedCodeSecurity] | ||
325 | public static extern void BodyAddTorque(IntPtr body, dReal fx, dReal fy, dReal fz); | ||
326 | |||
327 | [DllImport("ode", EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] | ||
328 | public static extern void BodyCopyPosition(IntPtr body, out Vector3 pos); | ||
329 | |||
330 | [DllImport("ode", EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity] | ||
331 | public static extern void BodyCopyPosition(IntPtr body, out dReal X); | ||
332 | |||
333 | [DllImport("ode", EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] | ||
334 | public static extern void BodyCopyQuaternion(IntPtr body, out Quaternion quat); | ||
335 | |||
336 | [DllImport("ode", EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity] | ||
337 | public static extern void BodyCopyQuaternion(IntPtr body, out dReal X); | ||
338 | |||
339 | [DllImport("ode", EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] | ||
340 | public static extern void BodyCopyRotation(IntPtr body, out Matrix3 R); | ||
341 | |||
342 | [DllImport("ode", EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity] | ||
343 | public static extern void BodyCopyRotation(IntPtr body, out dReal M00); | ||
344 | |||
345 | [DllImport("ode", EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity] | ||
346 | public static extern IntPtr BodyCreate(IntPtr world); | ||
347 | |||
348 | [DllImport("ode", EntryPoint = "dBodyDestroy"), SuppressUnmanagedCodeSecurity] | ||
349 | public static extern void BodyDestroy(IntPtr body); | ||
350 | |||
351 | [DllImport("ode", EntryPoint = "dBodyDisable"), SuppressUnmanagedCodeSecurity] | ||
352 | public static extern void BodyDisable(IntPtr body); | ||
353 | |||
354 | [DllImport("ode", EntryPoint = "dBodyEnable"), SuppressUnmanagedCodeSecurity] | ||
355 | public static extern void BodyEnable(IntPtr body); | ||
356 | |||
357 | [DllImport("ode", EntryPoint = "dBodyGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | ||
358 | public static extern dReal BodyGetAutoDisableAngularThreshold(IntPtr body); | ||
359 | |||
360 | [DllImport("ode", EntryPoint = "dBodyGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | ||
361 | public static extern bool BodyGetAutoDisableFlag(IntPtr body); | ||
362 | |||
363 | [DllImport("ode", EntryPoint = "dBodyGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | ||
364 | public static extern dReal BodyGetAutoDisableLinearThreshold(IntPtr body); | ||
365 | |||
366 | [DllImport("ode", EntryPoint = "dBodyGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | ||
367 | public static extern int BodyGetAutoDisableSteps(IntPtr body); | ||
368 | |||
369 | [DllImport("ode", EntryPoint = "dBodyGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | ||
370 | public static extern dReal BodyGetAutoDisableTime(IntPtr body); | ||
371 | |||
372 | #if !dNO_UNSAFE_CODE | ||
373 | [CLSCompliant(false)] | ||
374 | [DllImport("ode", EntryPoint = "dBodyGetAngularVel"), SuppressUnmanagedCodeSecurity] | ||
375 | public extern unsafe static Vector3* BodyGetAngularVelUnsafe(IntPtr body); | ||
376 | public static Vector3 BodyGetAngularVel(IntPtr body) | ||
377 | { | ||
378 | unsafe { return *(BodyGetAngularVelUnsafe(body)); } | ||
379 | } | ||
380 | #endif | ||
381 | |||
382 | [DllImport("ode", EntryPoint = "dBodyGetData"), SuppressUnmanagedCodeSecurity] | ||
383 | public static extern IntPtr BodyGetData(IntPtr body); | ||
384 | |||
385 | [DllImport("ode", EntryPoint = "dBodyGetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] | ||
386 | public static extern int BodyGetFiniteRotationMode(IntPtr body); | ||
387 | |||
388 | [DllImport("ode", EntryPoint = "dBodyGetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity] | ||
389 | public static extern void BodyGetFiniteRotationAxis(IntPtr body, out Vector3 result); | ||
390 | |||
391 | #if !dNO_UNSAFE_CODE | ||
392 | [CLSCompliant(false)] | ||
393 | [DllImport("ode", EntryPoint = "dBodyGetForce"), SuppressUnmanagedCodeSecurity] | ||
394 | public extern unsafe static Vector3* BodyGetForceUnsafe(IntPtr body); | ||
395 | public static Vector3 BodyGetForce(IntPtr body) | ||
396 | { | ||
397 | unsafe { return *(BodyGetForceUnsafe(body)); } | ||
398 | } | ||
399 | #endif | ||
400 | |||
401 | [DllImport("ode", EntryPoint = "dBodyGetGravityMode"), SuppressUnmanagedCodeSecurity] | ||
402 | public static extern bool BodyGetGravityMode(IntPtr body); | ||
403 | |||
404 | [DllImport("ode", EntryPoint = "dBodyGetJoint"), SuppressUnmanagedCodeSecurity] | ||
405 | public static extern IntPtr BodyGetJoint(IntPtr body, int index); | ||
406 | |||
407 | #if !dNO_UNSAFE_CODE | ||
408 | [CLSCompliant(false)] | ||
409 | [DllImport("ode", EntryPoint = "dBodyGetLinearVel"), SuppressUnmanagedCodeSecurity] | ||
410 | public extern unsafe static Vector3* BodyGetLinearVelUnsafe(IntPtr body); | ||
411 | public static Vector3 BodyGetLinearVel(IntPtr body) | ||
412 | { | ||
413 | unsafe { return *(BodyGetLinearVelUnsafe(body)); } | ||
414 | } | ||
415 | #endif | ||
416 | |||
417 | [DllImport("ode", EntryPoint = "dBodyGetMass"), SuppressUnmanagedCodeSecurity] | ||
418 | public static extern void BodyGetMass(IntPtr body, out Mass mass); | ||
419 | |||
420 | [DllImport("ode", EntryPoint = "dBodyGetNumJoints"), SuppressUnmanagedCodeSecurity] | ||
421 | public static extern int BodyGetNumJoints(IntPtr body); | ||
422 | |||
423 | [DllImport("ode", EntryPoint = "dBodyGetPointVel"), SuppressUnmanagedCodeSecurity] | ||
424 | public static extern void BodyGetPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | ||
425 | |||
426 | #if !dNO_UNSAFE_CODE | ||
427 | [CLSCompliant(false)] | ||
428 | [DllImport("ode", EntryPoint = "dBodyGetPosition"), SuppressUnmanagedCodeSecurity] | ||
429 | public extern unsafe static Vector3* BodyGetPositionUnsafe(IntPtr body); | ||
430 | public static Vector3 BodyGetPosition(IntPtr body) | ||
431 | { | ||
432 | unsafe { return *(BodyGetPositionUnsafe(body)); } | ||
433 | } | ||
434 | #endif | ||
435 | |||
436 | [DllImport("ode", EntryPoint = "dBodyGetPosRelPoint"), SuppressUnmanagedCodeSecurity] | ||
437 | public static extern void BodyGetPosRelPoint(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | ||
438 | |||
439 | #if !dNO_UNSAFE_CODE | ||
440 | [CLSCompliant(false)] | ||
441 | [DllImport("ode", EntryPoint = "dBodyGetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
442 | public extern unsafe static Quaternion* BodyGetQuaternionUnsafe(IntPtr body); | ||
443 | public static Quaternion BodyGetQuaternion(IntPtr body) | ||
444 | { | ||
445 | unsafe { return *(BodyGetQuaternionUnsafe(body)); } | ||
446 | } | ||
447 | #endif | ||
448 | |||
449 | [DllImport("ode", EntryPoint = "dBodyGetRelPointPos"), SuppressUnmanagedCodeSecurity] | ||
450 | public static extern void BodyGetRelPointPos(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | ||
451 | |||
452 | [DllImport("ode", EntryPoint = "dBodyGetRelPointVel"), SuppressUnmanagedCodeSecurity] | ||
453 | public static extern void BodyGetRelPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | ||
454 | |||
455 | #if !dNO_UNSAFE_CODE | ||
456 | [CLSCompliant(false)] | ||
457 | [DllImport("ode", EntryPoint = "dBodyGetRotation"), SuppressUnmanagedCodeSecurity] | ||
458 | public extern unsafe static Matrix3* BodyGetRotationUnsafe(IntPtr body); | ||
459 | public static Matrix3 BodyGetRotation(IntPtr body) | ||
460 | { | ||
461 | unsafe { return *(BodyGetRotationUnsafe(body)); } | ||
462 | } | ||
463 | #endif | ||
464 | |||
465 | #if !dNO_UNSAFE_CODE | ||
466 | [CLSCompliant(false)] | ||
467 | [DllImport("ode", EntryPoint = "dBodyGetTorque"), SuppressUnmanagedCodeSecurity] | ||
468 | public extern unsafe static Vector3* BodyGetTorqueUnsafe(IntPtr body); | ||
469 | public static Vector3 BodyGetTorque(IntPtr body) | ||
470 | { | ||
471 | unsafe { return *(BodyGetTorqueUnsafe(body)); } | ||
472 | } | ||
473 | #endif | ||
474 | |||
475 | [DllImport("ode", EntryPoint = "dBodyIsEnabled"), SuppressUnmanagedCodeSecurity] | ||
476 | public static extern bool BodyIsEnabled(IntPtr body); | ||
477 | |||
478 | [DllImport("ode", EntryPoint = "dBodySetAngularVel"), SuppressUnmanagedCodeSecurity] | ||
479 | public static extern void BodySetAngularVel(IntPtr body, dReal x, dReal y, dReal z); | ||
480 | |||
481 | [DllImport("ode", EntryPoint = "dBodySetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | ||
482 | public static extern void BodySetAutoDisableAngularThreshold(IntPtr body, dReal angular_threshold); | ||
483 | |||
484 | [DllImport("ode", EntryPoint = "dBodySetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity] | ||
485 | public static extern void BodySetAutoDisableDefaults(IntPtr body); | ||
486 | |||
487 | [DllImport("ode", EntryPoint = "dBodySetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | ||
488 | public static extern void BodySetAutoDisableFlag(IntPtr body, bool do_auto_disable); | ||
489 | |||
490 | [DllImport("ode", EntryPoint = "dBodySetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | ||
491 | public static extern void BodySetAutoDisableLinearThreshold(IntPtr body, dReal linear_threshold); | ||
492 | |||
493 | [DllImport("ode", EntryPoint = "dBodySetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | ||
494 | public static extern void BodySetAutoDisableSteps(IntPtr body, int steps); | ||
495 | |||
496 | [DllImport("ode", EntryPoint = "dBodySetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | ||
497 | public static extern void BodySetAutoDisableTime(IntPtr body, dReal time); | ||
498 | |||
499 | [DllImport("ode", EntryPoint = "dBodySetData"), SuppressUnmanagedCodeSecurity] | ||
500 | public static extern void BodySetData(IntPtr body, IntPtr data); | ||
501 | |||
502 | [DllImport("ode", EntryPoint = "dBodySetFiniteRotationMode"), SuppressUnmanagedCodeSecurity] | ||
503 | public static extern void BodySetFiniteRotationMode(IntPtr body, int mode); | ||
504 | |||
505 | [DllImport("ode", EntryPoint = "dBodySetFiniteRotationModeAxis"), SuppressUnmanagedCodeSecurity] | ||
506 | public static extern void BodySetFiniteRotationModeAxis(IntPtr body, dReal x, dReal y, dReal z); | ||
507 | |||
508 | [DllImport("ode", EntryPoint = "dBodySetForce"), SuppressUnmanagedCodeSecurity] | ||
509 | public static extern void BodySetForce(IntPtr body, dReal x, dReal y, dReal z); | ||
510 | |||
511 | [DllImport("ode", EntryPoint = "dBodySetGravityMode"), SuppressUnmanagedCodeSecurity] | ||
512 | public static extern void BodySetGravityMode(IntPtr body, bool mode); | ||
513 | |||
514 | [DllImport("ode", EntryPoint = "dBodySetLinearVel"), SuppressUnmanagedCodeSecurity] | ||
515 | public static extern void BodySetLinearVel(IntPtr body, dReal x, dReal y, dReal z); | ||
516 | |||
517 | [DllImport("ode", EntryPoint = "dBodySetMass"), SuppressUnmanagedCodeSecurity] | ||
518 | public static extern void BodySetMass(IntPtr body, ref Mass mass); | ||
519 | |||
520 | [DllImport("ode", EntryPoint = "dBodySetPosition"), SuppressUnmanagedCodeSecurity] | ||
521 | public static extern void BodySetPosition(IntPtr body, dReal x, dReal y, dReal z); | ||
522 | |||
523 | [DllImport("ode", EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
524 | public static extern void BodySetQuaternion(IntPtr body, ref Quaternion q); | ||
525 | |||
526 | [DllImport("ode", EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
527 | public static extern void BodySetQuaternion(IntPtr body, ref dReal w); | ||
528 | |||
529 | [DllImport("ode", EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] | ||
530 | public static extern void BodySetRotation(IntPtr body, ref Matrix3 R); | ||
531 | |||
532 | [DllImport("ode", EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity] | ||
533 | public static extern void BodySetRotation(IntPtr body, ref dReal M00); | ||
534 | |||
535 | [DllImport("ode", EntryPoint = "dBodySetTorque"), SuppressUnmanagedCodeSecurity] | ||
536 | public static extern void BodySetTorque(IntPtr body, dReal x, dReal y, dReal z); | ||
537 | |||
538 | [DllImport("ode", EntryPoint = "dBodyVectorFromWorld"), SuppressUnmanagedCodeSecurity] | ||
539 | public static extern void BodyVectorFromWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | ||
540 | |||
541 | [DllImport("ode", EntryPoint = "dBodyVectorToWorld"), SuppressUnmanagedCodeSecurity] | ||
542 | public static extern void BodyVectorToWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result); | ||
543 | |||
544 | [DllImport("ode", EntryPoint = "dBoxBox"), SuppressUnmanagedCodeSecurity] | ||
545 | public static extern void BoxBox(ref Vector3 p1, ref Matrix3 R1, | ||
546 | ref Vector3 side1, ref Vector3 p2, | ||
547 | ref Matrix3 R2, ref Vector3 side2, | ||
548 | ref Vector3 normal, out dReal depth, out int return_code, | ||
549 | int maxc, out ContactGeom contact, int skip); | ||
550 | |||
551 | [DllImport("ode", EntryPoint = "dBoxTouchesBox"), SuppressUnmanagedCodeSecurity] | ||
552 | public static extern void BoxTouchesBox(ref Vector3 _p1, ref Matrix3 R1, | ||
553 | ref Vector3 side1, ref Vector3 _p2, | ||
554 | ref Matrix3 R2, ref Vector3 side2); | ||
555 | |||
556 | [DllImport("ode", EntryPoint = "dClosestLineSegmentPoints"), SuppressUnmanagedCodeSecurity] | ||
557 | public static extern void ClosestLineSegmentPoints(ref Vector3 a1, ref Vector3 a2, | ||
558 | ref Vector3 b1, ref Vector3 b2, | ||
559 | ref Vector3 cp1, ref Vector3 cp2); | ||
560 | |||
561 | [DllImport("ode", EntryPoint = "dCloseODE"), SuppressUnmanagedCodeSecurity] | ||
562 | public static extern void CloseODE(); | ||
563 | |||
564 | [DllImport("ode", EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity] | ||
565 | public static extern int Collide(IntPtr o1, IntPtr o2, int flags, [In, Out] ContactGeom[] contact, int skip); | ||
566 | |||
567 | [DllImport("ode", EntryPoint = "dConnectingJoint"), SuppressUnmanagedCodeSecurity] | ||
568 | public static extern IntPtr ConnectingJoint(IntPtr j1, IntPtr j2); | ||
569 | |||
570 | [DllImport("ode", EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity] | ||
571 | public static extern IntPtr CreateBox(IntPtr space, dReal lx, dReal ly, dReal lz); | ||
572 | |||
573 | [DllImport("ode", EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity] | ||
574 | public static extern IntPtr CreateCapsule(IntPtr space, dReal radius, dReal length); | ||
575 | |||
576 | [DllImport("ode", EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity] | ||
577 | public static extern IntPtr CreateConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); | ||
578 | |||
579 | [DllImport("ode", EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity] | ||
580 | public static extern IntPtr CreateCylinder(IntPtr space, dReal radius, dReal length); | ||
581 | |||
582 | [DllImport("ode", EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity] | ||
583 | public static extern IntPtr CreateHeightfield(IntPtr space, IntPtr data, int bPlaceable); | ||
584 | |||
585 | [DllImport("ode", EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity] | ||
586 | public static extern IntPtr CreateGeom(int classnum); | ||
587 | |||
588 | [DllImport("ode", EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity] | ||
589 | public static extern int CreateGeomClass(ref GeomClass classptr); | ||
590 | |||
591 | [DllImport("ode", EntryPoint = "dCreateGeomTransform"), SuppressUnmanagedCodeSecurity] | ||
592 | public static extern IntPtr CreateGeomTransform(IntPtr space); | ||
593 | |||
594 | [DllImport("ode", EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity] | ||
595 | public static extern IntPtr CreatePlane(IntPtr space, dReal a, dReal b, dReal c, dReal d); | ||
596 | |||
597 | [DllImport("ode", EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity] | ||
598 | public static extern IntPtr CreateRay(IntPtr space, dReal length); | ||
599 | |||
600 | [DllImport("ode", EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity] | ||
601 | public static extern IntPtr CreateSphere(IntPtr space, dReal radius); | ||
602 | |||
603 | [DllImport("ode", EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity] | ||
604 | public static extern IntPtr CreateTriMesh(IntPtr space, IntPtr data, | ||
605 | TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback); | ||
606 | |||
607 | [DllImport("ode", EntryPoint = "dDot"), SuppressUnmanagedCodeSecurity] | ||
608 | public static extern dReal Dot(ref dReal X0, ref dReal X1, int n); | ||
609 | |||
610 | [DllImport("ode", EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity] | ||
611 | public static extern void DQfromW(dReal[] dq, ref Vector3 w, ref Quaternion q); | ||
612 | |||
613 | [DllImport("ode", EntryPoint = "dFactorCholesky"), SuppressUnmanagedCodeSecurity] | ||
614 | public static extern int FactorCholesky(ref dReal A00, int n); | ||
615 | |||
616 | [DllImport("ode", EntryPoint = "dFactorLDLT"), SuppressUnmanagedCodeSecurity] | ||
617 | public static extern void FactorLDLT(ref dReal A, out dReal d, int n, int nskip); | ||
618 | |||
619 | [DllImport("ode", EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] | ||
620 | public static extern void GeomBoxGetLengths(IntPtr geom, out Vector3 len); | ||
621 | |||
622 | [DllImport("ode", EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity] | ||
623 | public static extern void GeomBoxGetLengths(IntPtr geom, out dReal x); | ||
624 | |||
625 | [DllImport("ode", EntryPoint = "dGeomBoxPointDepth"), SuppressUnmanagedCodeSecurity] | ||
626 | public static extern dReal GeomBoxPointDepth(IntPtr geom, dReal x, dReal y, dReal z); | ||
627 | |||
628 | [DllImport("ode", EntryPoint = "dGeomBoxSetLengths"), SuppressUnmanagedCodeSecurity] | ||
629 | public static extern void GeomBoxSetLengths(IntPtr geom, dReal x, dReal y, dReal z); | ||
630 | |||
631 | [DllImport("ode", EntryPoint = "dGeomCapsuleGetParams"), SuppressUnmanagedCodeSecurity] | ||
632 | public static extern void GeomCapsuleGetParams(IntPtr geom, out dReal radius, out dReal length); | ||
633 | |||
634 | [DllImport("ode", EntryPoint = "dGeomCapsulePointDepth"), SuppressUnmanagedCodeSecurity] | ||
635 | public static extern dReal GeomCapsulePointDepth(IntPtr geom, dReal x, dReal y, dReal z); | ||
636 | |||
637 | [DllImport("ode", EntryPoint = "dGeomCapsuleSetParams"), SuppressUnmanagedCodeSecurity] | ||
638 | public static extern void GeomCapsuleSetParams(IntPtr geom, dReal radius, dReal length); | ||
639 | |||
640 | [DllImport("ode", EntryPoint = "dGeomClearOffset"), SuppressUnmanagedCodeSecurity] | ||
641 | public static extern void GeomClearOffset(IntPtr geom); | ||
642 | |||
643 | [DllImport("ode", EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] | ||
644 | public static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref Vector3 pos); | ||
645 | |||
646 | [DllImport("ode", EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity] | ||
647 | public static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref dReal X); | ||
648 | |||
649 | [DllImport("ode", EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
650 | public static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref Quaternion Q); | ||
651 | |||
652 | [DllImport("ode", EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
653 | public static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref dReal X); | ||
654 | |||
655 | [DllImport("ode", EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] | ||
656 | public static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref Matrix3 R); | ||
657 | |||
658 | [DllImport("ode", EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity] | ||
659 | public static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref dReal M00); | ||
660 | |||
661 | [DllImport("ode", EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] | ||
662 | public static extern void GeomCopyPosition(IntPtr geom, out Vector3 pos); | ||
663 | |||
664 | [DllImport("ode", EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity] | ||
665 | public static extern void GeomCopyPosition(IntPtr geom, out dReal X); | ||
666 | |||
667 | [DllImport("ode", EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] | ||
668 | public static extern void GeomCopyRotation(IntPtr geom, out Matrix3 R); | ||
669 | |||
670 | [DllImport("ode", EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity] | ||
671 | public static extern void GeomCopyRotation(IntPtr geom, out dReal M00); | ||
672 | |||
673 | [DllImport("ode", EntryPoint = "dGeomCylinderGetParams"), SuppressUnmanagedCodeSecurity] | ||
674 | public static extern void GeomCylinderGetParams(IntPtr geom, out dReal radius, out dReal length); | ||
675 | |||
676 | [DllImport("ode", EntryPoint = "dGeomCylinderSetParams"), SuppressUnmanagedCodeSecurity] | ||
677 | public static extern void GeomCylinderSetParams(IntPtr geom, dReal radius, dReal length); | ||
678 | |||
679 | [DllImport("ode", EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity] | ||
680 | public static extern void GeomDestroy(IntPtr geom); | ||
681 | |||
682 | [DllImport("ode", EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity] | ||
683 | public static extern void GeomDisable(IntPtr geom); | ||
684 | |||
685 | [DllImport("ode", EntryPoint = "dGeomEnable"), SuppressUnmanagedCodeSecurity] | ||
686 | public static extern void GeomEnable(IntPtr geom); | ||
687 | |||
688 | [DllImport("ode", EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] | ||
689 | public static extern void GeomGetAABB(IntPtr geom, out AABB aabb); | ||
690 | |||
691 | [DllImport("ode", EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity] | ||
692 | public static extern void GeomGetAABB(IntPtr geom, out dReal minX); | ||
693 | |||
694 | [DllImport("ode", EntryPoint = "dGeomGetBody"), SuppressUnmanagedCodeSecurity] | ||
695 | public static extern IntPtr GeomGetBody(IntPtr geom); | ||
696 | |||
697 | [DllImport("ode", EntryPoint = "dGeomGetCategoryBits"), SuppressUnmanagedCodeSecurity] | ||
698 | public static extern int GeomGetCategoryBits(IntPtr geom); | ||
699 | |||
700 | [DllImport("ode", EntryPoint = "dGeomGetClassData"), SuppressUnmanagedCodeSecurity] | ||
701 | public static extern IntPtr GeomGetClassData(IntPtr geom); | ||
702 | |||
703 | [DllImport("ode", EntryPoint = "dGeomGetCollideBits"), SuppressUnmanagedCodeSecurity] | ||
704 | public static extern int GeomGetCollideBits(IntPtr geom); | ||
705 | |||
706 | [DllImport("ode", EntryPoint = "dGeomGetClass"), SuppressUnmanagedCodeSecurity] | ||
707 | public static extern GeomClassID GeomGetClass(IntPtr geom); | ||
708 | |||
709 | [DllImport("ode", EntryPoint = "dGeomGetData"), SuppressUnmanagedCodeSecurity] | ||
710 | public static extern IntPtr GeomGetData(IntPtr geom); | ||
711 | |||
712 | #if !dNO_UNSAFE_CODE | ||
713 | [CLSCompliant(false)] | ||
714 | [DllImport("ode", EntryPoint = "dGeomGetOffsetPosition"), SuppressUnmanagedCodeSecurity] | ||
715 | public extern unsafe static Vector3* GeomGetOffsetPositionUnsafe(IntPtr geom); | ||
716 | public static Vector3 GeomGetOffsetPosition(IntPtr geom) | ||
717 | { | ||
718 | unsafe { return *(GeomGetOffsetPositionUnsafe(geom)); } | ||
719 | } | ||
720 | #endif | ||
721 | |||
722 | #if !dNO_UNSAFE_CODE | ||
723 | [CLSCompliant(false)] | ||
724 | [DllImport("ode", EntryPoint = "dGeomGetOffsetRotation"), SuppressUnmanagedCodeSecurity] | ||
725 | public extern unsafe static Matrix3* GeomGetOffsetRotationUnsafe(IntPtr geom); | ||
726 | public static Matrix3 GeomGetOffsetRotation(IntPtr geom) | ||
727 | { | ||
728 | unsafe { return *(GeomGetOffsetRotationUnsafe(geom)); } | ||
729 | } | ||
730 | #endif | ||
731 | |||
732 | #if !dNO_UNSAFE_CODE | ||
733 | [CLSCompliant(false)] | ||
734 | [DllImport("ode", EntryPoint = "dGeomGetPosition"), SuppressUnmanagedCodeSecurity] | ||
735 | public extern unsafe static Vector3* GeomGetPositionUnsafe(IntPtr geom); | ||
736 | public static Vector3 GeomGetPosition(IntPtr geom) | ||
737 | { | ||
738 | unsafe { return *(GeomGetPositionUnsafe(geom)); } | ||
739 | } | ||
740 | #endif | ||
741 | |||
742 | [DllImport("ode", EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
743 | public static extern void GeomCopyQuaternion(IntPtr geom, out Quaternion q); | ||
744 | |||
745 | [DllImport("ode", EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
746 | public static extern void GeomCopyQuaternion(IntPtr geom, out dReal X); | ||
747 | |||
748 | #if !dNO_UNSAFE_CODE | ||
749 | [CLSCompliant(false)] | ||
750 | [DllImport("ode", EntryPoint = "dGeomGetRotation"), SuppressUnmanagedCodeSecurity] | ||
751 | public extern unsafe static Matrix3* GeomGetRotationUnsafe(IntPtr geom); | ||
752 | public static Matrix3 GeomGetRotation(IntPtr geom) | ||
753 | { | ||
754 | unsafe { return *(GeomGetRotationUnsafe(geom)); } | ||
755 | } | ||
756 | #endif | ||
757 | |||
758 | [DllImport("ode", EntryPoint = "dGeomGetSpace"), SuppressUnmanagedCodeSecurity] | ||
759 | public static extern IntPtr GeomGetSpace(IntPtr geom); | ||
760 | |||
761 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] | ||
762 | public static extern void GeomHeightfieldDataBuildByte(IntPtr d, byte[] pHeightData, int bCopyHeightData, | ||
763 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
764 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
765 | |||
766 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity] | ||
767 | public static extern void GeomHeightfieldDataBuildByte(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | ||
768 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
769 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
770 | |||
771 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildCallback"), SuppressUnmanagedCodeSecurity] | ||
772 | public static extern void GeomHeightfieldDataBuildCallback(IntPtr d, IntPtr pUserData, HeightfieldGetHeight pCallback, | ||
773 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
774 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
775 | |||
776 | [CLSCompliant(false)] | ||
777 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] | ||
778 | public static extern void GeomHeightfieldDataBuildShort(IntPtr d, ushort[] pHeightData, int bCopyHeightData, | ||
779 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
780 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
781 | |||
782 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] | ||
783 | public static extern void GeomHeightfieldDataBuildShort(IntPtr d, short[] pHeightData, int bCopyHeightData, | ||
784 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
785 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
786 | |||
787 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity] | ||
788 | public static extern void GeomHeightfieldDataBuildShort(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | ||
789 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
790 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
791 | |||
792 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] | ||
793 | public static extern void GeomHeightfieldDataBuildSingle(IntPtr d, float[] pHeightData, int bCopyHeightData, | ||
794 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
795 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
796 | |||
797 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity] | ||
798 | public static extern void GeomHeightfieldDataBuildSingle(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | ||
799 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
800 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
801 | |||
802 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] | ||
803 | public static extern void GeomHeightfieldDataBuildDouble(IntPtr d, double[] pHeightData, int bCopyHeightData, | ||
804 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
805 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
806 | |||
807 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity] | ||
808 | public static extern void GeomHeightfieldDataBuildDouble(IntPtr d, IntPtr pHeightData, int bCopyHeightData, | ||
809 | dReal width, dReal depth, int widthSamples, int depthSamples, | ||
810 | dReal scale, dReal offset, dReal thickness, int bWrap); | ||
811 | |||
812 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataCreate"), SuppressUnmanagedCodeSecurity] | ||
813 | public static extern IntPtr GeomHeightfieldDataCreate(); | ||
814 | |||
815 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataDestroy"), SuppressUnmanagedCodeSecurity] | ||
816 | public static extern void GeomHeightfieldDataDestroy(IntPtr d); | ||
817 | |||
818 | [DllImport("ode", EntryPoint = "dGeomHeightfieldDataSetBounds"), SuppressUnmanagedCodeSecurity] | ||
819 | public static extern void GeomHeightfieldDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); | ||
820 | |||
821 | [DllImport("ode", EntryPoint = "dGeomHeightfieldGetHeightfieldData"), SuppressUnmanagedCodeSecurity] | ||
822 | public static extern IntPtr GeomHeightfieldGetHeightfieldData(IntPtr g); | ||
823 | |||
824 | [DllImport("ode", EntryPoint = "dGeomHeightfieldSetHeightfieldData"), SuppressUnmanagedCodeSecurity] | ||
825 | public static extern void GeomHeightfieldSetHeightfieldData(IntPtr g, IntPtr d); | ||
826 | |||
827 | [DllImport("ode", EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity] | ||
828 | public static extern bool GeomIsEnabled(IntPtr geom); | ||
829 | |||
830 | [DllImport("ode", EntryPoint = "dGeomIsOffset"), SuppressUnmanagedCodeSecurity] | ||
831 | public static extern bool GeomIsOffset(IntPtr geom); | ||
832 | |||
833 | [DllImport("ode", EntryPoint = "dGeomIsSpace"), SuppressUnmanagedCodeSecurity] | ||
834 | public static extern bool GeomIsSpace(IntPtr geom); | ||
835 | |||
836 | [DllImport("ode", EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] | ||
837 | public static extern void GeomPlaneGetParams(IntPtr geom, ref Vector4 result); | ||
838 | |||
839 | [DllImport("ode", EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity] | ||
840 | public static extern void GeomPlaneGetParams(IntPtr geom, ref dReal A); | ||
841 | |||
842 | [DllImport("ode", EntryPoint = "dGeomPlanePointDepth"), SuppressUnmanagedCodeSecurity] | ||
843 | public static extern dReal GeomPlanePointDepth(IntPtr geom, dReal x, dReal y, dReal z); | ||
844 | |||
845 | [DllImport("ode", EntryPoint = "dGeomPlaneSetParams"), SuppressUnmanagedCodeSecurity] | ||
846 | public static extern void GeomPlaneSetParams(IntPtr plane, dReal a, dReal b, dReal c, dReal d); | ||
847 | |||
848 | [DllImport("ode", EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] | ||
849 | public static extern void GeomRayGet(IntPtr ray, ref Vector3 start, ref Vector3 dir); | ||
850 | |||
851 | [DllImport("ode", EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity] | ||
852 | public static extern void GeomRayGet(IntPtr ray, ref dReal startX, ref dReal dirX); | ||
853 | |||
854 | [DllImport("ode", EntryPoint = "dGeomRayGetClosestHit"), SuppressUnmanagedCodeSecurity] | ||
855 | public static extern int GeomRayGetClosestHit(IntPtr ray); | ||
856 | |||
857 | [DllImport("ode", EntryPoint = "dGeomRayGetLength"), SuppressUnmanagedCodeSecurity] | ||
858 | public static extern dReal GeomRayGetLength(IntPtr ray); | ||
859 | |||
860 | [DllImport("ode", EntryPoint = "dGeomRayGetParams"), SuppressUnmanagedCodeSecurity] | ||
861 | public static extern dReal GeomRayGetParams(IntPtr g, out int firstContact, out int backfaceCull); | ||
862 | |||
863 | [DllImport("ode", EntryPoint = "dGeomRaySet"), SuppressUnmanagedCodeSecurity] | ||
864 | public static extern void GeomRaySet(IntPtr ray, dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz); | ||
865 | |||
866 | [DllImport("ode", EntryPoint = "dGeomRaySetClosestHit"), SuppressUnmanagedCodeSecurity] | ||
867 | public static extern void GeomRaySetClosestHit(IntPtr ray, int closestHit); | ||
868 | |||
869 | [DllImport("ode", EntryPoint = "dGeomRaySetLength"), SuppressUnmanagedCodeSecurity] | ||
870 | public static extern void GeomRaySetLength(IntPtr ray, dReal length); | ||
871 | |||
872 | [DllImport("ode", EntryPoint = "dGeomRaySetParams"), SuppressUnmanagedCodeSecurity] | ||
873 | public static extern void GeomRaySetParams(IntPtr ray, int firstContact, int backfaceCull); | ||
874 | |||
875 | [DllImport("ode", EntryPoint = "dGeomSetBody"), SuppressUnmanagedCodeSecurity] | ||
876 | public static extern void GeomSetBody(IntPtr geom, IntPtr body); | ||
877 | |||
878 | [DllImport("ode", EntryPoint = "dGeomSetCategoryBits"), SuppressUnmanagedCodeSecurity] | ||
879 | public static extern void GeomSetCategoryBits(IntPtr geom, int bits); | ||
880 | |||
881 | [DllImport("ode", EntryPoint = "dGeomSetCollideBits"), SuppressUnmanagedCodeSecurity] | ||
882 | public static extern void GeomSetCollideBits(IntPtr geom, int bits); | ||
883 | |||
884 | [DllImport("ode", EntryPoint = "dGeomSetConvex"), SuppressUnmanagedCodeSecurity] | ||
885 | public static extern IntPtr GeomSetConvex(IntPtr geom, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); | ||
886 | |||
887 | [DllImport("ode", EntryPoint = "dGeomSetData"), SuppressUnmanagedCodeSecurity] | ||
888 | public static extern void GeomSetData(IntPtr geom, IntPtr data); | ||
889 | |||
890 | [DllImport("ode", EntryPoint = "dGeomSetOffsetPosition"), SuppressUnmanagedCodeSecurity] | ||
891 | public static extern void GeomSetOffsetPosition(IntPtr geom, dReal x, dReal y, dReal z); | ||
892 | |||
893 | [DllImport("ode", EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
894 | public static extern void GeomSetOffsetQuaternion(IntPtr geom, ref Quaternion Q); | ||
895 | |||
896 | [DllImport("ode", EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
897 | public static extern void GeomSetOffsetQuaternion(IntPtr geom, ref dReal X); | ||
898 | |||
899 | [DllImport("ode", EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] | ||
900 | public static extern void GeomSetOffsetRotation(IntPtr geom, ref Matrix3 R); | ||
901 | |||
902 | [DllImport("ode", EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity] | ||
903 | public static extern void GeomSetOffsetRotation(IntPtr geom, ref dReal M00); | ||
904 | |||
905 | [DllImport("ode", EntryPoint = "dGeomSetOffsetWorldPosition"), SuppressUnmanagedCodeSecurity] | ||
906 | public static extern void GeomSetOffsetWorldPosition(IntPtr geom, dReal x, dReal y, dReal z); | ||
907 | |||
908 | [DllImport("ode", EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] | ||
909 | public static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref Quaternion Q); | ||
910 | |||
911 | [DllImport("ode", EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity] | ||
912 | public static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref dReal X); | ||
913 | |||
914 | [DllImport("ode", EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] | ||
915 | public static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref Matrix3 R); | ||
916 | |||
917 | [DllImport("ode", EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity] | ||
918 | public static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref dReal M00); | ||
919 | |||
920 | [DllImport("ode", EntryPoint = "dGeomSetPosition"), SuppressUnmanagedCodeSecurity] | ||
921 | public static extern void GeomSetPosition(IntPtr geom, dReal x, dReal y, dReal z); | ||
922 | |||
923 | [DllImport("ode", EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
924 | public static extern void GeomSetQuaternion(IntPtr geom, ref Quaternion quat); | ||
925 | |||
926 | [DllImport("ode", EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity] | ||
927 | public static extern void GeomSetQuaternion(IntPtr geom, ref dReal w); | ||
928 | |||
929 | [DllImport("ode", EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] | ||
930 | public static extern void GeomSetRotation(IntPtr geom, ref Matrix3 R); | ||
931 | |||
932 | [DllImport("ode", EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity] | ||
933 | public static extern void GeomSetRotation(IntPtr geom, ref dReal M00); | ||
934 | |||
935 | [DllImport("ode", EntryPoint = "dGeomSphereGetRadius"), SuppressUnmanagedCodeSecurity] | ||
936 | public static extern dReal GeomSphereGetRadius(IntPtr geom); | ||
937 | |||
938 | [DllImport("ode", EntryPoint = "dGeomSpherePointDepth"), SuppressUnmanagedCodeSecurity] | ||
939 | public static extern dReal GeomSpherePointDepth(IntPtr geom, dReal x, dReal y, dReal z); | ||
940 | |||
941 | [DllImport("ode", EntryPoint = "dGeomSphereSetRadius"), SuppressUnmanagedCodeSecurity] | ||
942 | public static extern void GeomSphereSetRadius(IntPtr geom, dReal radius); | ||
943 | |||
944 | [DllImport("ode", EntryPoint = "dGeomTransformGetCleanup"), SuppressUnmanagedCodeSecurity] | ||
945 | public static extern int GeomTransformGetCleanup(IntPtr geom); | ||
946 | |||
947 | [DllImport("ode", EntryPoint = "dGeomTransformGetGeom"), SuppressUnmanagedCodeSecurity] | ||
948 | public static extern IntPtr GeomTransformGetGeom(IntPtr geom); | ||
949 | |||
950 | [DllImport("ode", EntryPoint = "dGeomTransformGetInfo"), SuppressUnmanagedCodeSecurity] | ||
951 | public static extern int GeomTransformGetInfo(IntPtr geom); | ||
952 | |||
953 | [DllImport("ode", EntryPoint = "dGeomTransformSetCleanup"), SuppressUnmanagedCodeSecurity] | ||
954 | public static extern void GeomTransformSetCleanup(IntPtr geom, int mode); | ||
955 | |||
956 | [DllImport("ode", EntryPoint = "dGeomTransformSetGeom"), SuppressUnmanagedCodeSecurity] | ||
957 | public static extern void GeomTransformSetGeom(IntPtr geom, IntPtr obj); | ||
958 | |||
959 | [DllImport("ode", EntryPoint = "dGeomTransformSetInfo"), SuppressUnmanagedCodeSecurity] | ||
960 | public static extern void GeomTransformSetInfo(IntPtr geom, int info); | ||
961 | |||
962 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] | ||
963 | public static extern void GeomTriMeshDataBuildDouble(IntPtr d, | ||
964 | double[] vertices, int vertexStride, int vertexCount, | ||
965 | int[] indices, int indexCount, int triStride); | ||
966 | |||
967 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity] | ||
968 | public static extern void GeomTriMeshDataBuildDouble(IntPtr d, | ||
969 | IntPtr vertices, int vertexStride, int vertexCount, | ||
970 | IntPtr indices, int indexCount, int triStride); | ||
971 | |||
972 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] | ||
973 | public static extern void GeomTriMeshDataBuildDouble1(IntPtr d, | ||
974 | double[] vertices, int vertexStride, int vertexCount, | ||
975 | int[] indices, int indexCount, int triStride, | ||
976 | double[] normals); | ||
977 | |||
978 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity] | ||
979 | public static extern void GeomTriMeshDataBuildDouble(IntPtr d, | ||
980 | IntPtr vertices, int vertexStride, int vertexCount, | ||
981 | IntPtr indices, int indexCount, int triStride, | ||
982 | IntPtr normals); | ||
983 | |||
984 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] | ||
985 | public static extern void GeomTriMeshDataBuildSingle(IntPtr d, | ||
986 | dReal[] vertices, int vertexStride, int vertexCount, | ||
987 | int[] indices, int indexCount, int triStride); | ||
988 | |||
989 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity] | ||
990 | public static extern void GeomTriMeshDataBuildSingle(IntPtr d, | ||
991 | IntPtr vertices, int vertexStride, int vertexCount, | ||
992 | IntPtr indices, int indexCount, int triStride); | ||
993 | |||
994 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] | ||
995 | public static extern void GeomTriMeshDataBuildSingle1(IntPtr d, | ||
996 | dReal[] vertices, int vertexStride, int vertexCount, | ||
997 | int[] indices, int indexCount, int triStride, | ||
998 | dReal[] normals); | ||
999 | |||
1000 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity] | ||
1001 | public static extern void GeomTriMeshDataBuildSingle1(IntPtr d, | ||
1002 | IntPtr vertices, int vertexStride, int vertexCount, | ||
1003 | IntPtr indices, int indexCount, int triStride, | ||
1004 | IntPtr normals); | ||
1005 | |||
1006 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] | ||
1007 | public static extern void GeomTriMeshDataBuildSimple(IntPtr d, | ||
1008 | float[] vertices, int vertexStride, int vertexCount, | ||
1009 | int[] indices, int indexCount, int triStride); | ||
1010 | |||
1011 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity] | ||
1012 | public static extern void GeomTriMeshDataBuildSimple(IntPtr d, | ||
1013 | IntPtr vertices, int vertexStride, int vertexCount, | ||
1014 | IntPtr indices, int indexCount, int triStride); | ||
1015 | |||
1016 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] | ||
1017 | public static extern void GeomTriMeshDataBuildSimple1(IntPtr d, | ||
1018 | float[] vertices, int vertexStride, int vertexCount, | ||
1019 | int[] indices, int indexCount, int triStride, | ||
1020 | float[] normals); | ||
1021 | |||
1022 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity] | ||
1023 | public static extern void GeomTriMeshDataBuildSimple1(IntPtr d, | ||
1024 | IntPtr vertices, int vertexStride, int vertexCount, | ||
1025 | IntPtr indices, int indexCount, int triStride, | ||
1026 | IntPtr normals); | ||
1027 | |||
1028 | [DllImport("ode", EntryPoint = "dGeomTriMeshClearTCCache"), SuppressUnmanagedCodeSecurity] | ||
1029 | public static extern void GeomTriMeshClearTCCache(IntPtr g); | ||
1030 | |||
1031 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataCreate"), SuppressUnmanagedCodeSecurity] | ||
1032 | public static extern IntPtr GeomTriMeshDataCreate(); | ||
1033 | |||
1034 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataDestroy"), SuppressUnmanagedCodeSecurity] | ||
1035 | public static extern void GeomTriMeshDataDestroy(IntPtr d); | ||
1036 | |||
1037 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataGet"), SuppressUnmanagedCodeSecurity] | ||
1038 | public static extern IntPtr GeomTriMeshDataGet(IntPtr d, int data_id); | ||
1039 | |||
1040 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataPreprocess"), SuppressUnmanagedCodeSecurity] | ||
1041 | public static extern void GeomTriMeshDataPreprocess(IntPtr d); | ||
1042 | |||
1043 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataSet"), SuppressUnmanagedCodeSecurity] | ||
1044 | public static extern void GeomTriMeshDataSet(IntPtr d, int data_id, IntPtr in_data); | ||
1045 | |||
1046 | [DllImport("ode", EntryPoint = "dGeomTriMeshDataUpdate"), SuppressUnmanagedCodeSecurity] | ||
1047 | public static extern void GeomTriMeshDataUpdate(IntPtr d); | ||
1048 | |||
1049 | [DllImport("ode", EntryPoint = "dGeomTriMeshEnableTC"), SuppressUnmanagedCodeSecurity] | ||
1050 | public static extern void GeomTriMeshEnableTC(IntPtr g, int geomClass, bool enable); | ||
1051 | |||
1052 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetArrayCallback"), SuppressUnmanagedCodeSecurity] | ||
1053 | public static extern TriArrayCallback GeomTriMeshGetArrayCallback(IntPtr g); | ||
1054 | |||
1055 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetCallback"), SuppressUnmanagedCodeSecurity] | ||
1056 | public static extern TriCallback GeomTriMeshGetCallback(IntPtr g); | ||
1057 | |||
1058 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetData"), SuppressUnmanagedCodeSecurity] | ||
1059 | public static extern IntPtr GeomTriMeshGetData(IntPtr g); | ||
1060 | |||
1061 | #if !dNO_UNSAFE_CODE | ||
1062 | [CLSCompliant(false)] | ||
1063 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetLastTransform"), SuppressUnmanagedCodeSecurity] | ||
1064 | public extern unsafe static Matrix4* GeomTriMeshGetLastTransformUnsafe(IntPtr geom); | ||
1065 | public static Matrix4 GeomTriMeshGetLastTransform(IntPtr geom) | ||
1066 | { | ||
1067 | unsafe { return *(GeomTriMeshGetLastTransformUnsafe(geom)); } | ||
1068 | } | ||
1069 | #endif | ||
1070 | |||
1071 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetPoint"), SuppressUnmanagedCodeSecurity] | ||
1072 | public extern static void GeomTriMeshGetPoint(IntPtr g, int index, dReal u, dReal v, ref Vector3 outVec); | ||
1073 | |||
1074 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetRayCallback"), SuppressUnmanagedCodeSecurity] | ||
1075 | public static extern TriRayCallback GeomTriMeshGetRayCallback(IntPtr g); | ||
1076 | |||
1077 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetTriangle"), SuppressUnmanagedCodeSecurity] | ||
1078 | public extern static void GeomTriMeshGetTriangle(IntPtr g, int index, ref Vector3 v0, ref Vector3 v1, ref Vector3 v2); | ||
1079 | |||
1080 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetTriangleCount"), SuppressUnmanagedCodeSecurity] | ||
1081 | public extern static int GeomTriMeshGetTriangleCount(IntPtr g); | ||
1082 | |||
1083 | [DllImport("ode", EntryPoint = "dGeomTriMeshGetTriMeshDataID"), SuppressUnmanagedCodeSecurity] | ||
1084 | public static extern IntPtr GeomTriMeshGetTriMeshDataID(IntPtr g); | ||
1085 | |||
1086 | [DllImport("ode", EntryPoint = "dGeomTriMeshIsTCEnabled"), SuppressUnmanagedCodeSecurity] | ||
1087 | public static extern bool GeomTriMeshIsTCEnabled(IntPtr g, int geomClass); | ||
1088 | |||
1089 | [DllImport("ode", EntryPoint = "dGeomTriMeshSetArrayCallback"), SuppressUnmanagedCodeSecurity] | ||
1090 | public static extern void GeomTriMeshSetArrayCallback(IntPtr g, TriArrayCallback arrayCallback); | ||
1091 | |||
1092 | [DllImport("ode", EntryPoint = "dGeomTriMeshSetCallback"), SuppressUnmanagedCodeSecurity] | ||
1093 | public static extern void GeomTriMeshSetCallback(IntPtr g, TriCallback callback); | ||
1094 | |||
1095 | [DllImport("ode", EntryPoint = "dGeomTriMeshSetData"), SuppressUnmanagedCodeSecurity] | ||
1096 | public static extern void GeomTriMeshSetData(IntPtr g, IntPtr data); | ||
1097 | |||
1098 | [DllImport("ode", EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] | ||
1099 | public static extern void GeomTriMeshSetLastTransform(IntPtr g, ref Matrix4 last_trans); | ||
1100 | |||
1101 | [DllImport("ode", EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity] | ||
1102 | public static extern void GeomTriMeshSetLastTransform(IntPtr g, ref dReal M00); | ||
1103 | |||
1104 | [DllImport("ode", EntryPoint = "dGeomTriMeshSetRayCallback"), SuppressUnmanagedCodeSecurity] | ||
1105 | public static extern void GeomTriMeshSetRayCallback(IntPtr g, TriRayCallback callback); | ||
1106 | |||
1107 | [DllImport("ode", EntryPoint = "dHashSpaceCreate"), SuppressUnmanagedCodeSecurity] | ||
1108 | public static extern IntPtr HashSpaceCreate(IntPtr space); | ||
1109 | |||
1110 | [DllImport("ode", EntryPoint = "dHashSpaceGetLevels"), SuppressUnmanagedCodeSecurity] | ||
1111 | public static extern void HashSpaceGetLevels(IntPtr space, out int minlevel, out int maxlevel); | ||
1112 | |||
1113 | [DllImport("ode", EntryPoint = "dHashSpaceSetLevels"), SuppressUnmanagedCodeSecurity] | ||
1114 | public static extern void HashSpaceSetLevels(IntPtr space, int minlevel, int maxlevel); | ||
1115 | |||
1116 | [DllImport("ode", EntryPoint = "dInfiniteAABB"), SuppressUnmanagedCodeSecurity] | ||
1117 | public static extern void InfiniteAABB(IntPtr geom, out AABB aabb); | ||
1118 | |||
1119 | [DllImport("ode", EntryPoint = "dInitODE"), SuppressUnmanagedCodeSecurity] | ||
1120 | public static extern void InitODE(); | ||
1121 | |||
1122 | [DllImport("ode", EntryPoint = "dIsPositiveDefinite"), SuppressUnmanagedCodeSecurity] | ||
1123 | public static extern int IsPositiveDefinite(ref dReal A, int n); | ||
1124 | |||
1125 | [DllImport("ode", EntryPoint = "dInvertPDMatrix"), SuppressUnmanagedCodeSecurity] | ||
1126 | public static extern int InvertPDMatrix(ref dReal A, out dReal Ainv, int n); | ||
1127 | |||
1128 | [DllImport("ode", EntryPoint = "dJointAddAMotorTorques"), SuppressUnmanagedCodeSecurity] | ||
1129 | public static extern void JointAddAMotorTorques(IntPtr joint, dReal torque1, dReal torque2, dReal torque3); | ||
1130 | |||
1131 | [DllImport("ode", EntryPoint = "dJointAddHingeTorque"), SuppressUnmanagedCodeSecurity] | ||
1132 | public static extern void JointAddHingeTorque(IntPtr joint, dReal torque); | ||
1133 | |||
1134 | [DllImport("ode", EntryPoint = "dJointAddHinge2Torque"), SuppressUnmanagedCodeSecurity] | ||
1135 | public static extern void JointAddHinge2Torques(IntPtr joint, dReal torque1, dReal torque2); | ||
1136 | |||
1137 | [DllImport("ode", EntryPoint = "dJointAddPRTorque"), SuppressUnmanagedCodeSecurity] | ||
1138 | public static extern void JointAddPRTorque(IntPtr joint, dReal torque); | ||
1139 | |||
1140 | [DllImport("ode", EntryPoint = "dJointAddUniversalTorque"), SuppressUnmanagedCodeSecurity] | ||
1141 | public static extern void JointAddUniversalTorques(IntPtr joint, dReal torque1, dReal torque2); | ||
1142 | |||
1143 | [DllImport("ode", EntryPoint = "dJointAddSliderForce"), SuppressUnmanagedCodeSecurity] | ||
1144 | public static extern void JointAddSliderForce(IntPtr joint, dReal force); | ||
1145 | |||
1146 | [DllImport("ode", EntryPoint = "dJointAttach"), SuppressUnmanagedCodeSecurity] | ||
1147 | public static extern void JointAttach(IntPtr joint, IntPtr body1, IntPtr body2); | ||
1148 | |||
1149 | [DllImport("ode", EntryPoint = "dJointCreateAMotor"), SuppressUnmanagedCodeSecurity] | ||
1150 | public static extern IntPtr JointCreateAMotor(IntPtr world, IntPtr group); | ||
1151 | |||
1152 | [DllImport("ode", EntryPoint = "dJointCreateBall"), SuppressUnmanagedCodeSecurity] | ||
1153 | public static extern IntPtr JointCreateBall(IntPtr world, IntPtr group); | ||
1154 | |||
1155 | [DllImport("ode", EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity] | ||
1156 | public static extern IntPtr JointCreateContact(IntPtr world, IntPtr group, ref Contact contact); | ||
1157 | |||
1158 | [DllImport("ode", EntryPoint = "dJointCreateFixed"), SuppressUnmanagedCodeSecurity] | ||
1159 | public static extern IntPtr JointCreateFixed(IntPtr world, IntPtr group); | ||
1160 | |||
1161 | [DllImport("ode", EntryPoint = "dJointCreateHinge"), SuppressUnmanagedCodeSecurity] | ||
1162 | public static extern IntPtr JointCreateHinge(IntPtr world, IntPtr group); | ||
1163 | |||
1164 | [DllImport("ode", EntryPoint = "dJointCreateHinge2"), SuppressUnmanagedCodeSecurity] | ||
1165 | public static extern IntPtr JointCreateHinge2(IntPtr world, IntPtr group); | ||
1166 | |||
1167 | [DllImport("ode", EntryPoint = "dJointCreateLMotor"), SuppressUnmanagedCodeSecurity] | ||
1168 | public static extern IntPtr JointCreateLMotor(IntPtr world, IntPtr group); | ||
1169 | |||
1170 | [DllImport("ode", EntryPoint = "dJointCreateNull"), SuppressUnmanagedCodeSecurity] | ||
1171 | public static extern IntPtr JointCreateNull(IntPtr world, IntPtr group); | ||
1172 | |||
1173 | [DllImport("ode", EntryPoint = "dJointCreatePR"), SuppressUnmanagedCodeSecurity] | ||
1174 | public static extern IntPtr JointCreatePR(IntPtr world, IntPtr group); | ||
1175 | |||
1176 | [DllImport("ode", EntryPoint = "dJointCreatePlane2D"), SuppressUnmanagedCodeSecurity] | ||
1177 | public static extern IntPtr JointCreatePlane2D(IntPtr world, IntPtr group); | ||
1178 | |||
1179 | [DllImport("ode", EntryPoint = "dJointCreateSlider"), SuppressUnmanagedCodeSecurity] | ||
1180 | public static extern IntPtr JointCreateSlider(IntPtr world, IntPtr group); | ||
1181 | |||
1182 | [DllImport("ode", EntryPoint = "dJointCreateUniversal"), SuppressUnmanagedCodeSecurity] | ||
1183 | public static extern IntPtr JointCreateUniversal(IntPtr world, IntPtr group); | ||
1184 | |||
1185 | [DllImport("ode", EntryPoint = "dJointDestroy"), SuppressUnmanagedCodeSecurity] | ||
1186 | public static extern void JointDestroy(IntPtr j); | ||
1187 | |||
1188 | [DllImport("ode", EntryPoint = "dJointGetAMotorAngle"), SuppressUnmanagedCodeSecurity] | ||
1189 | public static extern dReal JointGetAMotorAngle(IntPtr j, int anum); | ||
1190 | |||
1191 | [DllImport("ode", EntryPoint = "dJointGetAMotorAngleRate"), SuppressUnmanagedCodeSecurity] | ||
1192 | public static extern dReal JointGetAMotorAngleRate(IntPtr j, int anum); | ||
1193 | |||
1194 | [DllImport("ode", EntryPoint = "dJointGetAMotorAxis"), SuppressUnmanagedCodeSecurity] | ||
1195 | public static extern void JointGetAMotorAxis(IntPtr j, int anum, out Vector3 result); | ||
1196 | |||
1197 | [DllImport("ode", EntryPoint = "dJointGetAMotorAxisRel"), SuppressUnmanagedCodeSecurity] | ||
1198 | public static extern int JointGetAMotorAxisRel(IntPtr j, int anum); | ||
1199 | |||
1200 | [DllImport("ode", EntryPoint = "dJointGetAMotorMode"), SuppressUnmanagedCodeSecurity] | ||
1201 | public static extern int JointGetAMotorMode(IntPtr j); | ||
1202 | |||
1203 | [DllImport("ode", EntryPoint = "dJointGetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] | ||
1204 | public static extern int JointGetAMotorNumAxes(IntPtr j); | ||
1205 | |||
1206 | [DllImport("ode", EntryPoint = "dJointGetAMotorParam"), SuppressUnmanagedCodeSecurity] | ||
1207 | public static extern dReal JointGetAMotorParam(IntPtr j, int parameter); | ||
1208 | |||
1209 | [DllImport("ode", EntryPoint = "dJointGetBallAnchor"), SuppressUnmanagedCodeSecurity] | ||
1210 | public static extern void JointGetBallAnchor(IntPtr j, out Vector3 result); | ||
1211 | |||
1212 | [DllImport("ode", EntryPoint = "dJointGetBallAnchor2"), SuppressUnmanagedCodeSecurity] | ||
1213 | public static extern void JointGetBallAnchor2(IntPtr j, out Vector3 result); | ||
1214 | |||
1215 | [DllImport("ode", EntryPoint = "dJointGetBody"), SuppressUnmanagedCodeSecurity] | ||
1216 | public static extern IntPtr JointGetBody(IntPtr j); | ||
1217 | |||
1218 | [DllImport("ode", EntryPoint = "dJointGetData"), SuppressUnmanagedCodeSecurity] | ||
1219 | public static extern IntPtr JointGetData(IntPtr j); | ||
1220 | |||
1221 | #if !dNO_UNSAFE_CODE | ||
1222 | [CLSCompliant(false)] | ||
1223 | [DllImport("ode", EntryPoint = "dJointGetFeedback"), SuppressUnmanagedCodeSecurity] | ||
1224 | public extern unsafe static JointFeedback* JointGetFeedbackUnsafe(IntPtr j); | ||
1225 | public static JointFeedback JointGetFeedback(IntPtr j) | ||
1226 | { | ||
1227 | unsafe { return *(JointGetFeedbackUnsafe(j)); } | ||
1228 | } | ||
1229 | #endif | ||
1230 | |||
1231 | [DllImport("ode", EntryPoint = "dJointGetHingeAnchor"), SuppressUnmanagedCodeSecurity] | ||
1232 | public static extern void JointGetHingeAnchor(IntPtr j, out Vector3 result); | ||
1233 | |||
1234 | [DllImport("ode", EntryPoint = "dJointGetHingeAngle"), SuppressUnmanagedCodeSecurity] | ||
1235 | public static extern dReal JointGetHingeAngle(IntPtr j); | ||
1236 | |||
1237 | [DllImport("ode", EntryPoint = "dJointGetHingeAngleRate"), SuppressUnmanagedCodeSecurity] | ||
1238 | public static extern dReal JointGetHingeAngleRate(IntPtr j); | ||
1239 | |||
1240 | [DllImport("ode", EntryPoint = "dJointGetHingeAxis"), SuppressUnmanagedCodeSecurity] | ||
1241 | public static extern void JointGetHingeAxis(IntPtr j, out Vector3 result); | ||
1242 | |||
1243 | [DllImport("ode", EntryPoint = "dJointGetHingeParam"), SuppressUnmanagedCodeSecurity] | ||
1244 | public static extern dReal JointGetHingeParam(IntPtr j, int parameter); | ||
1245 | |||
1246 | [DllImport("ode", EntryPoint = "dJointGetHinge2Angle1"), SuppressUnmanagedCodeSecurity] | ||
1247 | public static extern dReal JointGetHinge2Angle1(IntPtr j); | ||
1248 | |||
1249 | [DllImport("ode", EntryPoint = "dJointGetHinge2Angle1Rate"), SuppressUnmanagedCodeSecurity] | ||
1250 | public static extern dReal JointGetHinge2Angle1Rate(IntPtr j); | ||
1251 | |||
1252 | [DllImport("ode", EntryPoint = "dJointGetHinge2Angle2Rate"), SuppressUnmanagedCodeSecurity] | ||
1253 | public static extern dReal JointGetHinge2Angle2Rate(IntPtr j); | ||
1254 | |||
1255 | [DllImport("ode", EntryPoint = "dJointGetHingeAnchor2"), SuppressUnmanagedCodeSecurity] | ||
1256 | public static extern void JointGetHingeAnchor2(IntPtr j, out Vector3 result); | ||
1257 | |||
1258 | [DllImport("ode", EntryPoint = "dJointGetHinge2Anchor"), SuppressUnmanagedCodeSecurity] | ||
1259 | public static extern void JointGetHinge2Anchor(IntPtr j, out Vector3 result); | ||
1260 | |||
1261 | [DllImport("ode", EntryPoint = "dJointGetHinge2Anchor2"), SuppressUnmanagedCodeSecurity] | ||
1262 | public static extern void JointGetHinge2Anchor2(IntPtr j, out Vector3 result); | ||
1263 | |||
1264 | [DllImport("ode", EntryPoint = "dJointGetHinge2Axis1"), SuppressUnmanagedCodeSecurity] | ||
1265 | public static extern void JointGetHinge2Axis1(IntPtr j, out Vector3 result); | ||
1266 | |||
1267 | [DllImport("ode", EntryPoint = "dJointGetHinge2Axis2"), SuppressUnmanagedCodeSecurity] | ||
1268 | public static extern void JointGetHinge2Axis2(IntPtr j, out Vector3 result); | ||
1269 | |||
1270 | [DllImport("ode", EntryPoint = "dJointGetHinge2Param"), SuppressUnmanagedCodeSecurity] | ||
1271 | public static extern dReal JointGetHinge2Param(IntPtr j, int parameter); | ||
1272 | |||
1273 | [DllImport("ode", EntryPoint = "dJointGetLMotorAxis"), SuppressUnmanagedCodeSecurity] | ||
1274 | public static extern void JointGetLMotorAxis(IntPtr j, int anum, out Vector3 result); | ||
1275 | |||
1276 | [DllImport("ode", EntryPoint = "dJointGetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] | ||
1277 | public static extern int JointGetLMotorNumAxes(IntPtr j); | ||
1278 | |||
1279 | [DllImport("ode", EntryPoint = "dJointGetLMotorParam"), SuppressUnmanagedCodeSecurity] | ||
1280 | public static extern dReal JointGetLMotorParam(IntPtr j, int parameter); | ||
1281 | |||
1282 | [DllImport("ode", EntryPoint = "dJointGetPRAnchor"), SuppressUnmanagedCodeSecurity] | ||
1283 | public static extern void JointGetPRAnchor(IntPtr j, out Vector3 result); | ||
1284 | |||
1285 | [DllImport("ode", EntryPoint = "dJointGetPRAxis1"), SuppressUnmanagedCodeSecurity] | ||
1286 | public static extern void JointGetPRAxis1(IntPtr j, out Vector3 result); | ||
1287 | |||
1288 | [DllImport("ode", EntryPoint = "dJointGetPRAxis2"), SuppressUnmanagedCodeSecurity] | ||
1289 | public static extern void JointGetPRAxis2(IntPtr j, out Vector3 result); | ||
1290 | |||
1291 | [DllImport("ode", EntryPoint = "dJointGetPRParam"), SuppressUnmanagedCodeSecurity] | ||
1292 | public static extern dReal JointGetPRParam(IntPtr j, int parameter); | ||
1293 | |||
1294 | [DllImport("ode", EntryPoint = "dJointGetPRPosition"), SuppressUnmanagedCodeSecurity] | ||
1295 | public static extern dReal JointGetPRPosition(IntPtr j); | ||
1296 | |||
1297 | [DllImport("ode", EntryPoint = "dJointGetPRPositionRate"), SuppressUnmanagedCodeSecurity] | ||
1298 | public static extern dReal JointGetPRPositionRate(IntPtr j); | ||
1299 | |||
1300 | [DllImport("ode", EntryPoint = "dJointGetSliderAxis"), SuppressUnmanagedCodeSecurity] | ||
1301 | public static extern void JointGetSliderAxis(IntPtr j, out Vector3 result); | ||
1302 | |||
1303 | [DllImport("ode", EntryPoint = "dJointGetSliderParam"), SuppressUnmanagedCodeSecurity] | ||
1304 | public static extern dReal JointGetSliderParam(IntPtr j, int parameter); | ||
1305 | |||
1306 | [DllImport("ode", EntryPoint = "dJointGetSliderPosition"), SuppressUnmanagedCodeSecurity] | ||
1307 | public static extern dReal JointGetSliderPosition(IntPtr j); | ||
1308 | |||
1309 | [DllImport("ode", EntryPoint = "dJointGetSliderPositionRate"), SuppressUnmanagedCodeSecurity] | ||
1310 | public static extern dReal JointGetSliderPositionRate(IntPtr j); | ||
1311 | |||
1312 | [DllImport("ode", EntryPoint = "dJointGetType"), SuppressUnmanagedCodeSecurity] | ||
1313 | public static extern JointType JointGetType(IntPtr j); | ||
1314 | |||
1315 | [DllImport("ode", EntryPoint = "dJointGetUniversalAnchor"), SuppressUnmanagedCodeSecurity] | ||
1316 | public static extern void JointGetUniversalAnchor(IntPtr j, out Vector3 result); | ||
1317 | |||
1318 | [DllImport("ode", EntryPoint = "dJointGetUniversalAnchor2"), SuppressUnmanagedCodeSecurity] | ||
1319 | public static extern void JointGetUniversalAnchor2(IntPtr j, out Vector3 result); | ||
1320 | |||
1321 | [DllImport("ode", EntryPoint = "dJointGetUniversalAngle1"), SuppressUnmanagedCodeSecurity] | ||
1322 | public static extern dReal JointGetUniversalAngle1(IntPtr j); | ||
1323 | |||
1324 | [DllImport("ode", EntryPoint = "dJointGetUniversalAngle1Rate"), SuppressUnmanagedCodeSecurity] | ||
1325 | public static extern dReal JointGetUniversalAngle1Rate(IntPtr j); | ||
1326 | |||
1327 | [DllImport("ode", EntryPoint = "dJointGetUniversalAngle2"), SuppressUnmanagedCodeSecurity] | ||
1328 | public static extern dReal JointGetUniversalAngle2(IntPtr j); | ||
1329 | |||
1330 | [DllImport("ode", EntryPoint = "dJointGetUniversalAngle2Rate"), SuppressUnmanagedCodeSecurity] | ||
1331 | public static extern dReal JointGetUniversalAngle2Rate(IntPtr j); | ||
1332 | |||
1333 | [DllImport("ode", EntryPoint = "dJointGetUniversalAngles"), SuppressUnmanagedCodeSecurity] | ||
1334 | public static extern void JointGetUniversalAngles(IntPtr j, out dReal angle1, out dReal angle2); | ||
1335 | |||
1336 | [DllImport("ode", EntryPoint = "dJointGetUniversalAxis1"), SuppressUnmanagedCodeSecurity] | ||
1337 | public static extern void JointGetUniversalAxis1(IntPtr j, out Vector3 result); | ||
1338 | |||
1339 | [DllImport("ode", EntryPoint = "dJointGetUniversalAxis2"), SuppressUnmanagedCodeSecurity] | ||
1340 | public static extern void JointGetUniversalAxis2(IntPtr j, out Vector3 result); | ||
1341 | |||
1342 | [DllImport("ode", EntryPoint = "dJointGetUniversalParam"), SuppressUnmanagedCodeSecurity] | ||
1343 | public static extern dReal JointGetUniversalParam(IntPtr j, int parameter); | ||
1344 | |||
1345 | [DllImport("ode", EntryPoint = "dJointGroupCreate"), SuppressUnmanagedCodeSecurity] | ||
1346 | public static extern IntPtr JointGroupCreate(int max_size); | ||
1347 | |||
1348 | [DllImport("ode", EntryPoint = "dJointGroupDestroy"), SuppressUnmanagedCodeSecurity] | ||
1349 | public static extern void JointGroupDestroy(IntPtr group); | ||
1350 | |||
1351 | [DllImport("ode", EntryPoint = "dJointGroupEmpty"), SuppressUnmanagedCodeSecurity] | ||
1352 | public static extern void JointGroupEmpty(IntPtr group); | ||
1353 | |||
1354 | [DllImport("ode", EntryPoint = "dJointSetAMotorAngle"), SuppressUnmanagedCodeSecurity] | ||
1355 | public static extern void JointSetAMotorAngle(IntPtr j, int anum, dReal angle); | ||
1356 | |||
1357 | [DllImport("ode", EntryPoint = "dJointSetAMotorAxis"), SuppressUnmanagedCodeSecurity] | ||
1358 | public static extern void JointSetAMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); | ||
1359 | |||
1360 | [DllImport("ode", EntryPoint = "dJointSetAMotorMode"), SuppressUnmanagedCodeSecurity] | ||
1361 | public static extern void JointSetAMotorMode(IntPtr j, int mode); | ||
1362 | |||
1363 | [DllImport("ode", EntryPoint = "dJointSetAMotorNumAxes"), SuppressUnmanagedCodeSecurity] | ||
1364 | public static extern void JointSetAMotorNumAxes(IntPtr group, int num); | ||
1365 | |||
1366 | [DllImport("ode", EntryPoint = "dJointSetAMotorParam"), SuppressUnmanagedCodeSecurity] | ||
1367 | public static extern void JointSetAMotorParam(IntPtr group, int parameter, dReal value); | ||
1368 | |||
1369 | [DllImport("ode", EntryPoint = "dJointSetBallAnchor"), SuppressUnmanagedCodeSecurity] | ||
1370 | public static extern void JointSetBallAnchor(IntPtr j, dReal x, dReal y, dReal z); | ||
1371 | |||
1372 | [DllImport("ode", EntryPoint = "dJointSetBallAnchor2"), SuppressUnmanagedCodeSecurity] | ||
1373 | public static extern void JointSetBallAnchor2(IntPtr j, dReal x, dReal y, dReal z); | ||
1374 | |||
1375 | [DllImport("ode", EntryPoint = "dJointSetData"), SuppressUnmanagedCodeSecurity] | ||
1376 | public static extern void JointSetData(IntPtr j, IntPtr data); | ||
1377 | |||
1378 | [DllImport("ode", EntryPoint = "dJointSetFeedback"), SuppressUnmanagedCodeSecurity] | ||
1379 | public static extern void JointSetFeedback(IntPtr j, out JointFeedback feedback); | ||
1380 | |||
1381 | [DllImport("ode", EntryPoint = "dJointSetFixed"), SuppressUnmanagedCodeSecurity] | ||
1382 | public static extern void JointSetFixed(IntPtr j); | ||
1383 | |||
1384 | [DllImport("ode", EntryPoint = "dJointSetHingeAnchor"), SuppressUnmanagedCodeSecurity] | ||
1385 | public static extern void JointSetHingeAnchor(IntPtr j, dReal x, dReal y, dReal z); | ||
1386 | |||
1387 | [DllImport("ode", EntryPoint = "dJointSetHingeAnchorDelta"), SuppressUnmanagedCodeSecurity] | ||
1388 | public static extern void JointSetHingeAnchorDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); | ||
1389 | |||
1390 | [DllImport("ode", EntryPoint = "dJointSetHingeAxis"), SuppressUnmanagedCodeSecurity] | ||
1391 | public static extern void JointSetHingeAxis(IntPtr j, dReal x, dReal y, dReal z); | ||
1392 | |||
1393 | [DllImport("ode", EntryPoint = "dJointSetHingeParam"), SuppressUnmanagedCodeSecurity] | ||
1394 | public static extern void JointSetHingeParam(IntPtr j, int parameter, dReal value); | ||
1395 | |||
1396 | [DllImport("ode", EntryPoint = "dJointSetHinge2Anchor"), SuppressUnmanagedCodeSecurity] | ||
1397 | public static extern void JointSetHinge2Anchor(IntPtr j, dReal x, dReal y, dReal z); | ||
1398 | |||
1399 | [DllImport("ode", EntryPoint = "dJointSetHinge2Axis1"), SuppressUnmanagedCodeSecurity] | ||
1400 | public static extern void JointSetHinge2Axis1(IntPtr j, dReal x, dReal y, dReal z); | ||
1401 | |||
1402 | [DllImport("ode", EntryPoint = "dJointSetHinge2Axis2"), SuppressUnmanagedCodeSecurity] | ||
1403 | public static extern void JointSetHinge2Axis2(IntPtr j, dReal x, dReal y, dReal z); | ||
1404 | |||
1405 | [DllImport("ode", EntryPoint = "dJointSetHinge2Param"), SuppressUnmanagedCodeSecurity] | ||
1406 | public static extern void JointSetHinge2Param(IntPtr j, int parameter, dReal value); | ||
1407 | |||
1408 | [DllImport("ode", EntryPoint = "dJointSetLMotorAxis"), SuppressUnmanagedCodeSecurity] | ||
1409 | public static extern void JointSetLMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z); | ||
1410 | |||
1411 | [DllImport("ode", EntryPoint = "dJointSetLMotorNumAxes"), SuppressUnmanagedCodeSecurity] | ||
1412 | public static extern void JointSetLMotorNumAxes(IntPtr j, int num); | ||
1413 | |||
1414 | [DllImport("ode", EntryPoint = "dJointSetLMotorParam"), SuppressUnmanagedCodeSecurity] | ||
1415 | public static extern void JointSetLMotorParam(IntPtr j, int parameter, dReal value); | ||
1416 | |||
1417 | [DllImport("ode", EntryPoint = "dJointSetPlane2DAngleParam"), SuppressUnmanagedCodeSecurity] | ||
1418 | public static extern void JointSetPlane2DAngleParam(IntPtr j, int parameter, dReal value); | ||
1419 | |||
1420 | [DllImport("ode", EntryPoint = "dJointSetPlane2DXParam"), SuppressUnmanagedCodeSecurity] | ||
1421 | public static extern void JointSetPlane2DXParam(IntPtr j, int parameter, dReal value); | ||
1422 | |||
1423 | [DllImport("ode", EntryPoint = "dJointSetPlane2DYParam"), SuppressUnmanagedCodeSecurity] | ||
1424 | public static extern void JointSetPlane2DYParam(IntPtr j, int parameter, dReal value); | ||
1425 | |||
1426 | [DllImport("ode", EntryPoint = "dJointSetPRAnchor"), SuppressUnmanagedCodeSecurity] | ||
1427 | public static extern void JointSetPRAnchor(IntPtr j, dReal x, dReal y, dReal z); | ||
1428 | |||
1429 | [DllImport("ode", EntryPoint = "dJointSetPRAxis1"), SuppressUnmanagedCodeSecurity] | ||
1430 | public static extern void JointSetPRAxis1(IntPtr j, dReal x, dReal y, dReal z); | ||
1431 | |||
1432 | [DllImport("ode", EntryPoint = "dJointSetPRAxis2"), SuppressUnmanagedCodeSecurity] | ||
1433 | public static extern void JointSetPRAxis2(IntPtr j, dReal x, dReal y, dReal z); | ||
1434 | |||
1435 | [DllImport("ode", EntryPoint = "dJointSetPRParam"), SuppressUnmanagedCodeSecurity] | ||
1436 | public static extern void JointSetPRParam(IntPtr j, int parameter, dReal value); | ||
1437 | |||
1438 | [DllImport("ode", EntryPoint = "dJointSetSliderAxis"), SuppressUnmanagedCodeSecurity] | ||
1439 | public static extern void JointSetSliderAxis(IntPtr j, dReal x, dReal y, dReal z); | ||
1440 | |||
1441 | [DllImport("ode", EntryPoint = "dJointSetSliderAxisDelta"), SuppressUnmanagedCodeSecurity] | ||
1442 | public static extern void JointSetSliderAxisDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az); | ||
1443 | |||
1444 | [DllImport("ode", EntryPoint = "dJointSetSliderParam"), SuppressUnmanagedCodeSecurity] | ||
1445 | public static extern void JointSetSliderParam(IntPtr j, int parameter, dReal value); | ||
1446 | |||
1447 | [DllImport("ode", EntryPoint = "dJointSetUniversalAnchor"), SuppressUnmanagedCodeSecurity] | ||
1448 | public static extern void JointSetUniversalAnchor(IntPtr j, dReal x, dReal y, dReal z); | ||
1449 | |||
1450 | [DllImport("ode", EntryPoint = "dJointSetUniversalAxis1"), SuppressUnmanagedCodeSecurity] | ||
1451 | public static extern void JointSetUniversalAxis1(IntPtr j, dReal x, dReal y, dReal z); | ||
1452 | |||
1453 | [DllImport("ode", EntryPoint = "dJointSetUniversalAxis2"), SuppressUnmanagedCodeSecurity] | ||
1454 | public static extern void JointSetUniversalAxis2(IntPtr j, dReal x, dReal y, dReal z); | ||
1455 | |||
1456 | [DllImport("ode", EntryPoint = "dJointSetUniversalParam"), SuppressUnmanagedCodeSecurity] | ||
1457 | public static extern void JointSetUniversalParam(IntPtr j, int parameter, dReal value); | ||
1458 | |||
1459 | [DllImport("ode", EntryPoint = "dLDLTAddTL"), SuppressUnmanagedCodeSecurity] | ||
1460 | public static extern void LDLTAddTL(ref dReal L, ref dReal d, ref dReal a, int n, int nskip); | ||
1461 | |||
1462 | [DllImport("ode", EntryPoint = "dMassAdd"), SuppressUnmanagedCodeSecurity] | ||
1463 | public static extern void MassAdd(ref Mass a, ref Mass b); | ||
1464 | |||
1465 | [DllImport("ode", EntryPoint = "dMassAdjust"), SuppressUnmanagedCodeSecurity] | ||
1466 | public static extern void MassAdjust(ref Mass m, dReal newmass); | ||
1467 | |||
1468 | [DllImport("ode", EntryPoint = "dMassCheck"), SuppressUnmanagedCodeSecurity] | ||
1469 | public static extern bool MassCheck(ref Mass m); | ||
1470 | |||
1471 | [DllImport("ode", EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] | ||
1472 | public static extern void MassRotate(out Mass mass, ref Matrix3 R); | ||
1473 | |||
1474 | [DllImport("ode", EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity] | ||
1475 | public static extern void MassRotate(out Mass mass, ref dReal M00); | ||
1476 | |||
1477 | [DllImport("ode", EntryPoint = "dMassSetBox"), SuppressUnmanagedCodeSecurity] | ||
1478 | public static extern void MassSetBox(out Mass mass, dReal density, dReal lx, dReal ly, dReal lz); | ||
1479 | |||
1480 | [DllImport("ode", EntryPoint = "dMassSetBoxTotal"), SuppressUnmanagedCodeSecurity] | ||
1481 | public static extern void MassSetBoxTotal(out Mass mass, dReal total_mass, dReal lx, dReal ly, dReal lz); | ||
1482 | |||
1483 | [DllImport("ode", EntryPoint = "dMassSetCapsule"), SuppressUnmanagedCodeSecurity] | ||
1484 | public static extern void MassSetCapsule(out Mass mass, dReal density, int direction, dReal radius, dReal length); | ||
1485 | |||
1486 | [DllImport("ode", EntryPoint = "dMassSetCapsuleTotal"), SuppressUnmanagedCodeSecurity] | ||
1487 | public static extern void MassSetCapsuleTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); | ||
1488 | |||
1489 | [DllImport("ode", EntryPoint = "dMassSetCylinder"), SuppressUnmanagedCodeSecurity] | ||
1490 | public static extern void MassSetCylinder(out Mass mass, dReal density, int direction, dReal radius, dReal length); | ||
1491 | |||
1492 | [DllImport("ode", EntryPoint = "dMassSetCylinderTotal"), SuppressUnmanagedCodeSecurity] | ||
1493 | public static extern void MassSetCylinderTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length); | ||
1494 | |||
1495 | [DllImport("ode", EntryPoint = "dMassSetParameters"), SuppressUnmanagedCodeSecurity] | ||
1496 | public static extern void MassSetParameters(out Mass mass, dReal themass, | ||
1497 | dReal cgx, dReal cgy, dReal cgz, | ||
1498 | dReal i11, dReal i22, dReal i33, | ||
1499 | dReal i12, dReal i13, dReal i23); | ||
1500 | |||
1501 | [DllImport("ode", EntryPoint = "dMassSetSphere"), SuppressUnmanagedCodeSecurity] | ||
1502 | public static extern void MassSetSphere(out Mass mass, dReal density, dReal radius); | ||
1503 | |||
1504 | [DllImport("ode", EntryPoint = "dMassSetSphereTotal"), SuppressUnmanagedCodeSecurity] | ||
1505 | public static extern void dMassSetSphereTotal(out Mass mass, dReal total_mass, dReal radius); | ||
1506 | |||
1507 | [DllImport("ode", EntryPoint = "dMassSetTrimesh"), SuppressUnmanagedCodeSecurity] | ||
1508 | public static extern void MassSetTrimesh(out Mass mass, dReal density, IntPtr g); | ||
1509 | |||
1510 | [DllImport("ode", EntryPoint = "dMassSetZero"), SuppressUnmanagedCodeSecurity] | ||
1511 | public static extern void MassSetZero(out Mass mass); | ||
1512 | |||
1513 | [DllImport("ode", EntryPoint = "dMassTranslate"), SuppressUnmanagedCodeSecurity] | ||
1514 | public static extern void MassTranslate(out Mass mass, dReal x, dReal y, dReal z); | ||
1515 | |||
1516 | [DllImport("ode", EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity] | ||
1517 | public static extern void Multiply0(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); | ||
1518 | |||
1519 | [DllImport("ode", EntryPoint = "dMultiply1"), SuppressUnmanagedCodeSecurity] | ||
1520 | public static extern void Multiply1(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); | ||
1521 | |||
1522 | [DllImport("ode", EntryPoint = "dMultiply2"), SuppressUnmanagedCodeSecurity] | ||
1523 | public static extern void Multiply2(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r); | ||
1524 | |||
1525 | [DllImport("ode", EntryPoint = "dQFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] | ||
1526 | public static extern void QFromAxisAndAngle(out Quaternion q, dReal ax, dReal ay, dReal az, dReal angle); | ||
1527 | |||
1528 | [DllImport("ode", EntryPoint = "dQfromR"), SuppressUnmanagedCodeSecurity] | ||
1529 | public static extern void QfromR(out Quaternion q, ref Matrix3 R); | ||
1530 | |||
1531 | [DllImport("ode", EntryPoint = "dQMultiply0"), SuppressUnmanagedCodeSecurity] | ||
1532 | public static extern void QMultiply0(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | ||
1533 | |||
1534 | [DllImport("ode", EntryPoint = "dQMultiply1"), SuppressUnmanagedCodeSecurity] | ||
1535 | public static extern void QMultiply1(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | ||
1536 | |||
1537 | [DllImport("ode", EntryPoint = "dQMultiply2"), SuppressUnmanagedCodeSecurity] | ||
1538 | public static extern void QMultiply2(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | ||
1539 | |||
1540 | [DllImport("ode", EntryPoint = "dQMultiply3"), SuppressUnmanagedCodeSecurity] | ||
1541 | public static extern void QMultiply3(out Quaternion qa, ref Quaternion qb, ref Quaternion qc); | ||
1542 | |||
1543 | [DllImport("ode", EntryPoint = "dQSetIdentity"), SuppressUnmanagedCodeSecurity] | ||
1544 | public static extern void QSetIdentity(out Quaternion q); | ||
1545 | |||
1546 | [DllImport("ode", EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] | ||
1547 | public static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref Vector3 center, ref Vector3 extents, int depth); | ||
1548 | |||
1549 | [DllImport("ode", EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity] | ||
1550 | public static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref dReal centerX, ref dReal extentsX, int depth); | ||
1551 | |||
1552 | [DllImport("ode", EntryPoint = "dRandReal"), SuppressUnmanagedCodeSecurity] | ||
1553 | public static extern dReal RandReal(); | ||
1554 | |||
1555 | [DllImport("ode", EntryPoint = "dRFrom2Axes"), SuppressUnmanagedCodeSecurity] | ||
1556 | public static extern void RFrom2Axes(out Matrix3 R, dReal ax, dReal ay, dReal az, dReal bx, dReal by, dReal bz); | ||
1557 | |||
1558 | [DllImport("ode", EntryPoint = "dRFromAxisAndAngle"), SuppressUnmanagedCodeSecurity] | ||
1559 | public static extern void RFromAxisAndAngle(out Matrix3 R, dReal x, dReal y, dReal z, dReal angle); | ||
1560 | |||
1561 | [DllImport("ode", EntryPoint = "dRFromEulerAngles"), SuppressUnmanagedCodeSecurity] | ||
1562 | public static extern void RFromEulerAngles(out Matrix3 R, dReal phi, dReal theta, dReal psi); | ||
1563 | |||
1564 | [DllImport("ode", EntryPoint = "dRfromQ"), SuppressUnmanagedCodeSecurity] | ||
1565 | public static extern void RfromQ(out Matrix3 R, ref Quaternion q); | ||
1566 | |||
1567 | [DllImport("ode", EntryPoint = "dRFromZAxis"), SuppressUnmanagedCodeSecurity] | ||
1568 | public static extern void RFromZAxis(out Matrix3 R, dReal ax, dReal ay, dReal az); | ||
1569 | |||
1570 | [DllImport("ode", EntryPoint = "dRSetIdentity"), SuppressUnmanagedCodeSecurity] | ||
1571 | public static extern void RSetIdentity(out Matrix3 R); | ||
1572 | |||
1573 | [DllImport("ode", EntryPoint = "dSetValue"), SuppressUnmanagedCodeSecurity] | ||
1574 | public static extern void SetValue(out dReal a, int n); | ||
1575 | |||
1576 | [DllImport("ode", EntryPoint = "dSetZero"), SuppressUnmanagedCodeSecurity] | ||
1577 | public static extern void SetZero(out dReal a, int n); | ||
1578 | |||
1579 | [DllImport("ode", EntryPoint = "dSimpleSpaceCreate"), SuppressUnmanagedCodeSecurity] | ||
1580 | public static extern IntPtr SimpleSpaceCreate(IntPtr space); | ||
1581 | |||
1582 | [DllImport("ode", EntryPoint = "dSolveCholesky"), SuppressUnmanagedCodeSecurity] | ||
1583 | public static extern void SolveCholesky(ref dReal L, out dReal b, int n); | ||
1584 | |||
1585 | [DllImport("ode", EntryPoint = "dSolveL1"), SuppressUnmanagedCodeSecurity] | ||
1586 | public static extern void SolveL1(ref dReal L, out dReal b, int n, int nskip); | ||
1587 | |||
1588 | [DllImport("ode", EntryPoint = "dSolveL1T"), SuppressUnmanagedCodeSecurity] | ||
1589 | public static extern void SolveL1T(ref dReal L, out dReal b, int n, int nskip); | ||
1590 | |||
1591 | [DllImport("ode", EntryPoint = "dSolveLDLT"), SuppressUnmanagedCodeSecurity] | ||
1592 | public static extern void SolveLDLT(ref dReal L, ref dReal d, out dReal b, int n, int nskip); | ||
1593 | |||
1594 | [DllImport("ode", EntryPoint = "dSpaceAdd"), SuppressUnmanagedCodeSecurity] | ||
1595 | public static extern void SpaceAdd(IntPtr space, IntPtr geom); | ||
1596 | |||
1597 | [DllImport("ode", EntryPoint = "dSpaceClean"), SuppressUnmanagedCodeSecurity] | ||
1598 | public static extern void SpaceClean(IntPtr space); | ||
1599 | |||
1600 | [DllImport("ode", EntryPoint = "dSpaceCollide"), SuppressUnmanagedCodeSecurity] | ||
1601 | public static extern void SpaceCollide(IntPtr space, IntPtr data, NearCallback callback); | ||
1602 | |||
1603 | [DllImport("ode", EntryPoint = "dSpaceCollide2"), SuppressUnmanagedCodeSecurity] | ||
1604 | public static extern void SpaceCollide2(IntPtr space1, IntPtr space2, IntPtr data, NearCallback callback); | ||
1605 | |||
1606 | [DllImport("ode", EntryPoint = "dSpaceDestroy"), SuppressUnmanagedCodeSecurity] | ||
1607 | public static extern void SpaceDestroy(IntPtr space); | ||
1608 | |||
1609 | [DllImport("ode", EntryPoint = "dSpaceGetCleanup"), SuppressUnmanagedCodeSecurity] | ||
1610 | public static extern bool SpaceGetCleanup(IntPtr space); | ||
1611 | |||
1612 | [DllImport("ode", EntryPoint = "dSpaceGetNumGeoms"), SuppressUnmanagedCodeSecurity] | ||
1613 | public static extern int SpaceGetNumGeoms(IntPtr space); | ||
1614 | |||
1615 | [DllImport("ode", EntryPoint = "dSpaceGetGeom"), SuppressUnmanagedCodeSecurity] | ||
1616 | public static extern IntPtr SpaceGetGeom(IntPtr space, int i); | ||
1617 | |||
1618 | [DllImport("ode", EntryPoint = "dSpaceQuery"), SuppressUnmanagedCodeSecurity] | ||
1619 | public static extern bool SpaceQuery(IntPtr space, IntPtr geom); | ||
1620 | |||
1621 | [DllImport("ode", EntryPoint = "dSpaceRemove"), SuppressUnmanagedCodeSecurity] | ||
1622 | public static extern void SpaceRemove(IntPtr space, IntPtr geom); | ||
1623 | |||
1624 | [DllImport("ode", EntryPoint = "dSpaceSetCleanup"), SuppressUnmanagedCodeSecurity] | ||
1625 | public static extern void SpaceSetCleanup(IntPtr space, bool mode); | ||
1626 | |||
1627 | [DllImport("ode", EntryPoint = "dVectorScale"), SuppressUnmanagedCodeSecurity] | ||
1628 | public static extern void VectorScale(out dReal a, ref dReal d, int n); | ||
1629 | |||
1630 | [DllImport("ode", EntryPoint = "dWorldCreate"), SuppressUnmanagedCodeSecurity] | ||
1631 | public static extern IntPtr WorldCreate(); | ||
1632 | |||
1633 | [DllImport("ode", EntryPoint = "dWorldDestroy"), SuppressUnmanagedCodeSecurity] | ||
1634 | public static extern void WorldDestroy(IntPtr world); | ||
1635 | |||
1636 | [DllImport("ode", EntryPoint = "dWorldGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | ||
1637 | public static extern dReal WorldGetAutoDisableAngularThreshold(IntPtr world); | ||
1638 | |||
1639 | [DllImport("ode", EntryPoint = "dWorldGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | ||
1640 | public static extern bool WorldGetAutoDisableFlag(IntPtr world); | ||
1641 | |||
1642 | [DllImport("ode", EntryPoint = "dWorldGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | ||
1643 | public static extern dReal WorldGetAutoDisableLinearThreshold(IntPtr world); | ||
1644 | |||
1645 | [DllImport("ode", EntryPoint = "dWorldGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | ||
1646 | public static extern int WorldGetAutoDisableSteps(IntPtr world); | ||
1647 | |||
1648 | [DllImport("ode", EntryPoint = "dWorldGetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | ||
1649 | public static extern dReal WorldGetAutoDisableTime(IntPtr world); | ||
1650 | |||
1651 | [DllImport("ode", EntryPoint = "dWorldGetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] | ||
1652 | public static extern int WorldGetAutoEnableDepthSF1(IntPtr world); | ||
1653 | |||
1654 | [DllImport("ode", EntryPoint = "dWorldGetCFM"), SuppressUnmanagedCodeSecurity] | ||
1655 | public static extern dReal WorldGetCFM(IntPtr world); | ||
1656 | |||
1657 | [DllImport("ode", EntryPoint = "dWorldGetERP"), SuppressUnmanagedCodeSecurity] | ||
1658 | public static extern dReal WorldGetERP(IntPtr world); | ||
1659 | |||
1660 | [DllImport("ode", EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] | ||
1661 | public static extern void WorldGetGravity(IntPtr world, out Vector3 gravity); | ||
1662 | |||
1663 | [DllImport("ode", EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity] | ||
1664 | public static extern void WorldGetGravity(IntPtr world, out dReal X); | ||
1665 | |||
1666 | [DllImport("ode", EntryPoint = "dWorldGetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] | ||
1667 | public static extern dReal WorldGetContactMaxCorrectingVel(IntPtr world); | ||
1668 | |||
1669 | [DllImport("ode", EntryPoint = "dWorldGetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] | ||
1670 | public static extern dReal WorldGetContactSurfaceLayer(IntPtr world); | ||
1671 | |||
1672 | [DllImport("ode", EntryPoint = "dWorldGetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] | ||
1673 | public static extern int WorldGetQuickStepNumIterations(IntPtr world); | ||
1674 | |||
1675 | [DllImport("ode", EntryPoint = "dWorldGetQuickStepW"), SuppressUnmanagedCodeSecurity] | ||
1676 | public static extern dReal WorldGetQuickStepW(IntPtr world); | ||
1677 | |||
1678 | [DllImport("ode", EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] | ||
1679 | public static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out Vector3 force); | ||
1680 | |||
1681 | [DllImport("ode", EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity] | ||
1682 | public static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out dReal forceX); | ||
1683 | |||
1684 | [DllImport("ode", EntryPoint = "dWorldQuickStep"), SuppressUnmanagedCodeSecurity] | ||
1685 | public static extern void WorldQuickStep(IntPtr world, dReal stepsize); | ||
1686 | |||
1687 | [DllImport("ode", EntryPoint = "dWorldSetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity] | ||
1688 | public static extern void WorldSetAutoDisableAngularThreshold(IntPtr world, dReal angular_threshold); | ||
1689 | |||
1690 | [DllImport("ode", EntryPoint = "dWorldSetAutoDisableFlag"), SuppressUnmanagedCodeSecurity] | ||
1691 | public static extern void WorldSetAutoDisableFlag(IntPtr world, bool do_auto_disable); | ||
1692 | |||
1693 | [DllImport("ode", EntryPoint = "dWorldSetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity] | ||
1694 | public static extern void WorldSetAutoDisableLinearThreshold(IntPtr world, dReal linear_threshold); | ||
1695 | |||
1696 | [DllImport("ode", EntryPoint = "dWorldSetAutoDisableSteps"), SuppressUnmanagedCodeSecurity] | ||
1697 | public static extern void WorldSetAutoDisableSteps(IntPtr world, int steps); | ||
1698 | |||
1699 | [DllImport("ode", EntryPoint = "dWorldSetAutoDisableTime"), SuppressUnmanagedCodeSecurity] | ||
1700 | public static extern void WorldSetAutoDisableTime(IntPtr world, dReal time); | ||
1701 | |||
1702 | [DllImport("ode", EntryPoint = "dWorldSetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity] | ||
1703 | public static extern void WorldSetAutoEnableDepthSF1(IntPtr world, int autoEnableDepth); | ||
1704 | |||
1705 | [DllImport("ode", EntryPoint = "dWorldSetCFM"), SuppressUnmanagedCodeSecurity] | ||
1706 | public static extern void WorldSetCFM(IntPtr world, dReal cfm); | ||
1707 | |||
1708 | [DllImport("ode", EntryPoint = "dWorldSetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity] | ||
1709 | public static extern void WorldSetContactMaxCorrectingVel(IntPtr world, dReal vel); | ||
1710 | |||
1711 | [DllImport("ode", EntryPoint = "dWorldSetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity] | ||
1712 | public static extern void WorldSetContactSurfaceLayer(IntPtr world, dReal depth); | ||
1713 | |||
1714 | [DllImport("ode", EntryPoint = "dWorldSetERP"), SuppressUnmanagedCodeSecurity] | ||
1715 | public static extern void WorldSetERP(IntPtr world, dReal erp); | ||
1716 | |||
1717 | [DllImport("ode", EntryPoint = "dWorldSetGravity"), SuppressUnmanagedCodeSecurity] | ||
1718 | public static extern void WorldSetGravity(IntPtr world, dReal x, dReal y, dReal z); | ||
1719 | |||
1720 | [DllImport("ode", EntryPoint = "dWorldSetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity] | ||
1721 | public static extern void WorldSetQuickStepNumIterations(IntPtr world, int num); | ||
1722 | |||
1723 | [DllImport("ode", EntryPoint = "dWorldSetQuickStepW"), SuppressUnmanagedCodeSecurity] | ||
1724 | public static extern void WorldSetQuickStepW(IntPtr world, dReal over_relaxation); | ||
1725 | |||
1726 | [DllImport("ode", EntryPoint = "dWorldStep"), SuppressUnmanagedCodeSecurity] | ||
1727 | public static extern void WorldStep(IntPtr world, dReal stepsize); | ||
1728 | |||
1729 | [DllImport("ode", EntryPoint = "dWorldStepFast1"), SuppressUnmanagedCodeSecurity] | ||
1730 | public static extern void WorldStepFast1(IntPtr world, dReal stepsize, int maxiterations); | ||
1731 | } | ||
1732 | } | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Ode/premake.lua b/libraries/ode-0.9/contrib/Ode.NET/Ode/premake.lua new file mode 100644 index 0000000..b53d54c --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Ode/premake.lua | |||
@@ -0,0 +1,31 @@ | |||
1 | package.name = "Ode.NET" | ||
2 | package.kind = "dll" | ||
3 | package.language = "c#" | ||
4 | |||
5 | -- Build options | ||
6 | |||
7 | package.defines = { } | ||
8 | |||
9 | if (options["with-doubles"]) then | ||
10 | table.insert(package.defines, "dDOUBLE") | ||
11 | else | ||
12 | table.insert(package.defines, "dSINGLE") | ||
13 | end | ||
14 | |||
15 | if (options["no-unsafe"]) then | ||
16 | table.insert(package.defines, "dNO_UNSAFE_CODE") | ||
17 | else | ||
18 | package.buildflags = { "unsafe" } | ||
19 | end | ||
20 | |||
21 | |||
22 | -- Files & Libraries | ||
23 | |||
24 | package.files = { | ||
25 | "AssemblyInfo.cs", | ||
26 | "Ode.cs" | ||
27 | } | ||
28 | |||
29 | package.links = { | ||
30 | "System" | ||
31 | } | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/README.TXT b/libraries/ode-0.9/contrib/Ode.NET/README.TXT new file mode 100644 index 0000000..e6f1262 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/README.TXT | |||
@@ -0,0 +1,73 @@ | |||
1 | Ode.NET - .NET bindings for ODE | ||
2 | Jason Perkins (starkos@gmail.com) | ||
3 | |||
4 | THIS IS A WORK IN PROGRESS! I'm not done yet! | ||
5 | |||
6 | |||
7 | --------------------------------------------------------------------- | ||
8 | INSTALLATION | ||
9 | --------------------------------------------------------------------- | ||
10 | |||
11 | Note that this binding uses a C# 2.0 feature (the | ||
12 | UnmanagedFunctionPointer attribute). You will need to use | ||
13 | Visual Studio 2005 (C# Express is fine) or Mono's gmcs | ||
14 | compiler. | ||
15 | |||
16 | Start by getting or building ODE as a shared library (DLL). | ||
17 | |||
18 | The simplest way to build the bindings is probably to create a | ||
19 | new library assembly in your tool of choice and drop in the files | ||
20 | Ode/Ode.cs and Ode/AssemblyInfo.cs. Define the symbol`dDOUBLE` if | ||
21 | you used double-precision math in your ode.dll. Build, done. | ||
22 | |||
23 | For testing purposes, I have also created bindings for the | ||
24 | Drawstuff library and a C# version of the BoxStack demo. You can | ||
25 | throw all of these files into a console executable and run it to | ||
26 | see the demo. | ||
27 | |||
28 | If you happen to have Premake installed (http://premake.sf.net/), | ||
29 | you can generate build scripts for the library with: | ||
30 | |||
31 | premake --target (toolset) # for single precision | ||
32 | premake --with-doubles --target (toolset) # for double precision | ||
33 | |||
34 | To build the test application too, use: | ||
35 | |||
36 | premake --with-tests --target (toolset) | ||
37 | |||
38 | To build with Mono, you must add the --dotnet parameter to enable | ||
39 | support .NET 2.0: | ||
40 | |||
41 | premake --dotnet mono2 --target gnu | ||
42 | |||
43 | |||
44 | --------------------------------------------------------------------- | ||
45 | USAGE | ||
46 | --------------------------------------------------------------------- | ||
47 | |||
48 | I have tried to keep things as close to the original C API as I can, | ||
49 | rather than forcing a class structure on everyone. Everything is | ||
50 | contained within the `Ode.NET` namespace inside a static class | ||
51 | named `d`. All ODE IDs are replaced with IntPtrs. A quick example: | ||
52 | |||
53 | using Ode.NET; | ||
54 | |||
55 | IntPtr world = d.WorldCreate(); | ||
56 | IntPtr body = d.BodyCreate(world); | ||
57 | |||
58 | Take a look at Tests/BoxStack.cs for a more complete example. | ||
59 | |||
60 | |||
61 | --------------------------------------------------------------------- | ||
62 | KNOWN ISSUES | ||
63 | --------------------------------------------------------------------- | ||
64 | |||
65 | I'm not done yet, so many functions are still missing. | ||
66 | |||
67 | It is not possible to implement dBodyGetPosition(), dBodyGetRotation(), | ||
68 | etc. without resorting to unsafe code, which I was trying to avoid. | ||
69 | This binding uses the .NET friendly dBodyCopyPosition(), | ||
70 | dBodyCopyRotation(), etc. instead. | ||
71 | |||
72 | Collision response (contact joints) do not work when built under | ||
73 | Mono as double-precision. I have not tried to track down why. | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Tests/BoxStack.cs b/libraries/ode-0.9/contrib/Ode.NET/Tests/BoxStack.cs new file mode 100644 index 0000000..1077124 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Tests/BoxStack.cs | |||
@@ -0,0 +1,260 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using Drawstuff.NET; | ||
4 | |||
5 | namespace Ode.NET | ||
6 | { | ||
7 | #if dDOUBLE | ||
8 | using dReal = System.Double; | ||
9 | #else | ||
10 | using dReal = System.Single; | ||
11 | #endif | ||
12 | |||
13 | public class TestBoxStack | ||
14 | { | ||
15 | #region Description of convex shape | ||
16 | |||
17 | static dReal[] planes = | ||
18 | { | ||
19 | 1.0f, 0.0f, 0.0f, 0.25f, | ||
20 | 0.0f, 1.0f, 0.0f, 0.25f, | ||
21 | 0.0f, 0.0f, 1.0f, 0.25f, | ||
22 | 0.0f, 0.0f, -1.0f, 0.25f, | ||
23 | 0.0f, -1.0f, 0.0f, 0.25f, | ||
24 | -1.0f, 0.0f , 0.0f, 0.25f | ||
25 | }; | ||
26 | |||
27 | static dReal[] points = | ||
28 | { | ||
29 | 0.25f, 0.25f, 0.25f, | ||
30 | -0.25f, 0.25f, 0.25f, | ||
31 | 0.25f, -0.25f, 0.25f, | ||
32 | -0.25f, -0.25f, 0.25f, | ||
33 | 0.25f, 0.25f, -0.25f, | ||
34 | -0.25f,0.25f,-0.25f, | ||
35 | 0.25f,-0.25f,-0.25f, | ||
36 | -0.25f,-0.25f,-0.25f, | ||
37 | }; | ||
38 | |||
39 | static int[] polygons = | ||
40 | { | ||
41 | 4, 0, 2, 6, 4, | ||
42 | 4, 1, 0, 4, 5, | ||
43 | 4, 0, 1, 3, 2, | ||
44 | 4, 3, 1, 5, 7, | ||
45 | 4, 2, 3, 7, 6, | ||
46 | 4, 5, 4, 6, 7, | ||
47 | }; | ||
48 | |||
49 | #endregion | ||
50 | |||
51 | const int NUM = 100; | ||
52 | const float DENSITY = 5.0f; | ||
53 | const int MAX_CONTACTS = 8; | ||
54 | |||
55 | static IntPtr world; | ||
56 | static IntPtr space; | ||
57 | static IntPtr contactgroup; | ||
58 | |||
59 | static Queue<IntPtr> obj = new Queue<IntPtr>(); | ||
60 | |||
61 | static d.Vector3 xyz = new d.Vector3(2.1640f, -1.3079f, 1.7600f); | ||
62 | static d.Vector3 hpr = new d.Vector3(125.5000f, -17.0000f, 0.0000f); | ||
63 | |||
64 | static d.NearCallback nearCallback = near; | ||
65 | static d.ContactGeom[] contacts = new d.ContactGeom[MAX_CONTACTS]; | ||
66 | static d.Contact contact; | ||
67 | |||
68 | |||
69 | // Called when window is opened - sets up viewpoint and prints usage | ||
70 | static void start(int unused) | ||
71 | { | ||
72 | ds.SetViewpoint(ref xyz, ref hpr); | ||
73 | Console.WriteLine("To drop another object, press:"); | ||
74 | Console.WriteLine(" b for box."); | ||
75 | Console.WriteLine(" s for sphere."); | ||
76 | Console.WriteLine(" c for capsule."); | ||
77 | Console.WriteLine(" y for cylinder."); | ||
78 | Console.WriteLine(" v for a convex object."); | ||
79 | Console.WriteLine(" x for a composite object."); | ||
80 | Console.WriteLine("To select an object, press space."); | ||
81 | Console.WriteLine("To disable the selected object, press d."); | ||
82 | Console.WriteLine("To enable the selected object, press e."); | ||
83 | Console.WriteLine("To toggle showing the geom AABBs, press a."); | ||
84 | Console.WriteLine("To toggle showing the contact points, press t."); | ||
85 | Console.WriteLine("To toggle dropping from random position/orientation, press r."); | ||
86 | Console.WriteLine("To save the current state to 'state.dif', press 1."); | ||
87 | } | ||
88 | |||
89 | |||
90 | // Near callback - creates contact joints | ||
91 | static void near(IntPtr space, IntPtr g1, IntPtr g2) | ||
92 | { | ||
93 | IntPtr b1 = d.GeomGetBody(g1); | ||
94 | IntPtr b2 = d.GeomGetBody(g2); | ||
95 | if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) | ||
96 | return; | ||
97 | |||
98 | int count = d.Collide(g1, g2, MAX_CONTACTS, contacts, d.ContactGeom.SizeOf); | ||
99 | for (int i = 0; i < count; ++i) | ||
100 | { | ||
101 | contact.geom = contacts[i]; | ||
102 | IntPtr joint = d.JointCreateContact(world, contactgroup, ref contact); | ||
103 | d.JointAttach(joint, b1, b2); | ||
104 | } | ||
105 | } | ||
106 | |||
107 | |||
108 | // Adds a new object to the scene - attaches a body to the geom and | ||
109 | // sets the initial position and orientation | ||
110 | static void addObject(IntPtr geom, d.Mass mass) | ||
111 | { | ||
112 | // Create a body for this object | ||
113 | IntPtr body = d.BodyCreate(world); | ||
114 | d.GeomSetBody(geom, body); | ||
115 | d.BodySetMass(body, ref mass); | ||
116 | obj.Enqueue(geom); | ||
117 | |||
118 | // Set the position of the new object | ||
119 | d.Matrix3 R; | ||
120 | d.BodySetPosition(body, d.RandReal() * 2 - 1, d.RandReal() * 2 - 1, d.RandReal() + 2); | ||
121 | d.RFromAxisAndAngle(out R, d.RandReal() * 2 - 1, d.RandReal() * 2 - 1, d.RandReal() * 2 - 1, d.RandReal() * 10 - 5); | ||
122 | d.BodySetRotation(body, ref R); | ||
123 | |||
124 | // Cap the total number of objects | ||
125 | if (obj.Count > NUM) | ||
126 | { | ||
127 | geom = obj.Dequeue(); | ||
128 | body = d.GeomGetBody(geom); | ||
129 | d.BodyDestroy(body); | ||
130 | d.GeomDestroy(geom); | ||
131 | } | ||
132 | } | ||
133 | |||
134 | |||
135 | // Keyboard callback | ||
136 | static void command(int cmd) | ||
137 | { | ||
138 | IntPtr geom; | ||
139 | d.Mass mass; | ||
140 | d.Vector3 sides = new d.Vector3(d.RandReal() * 0.5f + 0.1f, d.RandReal() * 0.5f + 0.1f, d.RandReal() * 0.5f + 0.1f); | ||
141 | |||
142 | Char ch = Char.ToLower((Char)cmd); | ||
143 | switch ((Char)ch) | ||
144 | { | ||
145 | case 'b': | ||
146 | d.MassSetBox(out mass, DENSITY, sides.X, sides.Y, sides.Z); | ||
147 | geom = d.CreateBox(space, sides.X, sides.Y, sides.Z); | ||
148 | addObject(geom, mass); | ||
149 | break; | ||
150 | |||
151 | case 'c': | ||
152 | sides.X *= 0.5f; | ||
153 | d.MassSetCapsule(out mass, DENSITY, 3, sides.X, sides.Y); | ||
154 | geom = d.CreateCapsule(space, sides.X, sides.Y); | ||
155 | addObject(geom, mass); | ||
156 | break; | ||
157 | |||
158 | case 'v': | ||
159 | d.MassSetBox(out mass, DENSITY, 0.25f, 0.25f, 0.25f); | ||
160 | geom = d.CreateConvex(space, planes, planes.Length / 4, points, points.Length / 3, polygons); | ||
161 | addObject(geom, mass); | ||
162 | break; | ||
163 | } | ||
164 | } | ||
165 | |||
166 | |||
167 | // Draw an object in the scene | ||
168 | static void drawGeom(IntPtr geom) | ||
169 | { | ||
170 | IntPtr body = d.GeomGetBody(geom); | ||
171 | |||
172 | d.Vector3 pos; | ||
173 | d.BodyCopyPosition(body, out pos); | ||
174 | |||
175 | d.Matrix3 R; | ||
176 | d.BodyCopyRotation(body, out R); | ||
177 | |||
178 | d.GeomClassID type = d.GeomGetClass(geom); | ||
179 | switch (type) | ||
180 | { | ||
181 | case d.GeomClassID.BoxClass: | ||
182 | d.Vector3 sides; | ||
183 | d.GeomBoxGetLengths(geom, out sides); | ||
184 | ds.DrawBox(ref pos, ref R, ref sides); | ||
185 | break; | ||
186 | case d.GeomClassID.CapsuleClass: | ||
187 | dReal radius, length; | ||
188 | d.GeomCapsuleGetParams(geom, out radius, out length); | ||
189 | ds.DrawCapsule(ref pos, ref R, length, radius); | ||
190 | break; | ||
191 | case d.GeomClassID.ConvexClass: | ||
192 | ds.DrawConvex(ref pos, ref R, planes, planes.Length / 4, points, points.Length / 3, polygons); | ||
193 | break; | ||
194 | } | ||
195 | } | ||
196 | |||
197 | |||
198 | // Called once per frame; updates the scene | ||
199 | static void step(int pause) | ||
200 | { | ||
201 | d.SpaceCollide(space, IntPtr.Zero, nearCallback); | ||
202 | if (pause == 0) | ||
203 | d.WorldQuickStep(world, 0.02f); | ||
204 | d.JointGroupEmpty(contactgroup); | ||
205 | |||
206 | ds.SetColor(1.0f, 1.0f, 0.0f); | ||
207 | ds.SetTexture(ds.Texture.Wood); | ||
208 | |||
209 | foreach (IntPtr geom in obj) | ||
210 | { | ||
211 | drawGeom(geom); | ||
212 | } | ||
213 | } | ||
214 | |||
215 | |||
216 | static void Main(string[] args) | ||
217 | { | ||
218 | // Setup pointers to drawstuff callback functions | ||
219 | ds.Functions fn; | ||
220 | fn.version = ds.VERSION; | ||
221 | fn.start = new ds.CallbackFunction(start); | ||
222 | fn.step = new ds.CallbackFunction(step); | ||
223 | fn.command = new ds.CallbackFunction(command); | ||
224 | fn.stop = null; | ||
225 | fn.path_to_textures = "../../../../drawstuff/textures"; | ||
226 | if (args.Length > 0) | ||
227 | { | ||
228 | fn.path_to_textures = args[0]; | ||
229 | } | ||
230 | |||
231 | // Set up contact response parameters | ||
232 | contact.surface.mode = d.ContactFlags.Bounce | d.ContactFlags.SoftCFM; | ||
233 | contact.surface.mu = d.Infinity; | ||
234 | contact.surface.mu2 = 0.0f; | ||
235 | contact.surface.bounce = 0.1f; | ||
236 | contact.surface.bounce_vel = 0.1f; | ||
237 | contact.surface.soft_cfm = 0.01f; | ||
238 | |||
239 | // Initialize the scene | ||
240 | world = d.WorldCreate(); | ||
241 | space = d.HashSpaceCreate(IntPtr.Zero); | ||
242 | contactgroup = d.JointGroupCreate(0); | ||
243 | d.WorldSetGravity(world, 0.0f, 0.0f, -0.5f); | ||
244 | d.WorldSetCFM(world, 1e-5f); | ||
245 | d.WorldSetAutoDisableFlag(world, true); | ||
246 | d.WorldSetContactMaxCorrectingVel(world, 0.1f); | ||
247 | d.WorldSetContactSurfaceLayer(world, 0.001f); | ||
248 | d.CreatePlane(space, 0, 0, 1, 0); | ||
249 | |||
250 | // Run the scene | ||
251 | ds.SimulationLoop(args.Length, args, 352, 288, ref fn); | ||
252 | |||
253 | // Clean up | ||
254 | d.JointGroupDestroy(contactgroup); | ||
255 | d.SpaceDestroy(space); | ||
256 | d.WorldDestroy(world); | ||
257 | d.CloseODE(); | ||
258 | } | ||
259 | } | ||
260 | } | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/Tests/premake.lua b/libraries/ode-0.9/contrib/Ode.NET/Tests/premake.lua new file mode 100644 index 0000000..5253ae1 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Tests/premake.lua | |||
@@ -0,0 +1,27 @@ | |||
1 | -- This function creates the test packages | ||
2 | function maketest(name) | ||
3 | |||
4 | package = newpackage() | ||
5 | package.name = name | ||
6 | package.kind = "exe" | ||
7 | package.language = "c#" | ||
8 | |||
9 | if (options["with-doubles"]) then | ||
10 | package.defines = { "dDOUBLE" } | ||
11 | else | ||
12 | package.defines = { "dSINGLE " } | ||
13 | end | ||
14 | |||
15 | package.links = { | ||
16 | "System", | ||
17 | "Ode.NET", | ||
18 | "Drawstuff.NET" | ||
19 | } | ||
20 | |||
21 | package.files = { | ||
22 | name .. ".cs" | ||
23 | } | ||
24 | |||
25 | end | ||
26 | |||
27 | maketest("BoxStack") | ||
diff --git a/libraries/ode-0.9/contrib/Ode.NET/premake.lua b/libraries/ode-0.9/contrib/Ode.NET/premake.lua new file mode 100644 index 0000000..c25a017 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/premake.lua | |||
@@ -0,0 +1,29 @@ | |||
1 | project.name = "Ode.NET" | ||
2 | |||
3 | -- Target checking | ||
4 | |||
5 | if (target and target ~= "vs2005" and target ~= "gnu") then | ||
6 | error("Ode.NET requires a .NET 2.0 compiler") | ||
7 | end | ||
8 | |||
9 | |||
10 | -- Project options | ||
11 | |||
12 | addoption("with-doubles", "Use double instead of float as base numeric type") | ||
13 | addoption("with-tests", "Builds the test applications and DrawStuff library") | ||
14 | addoption("no-unsafe", "Exclude functions using unsafe code (dBodyGetPosition, etc.)") | ||
15 | |||
16 | |||
17 | -- Build settings | ||
18 | |||
19 | project.config["Debug"].bindir = "bin/Debug" | ||
20 | project.config["Release"].bindir = "bin/Release" | ||
21 | |||
22 | |||
23 | -- Packages | ||
24 | |||
25 | if (options["with-tests"]) then | ||
26 | dopackage("Tests") | ||
27 | dopackage("Drawstuff") | ||
28 | end | ||
29 | dopackage("Ode") | ||