1
0

ODEApi.cs 133 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162
  1. /*
  2. * based on:
  3. * Ode.NET - .NET bindings for ODE
  4. * Jason Perkins ([email protected])
  5. * Licensed under the New BSD
  6. * Part of the OpenDynamicsEngine
  7. Open Dynamics Engine
  8. Copyright (c) 2001-2007, Russell L. Smith.
  9. All rights reserved.
  10. Redistribution and use in source and binary forms, with or without
  11. modification, are permitted provided that the following conditions
  12. are met:
  13. Redistributions of source code must retain the above copyright notice,
  14. this list of conditions and the following disclaimer.
  15. Redistributions in binary form must reproduce the above copyright notice,
  16. this list of conditions and the following disclaimer in the documentation
  17. and/or other materials provided with the distribution.
  18. Neither the names of ODE's copyright owner nor the names of its
  19. contributors may be used to endorse or promote products derived from
  20. this software without specific prior written permission.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  27. TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. *
  33. * changes by opensim team;
  34. * changes by Aurora team http://www.aurora-sim.org/
  35. * changes by Ubit Umarov
  36. */
  37. using System;
  38. using System.Runtime.CompilerServices;
  39. using System.Runtime.InteropServices;
  40. using System.Security;
  41. using OMV = OpenMetaverse;
  42. namespace OpenSim.Region.PhysicsModule.ubOde
  43. {
  44. //#if dDOUBLE
  45. // don't see much use in double precision with time steps of 20ms and 10 iterations used on opensim
  46. // at least we save same memory and memory access time, FPU performance on intel usually is similar
  47. // using dReal = System.Double;
  48. //#else
  49. using dReal = System.Single;
  50. //#endif
  51. [SuppressUnmanagedCodeSecurityAttribute]
  52. internal static class UBOdeNative
  53. {
  54. internal static dReal Infinity = dReal.MaxValue;
  55. internal static int NTotalBodies = 0;
  56. internal static int NTotalGeoms = 0;
  57. internal const uint CONTACTS_UNIMPORTANT = 0x80000000;
  58. #region Flags and Enumerations
  59. [Flags]
  60. internal enum AllocateODEDataFlags : uint
  61. {
  62. BasicData = 0,
  63. CollisionData = 0x00000001,
  64. All = ~0u
  65. }
  66. [Flags]
  67. internal enum IniteODEFlags : uint
  68. {
  69. dInitFlagManualThreadCleanup = 0x00000001
  70. }
  71. [Flags]
  72. internal enum ContactFlags : int
  73. {
  74. Mu2 = 0x001,
  75. FDir1 = 0x002,
  76. Bounce = 0x004,
  77. SoftERP = 0x008,
  78. SoftCFM = 0x010,
  79. Motion1 = 0x020,
  80. Motion2 = 0x040,
  81. MotionN = 0x080,
  82. Slip1 = 0x100,
  83. Slip2 = 0x200,
  84. Approx0 = 0x0000,
  85. Approx1_1 = 0x1000,
  86. Approx1_2 = 0x2000,
  87. Approx1 = 0x3000
  88. }
  89. internal enum GeomClassID : int
  90. {
  91. SphereClass,
  92. BoxClass,
  93. CapsuleClass,
  94. CylinderClass,
  95. PlaneClass,
  96. RayClass,
  97. ConvexClass,
  98. GeomTransformClass,
  99. TriMeshClass,
  100. HeightfieldClass,
  101. FirstSpaceClass,
  102. SimpleSpaceClass = FirstSpaceClass,
  103. HashSpaceClass,
  104. QuadTreeSpaceClass,
  105. LastSpaceClass = QuadTreeSpaceClass,
  106. ubtTerrainClass,
  107. FirstUserClass,
  108. LastUserClass = FirstUserClass + MaxUserClasses - 1,
  109. NumClasses,
  110. MaxUserClasses = 5
  111. }
  112. internal enum JointType : int
  113. {
  114. None,
  115. Ball,
  116. Hinge,
  117. Slider,
  118. Contact,
  119. Universal,
  120. Hinge2,
  121. Fixed,
  122. Null,
  123. AMotor,
  124. LMotor,
  125. Plane2D
  126. }
  127. internal enum JointParam : int
  128. {
  129. LoStop,
  130. HiStop,
  131. Vel,
  132. FMax,
  133. FudgeFactor,
  134. Bounce,
  135. CFM,
  136. StopERP,
  137. StopCFM,
  138. SuspensionERP,
  139. SuspensionCFM,
  140. LoStop2 = 256,
  141. HiStop2,
  142. Vel2,
  143. FMax2,
  144. FudgeFactor2,
  145. Bounce2,
  146. CFM2,
  147. StopERP2,
  148. StopCFM2,
  149. SuspensionERP2,
  150. SuspensionCFM2,
  151. LoStop3 = 512,
  152. HiStop3,
  153. Vel3,
  154. FMax3,
  155. FudgeFactor3,
  156. Bounce3,
  157. CFM3,
  158. StopERP3,
  159. StopCFM3,
  160. SuspensionERP3,
  161. SuspensionCFM3
  162. }
  163. internal enum dSweepAndPruneAxis : int
  164. {
  165. XYZ = ((0)|(1<<2)|(2<<4)),
  166. XZY = ((0)|(2<<2)|(1<<4)),
  167. YXZ = ((1)|(0<<2)|(2<<4)),
  168. YZX = ((1)|(2<<2)|(0<<4)),
  169. ZXY = ((2)|(0<<2)|(1<<4)),
  170. ZYX = ((2)|(1<<2)|(0<<4))
  171. }
  172. #endregion
  173. #region Callbacks
  174. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  175. internal delegate int AABBTestFn(IntPtr o1, IntPtr o2, ref AABB aabb);
  176. //[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  177. //internal delegate int ColliderFn(IntPtr o1, IntPtr o2, int flags, out ContactGeom contact, int skip);
  178. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  179. internal delegate void GetAABBFn(IntPtr geom, out AABB aabb);
  180. //[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  181. //internal delegate ColliderFn GetColliderFnFn(int num);
  182. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  183. internal delegate void GeomDtorFn(IntPtr o);
  184. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  185. internal delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z);
  186. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  187. internal delegate dReal OSTerrainGetHeight(IntPtr p_user_data, int x, int z);
  188. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  189. internal delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2);
  190. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  191. internal delegate int TriCallback(IntPtr trimesh, IntPtr refObject, int triangleIndex);
  192. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  193. internal delegate int TriArrayCallback(IntPtr trimesh, IntPtr refObject, int[] triangleIndex, int triCount);
  194. [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
  195. internal delegate int TriRayCallback(IntPtr trimesh, IntPtr ray, int triangleIndex, dReal u, dReal v);
  196. #endregion
  197. #region Structs
  198. [StructLayout(LayoutKind.Sequential)]
  199. internal struct AABB
  200. {
  201. internal dReal MinX, MaxX;
  202. internal dReal MinY, MaxY;
  203. internal dReal MinZ, MaxZ;
  204. }
  205. [StructLayout(LayoutKind.Sequential)]
  206. internal struct Contact
  207. {
  208. internal SurfaceParameters surface;
  209. internal ContactGeom geom;
  210. internal Vector3 fdir1;
  211. }
  212. internal static readonly int SizeOfContact = Marshal.SizeOf(typeof(Contact));
  213. [StructLayout(LayoutKind.Sequential)]
  214. internal struct ContactGeom
  215. {
  216. internal Vector3 pos;
  217. internal Vector3 normal;
  218. internal dReal depth;
  219. internal IntPtr g1;
  220. internal IntPtr g2;
  221. internal int side1;
  222. internal int side2;
  223. }
  224. internal static readonly int SizeOfContactGeom = Marshal.SizeOf(typeof(ContactGeom));
  225. [StructLayout(LayoutKind.Sequential)]
  226. internal struct JointFeedback
  227. {
  228. internal Vector3 f1;
  229. internal Vector3 t1;
  230. internal Vector3 f2;
  231. internal Vector3 t2;
  232. }
  233. [StructLayout(LayoutKind.Sequential)]
  234. internal struct Mass
  235. {
  236. internal dReal mass;
  237. internal Vector4 c;
  238. internal Matrix3 I;
  239. }
  240. [StructLayout(LayoutKind.Sequential)]
  241. internal struct Matrix3
  242. {
  243. internal Matrix3(dReal m00, dReal m10, dReal m20, dReal m01, dReal m11, dReal m21, dReal m02, dReal m12, dReal m22)
  244. {
  245. M00 = m00; M10 = m10; M20 = m20; M30 = 0.0f;
  246. M01 = m01; M11 = m11; M21 = m21; M31 = 0.0f;
  247. M02 = m02; M12 = m12; M22 = m22; M32 = 0.0f;
  248. }
  249. internal dReal M00, M10, M20, M30;
  250. internal dReal M01, M11, M21, M31;
  251. internal dReal M02, M12, M22, M32;
  252. }
  253. [StructLayout(LayoutKind.Sequential)]
  254. internal struct Matrix4
  255. {
  256. internal Matrix4(dReal m00, dReal m10, dReal m20, dReal m30,
  257. dReal m01, dReal m11, dReal m21, dReal m31,
  258. dReal m02, dReal m12, dReal m22, dReal m32,
  259. dReal m03, dReal m13, dReal m23, dReal m33)
  260. {
  261. M00 = m00; M10 = m10; M20 = m20; M30 = m30;
  262. M01 = m01; M11 = m11; M21 = m21; M31 = m31;
  263. M02 = m02; M12 = m12; M22 = m22; M32 = m32;
  264. M03 = m03; M13 = m13; M23 = m23; M33 = m33;
  265. }
  266. internal dReal M00, M10, M20, M30;
  267. internal dReal M01, M11, M21, M31;
  268. internal dReal M02, M12, M22, M32;
  269. internal dReal M03, M13, M23, M33;
  270. }
  271. [StructLayout(LayoutKind.Sequential)]
  272. internal struct Quaternion
  273. {
  274. internal dReal W, X, Y, Z;
  275. }
  276. [StructLayout(LayoutKind.Sequential)]
  277. internal struct SurfaceParameters
  278. {
  279. internal ContactFlags mode;
  280. internal dReal mu;
  281. internal dReal mu2;
  282. internal dReal bounce;
  283. internal dReal bounce_vel;
  284. internal dReal soft_erp;
  285. internal dReal soft_cfm;
  286. internal dReal motion1;
  287. internal dReal motion2;
  288. internal dReal motionN;
  289. internal dReal slip1;
  290. internal dReal slip2;
  291. }
  292. [StructLayout(LayoutKind.Sequential, Size = 16)]
  293. internal struct Vector3
  294. {
  295. internal Vector3(dReal x, dReal y, dReal z)
  296. {
  297. X = x; Y = y; Z = z; //_w = 0.0f;
  298. }
  299. internal dReal X, Y, Z;
  300. //private readonly dReal _w;
  301. }
  302. [StructLayout(LayoutKind.Sequential)]
  303. internal struct Vector4
  304. {
  305. internal Vector4(dReal x, dReal y, dReal z, dReal w)
  306. {
  307. X = x; Y = y; Z = z; W = w;
  308. }
  309. internal dReal X, Y, Z, W;
  310. }
  311. #endregion
  312. public static void RfromQ(ref Matrix3 matrix, ref OMV.Quaternion rot)
  313. {
  314. float x2 = rot.X + rot.X;
  315. float y2 = rot.Y + rot.Y;
  316. float z2 = rot.Z + rot.Z;
  317. float yy2 = rot.Y * y2;
  318. float zz2 = rot.Z * z2;
  319. matrix.M00 = 1.0f - yy2 - zz2;
  320. float xy2 = rot.X * y2;
  321. float wz2 = rot.W * z2;
  322. matrix.M10 = xy2 - wz2;
  323. float xz2 = rot.X * z2;
  324. float wy2 = rot.W * y2;
  325. matrix.M20 = xz2 + wy2;
  326. matrix.M30 = 0f;
  327. matrix.M01 = xy2 + wz2;
  328. float xx2 = rot.X * x2;
  329. matrix.M11 = 1.0f - xx2 - zz2;
  330. float yz2 = rot.Y * z2;
  331. float wx2 = rot.W * x2;
  332. matrix.M21 = yz2 - wx2;
  333. matrix.M31 = 0f;
  334. matrix.M02 = xz2 - wy2;
  335. matrix.M12 = yz2 + wx2;
  336. matrix.M22 = 1.0f - xx2 - yy2;
  337. matrix.M32 = 0f;
  338. }
  339. public static void RfromQ(ref Matrix3 matrix, ref OMV.Vector4 rot)
  340. {
  341. float x2 = rot.X + rot.X;
  342. float y2 = rot.Y + rot.Y;
  343. float z2 = rot.Z + rot.Z;
  344. float yy2 = rot.Y * y2;
  345. float zz2 = rot.Z * z2;
  346. matrix.M00 = 1.0f - yy2 - zz2;
  347. float xy2 = rot.X * y2;
  348. float wz2 = rot.W * z2;
  349. matrix.M10 = xy2 - wz2;
  350. float xz2 = rot.X * z2;
  351. float wy2 = rot.W * y2;
  352. matrix.M20 = xz2 + wy2;
  353. matrix.M30 = 0f;
  354. matrix.M01 = xy2 + wz2;
  355. float xx2 = rot.X * x2;
  356. matrix.M11 = 1.0f - xx2 - zz2;
  357. float yz2 = rot.Y * z2;
  358. float wx2 = rot.W * x2;
  359. matrix.M21 = yz2 - wx2;
  360. matrix.M31 = 0f;
  361. matrix.M02 = xz2 - wy2;
  362. matrix.M12 = yz2 + wx2;
  363. matrix.M22 = 1.0f - xx2 - yy2;
  364. matrix.M32 = 0f;
  365. }
  366. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAllocateODEDataForThread"), SuppressUnmanagedCodeSecurity]
  367. internal static extern int AllocateODEDataForThread(uint ODEInitFlags);
  368. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnected"), SuppressUnmanagedCodeSecurity]
  369. internal static extern bool AreConnected(IntPtr b1, IntPtr b2);
  370. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dAreConnectedExcluding"), SuppressUnmanagedCodeSecurity]
  371. internal static extern bool AreConnectedExcluding(IntPtr b1, IntPtr b2, JointType joint_type);
  372. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForce"), SuppressUnmanagedCodeSecurity]
  373. internal static extern void BodyAddForce(IntPtr body, dReal fx, dReal fy, dReal fz);
  374. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtPos"), SuppressUnmanagedCodeSecurity]
  375. internal static extern void BodyAddForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz);
  376. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddForceAtRelPos"), SuppressUnmanagedCodeSecurity]
  377. internal static extern void BodyAddForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz);
  378. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForce"), SuppressUnmanagedCodeSecurity]
  379. internal static extern void BodyAddRelForce(IntPtr body, dReal fx, dReal fy, dReal fz);
  380. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtPos"), SuppressUnmanagedCodeSecurity]
  381. internal static extern void BodyAddRelForceAtPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz);
  382. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelForceAtRelPos"), SuppressUnmanagedCodeSecurity]
  383. internal static extern void BodyAddRelForceAtRelPos(IntPtr body, dReal fx, dReal fy, dReal fz, dReal px, dReal py, dReal pz);
  384. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddRelTorque"), SuppressUnmanagedCodeSecurity]
  385. internal static extern void BodyAddRelTorque(IntPtr body, dReal fx, dReal fy, dReal fz);
  386. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyAddTorque"), SuppressUnmanagedCodeSecurity]
  387. internal static extern void BodyAddTorque(IntPtr body, dReal fx, dReal fy, dReal fz);
  388. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity]
  389. internal static extern void BodyCopyPosition(IntPtr body, out Vector3 pos);
  390. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyPosition"), SuppressUnmanagedCodeSecurity]
  391. internal static extern void BodyCopyPosition(IntPtr body, out dReal X);
  392. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity]
  393. internal static extern void BodyCopyQuaternion(IntPtr body, out Quaternion quat);
  394. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyQuaternion"), SuppressUnmanagedCodeSecurity]
  395. internal static extern void BodyCopyQuaternion(IntPtr body, out dReal X);
  396. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity]
  397. internal static extern void BodyCopyRotation(IntPtr body, out Matrix3 R);
  398. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCopyRotation"), SuppressUnmanagedCodeSecurity]
  399. internal static extern void BodyCopyRotation(IntPtr body, out dReal M00);
  400. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity]
  401. internal static extern IntPtr BodyiCreate(IntPtr world);
  402. internal static IntPtr BodyCreate(IntPtr world)
  403. {
  404. NTotalBodies++;
  405. return BodyiCreate(world);
  406. }
  407. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDestroy"), SuppressUnmanagedCodeSecurity]
  408. internal static extern void BodyiDestroy(IntPtr body);
  409. internal static void BodyDestroy(IntPtr body)
  410. {
  411. NTotalBodies--;
  412. BodyiDestroy(body);
  413. }
  414. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyDisable"), SuppressUnmanagedCodeSecurity]
  415. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  416. internal static extern void BodyDisable(IntPtr body);
  417. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyEnable"), SuppressUnmanagedCodeSecurity]
  418. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  419. internal static extern void BodyEnable(IntPtr body);
  420. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity]
  421. internal static extern dReal BodyGetAutoDisableAngularThreshold(IntPtr body);
  422. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity]
  423. internal static extern bool BodyGetAutoDisableFlag(IntPtr body);
  424. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity]
  425. internal static extern void BodyGetAutoDisableDefaults(IntPtr body);
  426. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity]
  427. internal static extern dReal BodyGetAutoDisableLinearThreshold(IntPtr body);
  428. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity]
  429. internal static extern int BodyGetAutoDisableSteps(IntPtr body);
  430. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAutoDisableTime"), SuppressUnmanagedCodeSecurity]
  431. internal static extern dReal BodyGetAutoDisableTime(IntPtr body);
  432. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularVel"), SuppressUnmanagedCodeSecurity]
  433. internal extern unsafe static Vector3* BodyGetAngularVelUnsafe(IntPtr body);
  434. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  435. internal static Vector3 BodyGetAngularVel(IntPtr body)
  436. {
  437. unsafe { return *(BodyGetAngularVelUnsafe(body)); }
  438. }
  439. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  440. internal static OMV.Vector3 BodyGetAngularVelOMV(IntPtr body)
  441. {
  442. unsafe
  443. {
  444. Vector3* vtmp = BodyGetAngularVelUnsafe(body);
  445. return Unsafe.As<UBOdeNative.Vector3, OMV.Vector3>(ref *vtmp);
  446. }
  447. }
  448. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  449. internal static OMV.Vector3 BodyGetAngularVelOMVforAvatar(IntPtr body)
  450. {
  451. unsafe
  452. {
  453. Vector3* vtmp = BodyGetAngularVelUnsafe(body);
  454. return Unsafe.As<UBOdeNative.Vector3, OMV.Vector3>(ref *vtmp);
  455. }
  456. }
  457. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetData"), SuppressUnmanagedCodeSecurity]
  458. internal static extern IntPtr BodyGetData(IntPtr body);
  459. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationMode"), SuppressUnmanagedCodeSecurity]
  460. internal static extern int BodyGetFiniteRotationMode(IntPtr body);
  461. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity]
  462. internal static extern void BodyGetFiniteRotationAxis(IntPtr body, out Vector3 result);
  463. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetForce"), SuppressUnmanagedCodeSecurity]
  464. internal extern unsafe static Vector3* BodyGetForceUnsafe(IntPtr body);
  465. internal static Vector3 BodyGetForce(IntPtr body)
  466. {
  467. unsafe { return *(BodyGetForceUnsafe(body)); }
  468. }
  469. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGravityMode"), SuppressUnmanagedCodeSecurity]
  470. internal static extern bool BodyGetGravityMode(IntPtr body);
  471. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetGyroscopicMode"), SuppressUnmanagedCodeSecurity]
  472. internal static extern int BodyGetGyroscopicMode(IntPtr body);
  473. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetJoint"), SuppressUnmanagedCodeSecurity]
  474. internal static extern IntPtr BodyGetJoint(IntPtr body, int index);
  475. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearVel"), SuppressUnmanagedCodeSecurity]
  476. internal extern unsafe static Vector3* BodyGetLinearVelUnsafe(IntPtr body);
  477. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  478. internal static Vector3 BodyGetLinearVel(IntPtr body)
  479. {
  480. unsafe { return *(BodyGetLinearVelUnsafe(body)); }
  481. }
  482. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  483. internal static OMV.Vector3 BodyGetLinearVelOMV(IntPtr body)
  484. {
  485. unsafe
  486. {
  487. Vector3* vtmp = BodyGetLinearVelUnsafe(body);
  488. return Unsafe.As<UBOdeNative.Vector3, OMV.Vector3>(ref *vtmp);
  489. }
  490. }
  491. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetMass"), SuppressUnmanagedCodeSecurity]
  492. internal static extern void BodyGetMass(IntPtr body, out Mass mass);
  493. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNumJoints"), SuppressUnmanagedCodeSecurity]
  494. internal static extern int BodyGetNumJoints(IntPtr body);
  495. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPointVel"), SuppressUnmanagedCodeSecurity]
  496. internal static extern void BodyGetPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result);
  497. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosition"), SuppressUnmanagedCodeSecurity]
  498. internal extern unsafe static Vector3* BodyGetPositionUnsafe(IntPtr body);
  499. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  500. internal static Vector3 BodyGetPosition(IntPtr body)
  501. {
  502. unsafe { return *(BodyGetPositionUnsafe(body)); }
  503. }
  504. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  505. internal static OMV.Vector3 BodyGetPositionOMV(IntPtr body)
  506. {
  507. unsafe
  508. {
  509. Vector3* vtmp = BodyGetPositionUnsafe(body);
  510. return Unsafe.As<UBOdeNative.Vector3, OMV.Vector3>(ref *vtmp);
  511. }
  512. }
  513. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetPosRelPoint"), SuppressUnmanagedCodeSecurity]
  514. internal static extern void BodyGetPosRelPoint(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result);
  515. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetQuaternion"), SuppressUnmanagedCodeSecurity]
  516. internal extern unsafe static Quaternion* BodyGetQuaternionUnsafe(IntPtr body);
  517. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  518. internal static Quaternion BodyGetQuaternion(IntPtr body)
  519. {
  520. unsafe { return *(BodyGetQuaternionUnsafe(body)); }
  521. }
  522. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  523. internal static OMV.Quaternion BodyGetQuaternionOMV(IntPtr body)
  524. {
  525. unsafe
  526. {
  527. Quaternion* q = BodyGetQuaternionUnsafe(body);
  528. return new OMV.Quaternion(q->X, q->Y, q->Z, q->W);
  529. }
  530. }
  531. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointPos"), SuppressUnmanagedCodeSecurity]
  532. internal static extern void BodyGetRelPointPos(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result);
  533. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRelPointVel"), SuppressUnmanagedCodeSecurity]
  534. internal static extern void BodyGetRelPointVel(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result);
  535. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetRotation"), SuppressUnmanagedCodeSecurity]
  536. internal extern unsafe static Matrix3* BodyGetRotationUnsafe(IntPtr body);
  537. internal static Matrix3 BodyGetRotation(IntPtr body)
  538. {
  539. unsafe { return *(BodyGetRotationUnsafe(body)); }
  540. }
  541. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetTorque"), SuppressUnmanagedCodeSecurity]
  542. internal extern unsafe static Vector3* BodyGetTorqueUnsafe(IntPtr body);
  543. internal static Vector3 BodyGetTorque(IntPtr body)
  544. {
  545. unsafe { return *(BodyGetTorqueUnsafe(body)); }
  546. }
  547. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetWorld"), SuppressUnmanagedCodeSecurity]
  548. internal static extern IntPtr BodyGetWorld(IntPtr body);
  549. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetFirstGeom"), SuppressUnmanagedCodeSecurity]
  550. internal static extern IntPtr BodyGetFirstGeom(IntPtr body);
  551. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetNextGeom"), SuppressUnmanagedCodeSecurity]
  552. internal static extern IntPtr dBodyGetNextGeom(IntPtr Geom);
  553. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyIsEnabled"), SuppressUnmanagedCodeSecurity]
  554. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  555. internal static extern bool BodyIsEnabled(IntPtr body);
  556. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularVel"), SuppressUnmanagedCodeSecurity]
  557. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  558. internal static extern void BodySetAngularVel(IntPtr body, dReal x, dReal y, dReal z);
  559. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity]
  560. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  561. internal static extern void BodySetAutoDisableAngularThreshold(IntPtr body, dReal angular_threshold);
  562. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableDefaults"), SuppressUnmanagedCodeSecurity]
  563. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  564. internal static extern void BodySetAutoDisableDefaults(IntPtr body);
  565. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableFlag"), SuppressUnmanagedCodeSecurity]
  566. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  567. internal static extern void BodySetAutoDisableFlag(IntPtr body, bool do_auto_disable);
  568. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity]
  569. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  570. internal static extern void BodySetAutoDisableLinearThreshold(IntPtr body, dReal linear_threshold);
  571. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableSteps"), SuppressUnmanagedCodeSecurity]
  572. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  573. internal static extern void BodySetAutoDisableSteps(IntPtr body, int steps);
  574. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAutoDisableTime"), SuppressUnmanagedCodeSecurity]
  575. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  576. internal static extern void BodySetAutoDisableTime(IntPtr body, dReal time);
  577. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetData"), SuppressUnmanagedCodeSecurity]
  578. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  579. internal static extern void BodySetData(IntPtr body, IntPtr data);
  580. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationMode"), SuppressUnmanagedCodeSecurity]
  581. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  582. internal static extern void BodySetFiniteRotationMode(IntPtr body, int mode);
  583. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetFiniteRotationAxis"), SuppressUnmanagedCodeSecurity]
  584. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  585. internal static extern void BodySetFiniteRotationAxis(IntPtr body, dReal x, dReal y, dReal z);
  586. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDamping"), SuppressUnmanagedCodeSecurity]
  587. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  588. internal static extern void BodySetLinearDamping(IntPtr body, dReal scale);
  589. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity]
  590. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  591. internal static extern void BodySetAngularDamping(IntPtr body, dReal scale);
  592. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDamping"), SuppressUnmanagedCodeSecurity]
  593. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  594. internal static extern dReal BodyGetLinearDamping(IntPtr body);
  595. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDamping"), SuppressUnmanagedCodeSecurity]
  596. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  597. internal static extern dReal BodyGetAngularDamping(IntPtr body);
  598. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDamping"), SuppressUnmanagedCodeSecurity]
  599. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  600. internal static extern void BodySetDamping(IntPtr body, dReal linear_scale, dReal angular_scale);
  601. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity]
  602. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  603. internal static extern void BodySetAngularDampingThreshold(IntPtr body, dReal threshold);
  604. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity]
  605. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  606. internal static extern void BodySetLinearDampingThreshold(IntPtr body, dReal threshold);
  607. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity]
  608. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  609. internal static extern dReal BodyGetLinearDampingThreshold(IntPtr body);
  610. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity]
  611. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  612. internal static extern dReal BodyGetAngularDampingThreshold(IntPtr body);
  613. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetForce"), SuppressUnmanagedCodeSecurity]
  614. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  615. internal static extern void BodySetForce(IntPtr body, dReal x, dReal y, dReal z);
  616. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGravityMode"), SuppressUnmanagedCodeSecurity]
  617. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  618. internal static extern void BodySetGravityMode(IntPtr body, bool mode);
  619. /// <summary>
  620. /// Sets the Gyroscopic term status on the body specified.
  621. /// </summary>
  622. /// <param name="body">Pointer to body</param>
  623. /// <param name="enabled">NonZero enabled, Zero disabled</param>
  624. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetGyroscopicMode"), SuppressUnmanagedCodeSecurity]
  625. internal static extern void dBodySetGyroscopicMode(IntPtr body, int enabled);
  626. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetLinearVel"), SuppressUnmanagedCodeSecurity]
  627. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  628. internal static extern void BodySetLinearVel(IntPtr body, dReal x, dReal y, dReal z);
  629. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetMass"), SuppressUnmanagedCodeSecurity]
  630. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  631. internal static extern void BodySetMass(IntPtr body, ref Mass mass);
  632. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetPosition"), SuppressUnmanagedCodeSecurity]
  633. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  634. internal static extern void BodySetPosition(IntPtr body, dReal x, dReal y, dReal z);
  635. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity]
  636. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  637. internal static extern void BodySetQuaternion(IntPtr body, ref Quaternion q);
  638. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetQuaternion"), SuppressUnmanagedCodeSecurity]
  639. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  640. internal static extern void BodySetQuaternion(IntPtr body, ref dReal w);
  641. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity]
  642. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  643. internal static extern void BodySetRotation(IntPtr body, ref Matrix3 R);
  644. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetRotation"), SuppressUnmanagedCodeSecurity]
  645. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  646. internal static extern void BodySetRotation(IntPtr body, ref dReal M00);
  647. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodySetTorque"), SuppressUnmanagedCodeSecurity]
  648. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  649. internal static extern void BodySetTorque(IntPtr body, dReal x, dReal y, dReal z);
  650. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorFromWorld"), SuppressUnmanagedCodeSecurity]
  651. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  652. internal static extern void BodyVectorFromWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result);
  653. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyVectorToWorld"), SuppressUnmanagedCodeSecurity]
  654. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  655. internal static extern void BodyVectorToWorld(IntPtr body, dReal px, dReal py, dReal pz, out Vector3 result);
  656. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxBox"), SuppressUnmanagedCodeSecurity]
  657. internal static extern void BoxBox(ref Vector3 p1, ref Matrix3 R1,
  658. ref Vector3 side1, ref Vector3 p2,
  659. ref Matrix3 R2, ref Vector3 side2,
  660. ref Vector3 normal, out dReal depth, out int return_code,
  661. int maxc, out ContactGeom contact, int skip);
  662. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBoxTouchesBox"), SuppressUnmanagedCodeSecurity]
  663. internal static extern void BoxTouchesBox(ref Vector3 _p1, ref Matrix3 R1,
  664. ref Vector3 side1, ref Vector3 _p2,
  665. ref Matrix3 R2, ref Vector3 side2);
  666. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCleanupODEAllDataForThread"), SuppressUnmanagedCodeSecurity]
  667. internal static extern void CleanupODEAllDataForThread();
  668. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dClosestLineSegmentPoints"), SuppressUnmanagedCodeSecurity]
  669. internal static extern void ClosestLineSegmentPoints(ref Vector3 a1, ref Vector3 a2,
  670. ref Vector3 b1, ref Vector3 b2,
  671. ref Vector3 cp1, ref Vector3 cp2);
  672. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCloseODE"), SuppressUnmanagedCodeSecurity]
  673. internal static extern void CloseODE();
  674. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCollide"), SuppressUnmanagedCodeSecurity]
  675. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  676. internal static extern int CollidePtr(IntPtr o1, IntPtr o2, int flags, IntPtr contactgeomarray, int skip);
  677. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dConnectingJoint"), SuppressUnmanagedCodeSecurity]
  678. internal static extern IntPtr ConnectingJoint(IntPtr j1, IntPtr j2);
  679. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity]
  680. internal static extern IntPtr CreateiBox(IntPtr space, dReal lx, dReal ly, dReal lz);
  681. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  682. internal static IntPtr CreateBox(IntPtr space, dReal lx, dReal ly, dReal lz)
  683. {
  684. NTotalGeoms++;
  685. return CreateiBox(space, lx, ly, lz);
  686. }
  687. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity]
  688. internal static extern IntPtr CreateiCapsule(IntPtr space, dReal radius, dReal length);
  689. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  690. internal static IntPtr CreateCapsule(IntPtr space, dReal radius, dReal length)
  691. {
  692. NTotalGeoms++;
  693. return CreateiCapsule(space, radius, length);
  694. }
  695. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity]
  696. internal static extern IntPtr CreateiConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
  697. internal static IntPtr CreateConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons)
  698. {
  699. NTotalGeoms++;
  700. return CreateiConvex(space, planes, planeCount, points, pointCount, polygons);
  701. }
  702. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity]
  703. internal static extern IntPtr CreateiCylinder(IntPtr space, dReal radius, dReal length);
  704. internal static IntPtr CreateCylinder(IntPtr space, dReal radius, dReal length)
  705. {
  706. NTotalGeoms++;
  707. return CreateiCylinder(space, radius, length);
  708. }
  709. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity]
  710. internal static extern IntPtr CreateiHeightfield(IntPtr space, IntPtr data, int bPlaceable);
  711. internal static IntPtr CreateHeightfield(IntPtr space, IntPtr data, int bPlaceable)
  712. {
  713. NTotalGeoms++;
  714. return CreateiHeightfield(space, data, bPlaceable);
  715. }
  716. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateOSTerrain"), SuppressUnmanagedCodeSecurity]
  717. internal static extern IntPtr CreateiOSTerrain(IntPtr space, IntPtr data, int bPlaceable);
  718. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  719. internal static IntPtr CreateOSTerrain(IntPtr space, IntPtr data, int bPlaceable)
  720. {
  721. NTotalGeoms++;
  722. return CreateiOSTerrain(space, data, bPlaceable);
  723. }
  724. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity]
  725. internal static extern IntPtr CreateiGeom(int classnum);
  726. internal static IntPtr CreateGeom(int classnum)
  727. {
  728. NTotalGeoms++;
  729. return CreateiGeom(classnum);
  730. }
  731. //[DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity]
  732. //internal static extern int CreateGeomClass(ref GeomClass classptr);
  733. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomTransform"), SuppressUnmanagedCodeSecurity]
  734. internal static extern IntPtr CreateGeomTransform(IntPtr space);
  735. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity]
  736. internal static extern IntPtr CreateiPlane(IntPtr space, dReal a, dReal b, dReal c, dReal d);
  737. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  738. internal static IntPtr CreatePlane(IntPtr space, dReal a, dReal b, dReal c, dReal d)
  739. {
  740. NTotalGeoms++;
  741. return CreateiPlane(space, a, b, c, d);
  742. }
  743. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity]
  744. internal static extern IntPtr CreateiRay(IntPtr space, dReal length);
  745. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  746. internal static IntPtr CreateRay(IntPtr space, dReal length)
  747. {
  748. NTotalGeoms++;
  749. return CreateiRay(space, length);
  750. }
  751. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity]
  752. internal static extern IntPtr CreateiSphere(IntPtr space, dReal radius);
  753. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  754. internal static IntPtr CreateSphere(IntPtr space, dReal radius)
  755. {
  756. NTotalGeoms++;
  757. return CreateiSphere(space, radius);
  758. }
  759. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity]
  760. internal static extern IntPtr CreateiTriMesh(IntPtr space, IntPtr data,
  761. TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback);
  762. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  763. internal static IntPtr CreateTriMesh(IntPtr space, IntPtr data,
  764. TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback)
  765. {
  766. NTotalGeoms++;
  767. return CreateiTriMesh(space, data, callback, arrayCallback, rayCallback);
  768. }
  769. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity]
  770. internal static extern void DQfromW(dReal[] dq, ref Vector3 w, ref Quaternion q);
  771. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorCholesky"), SuppressUnmanagedCodeSecurity]
  772. internal static extern int FactorCholesky(ref dReal A00, int n);
  773. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dFactorLDLT"), SuppressUnmanagedCodeSecurity]
  774. internal static extern void FactorLDLT(ref dReal A, out dReal d, int n, int nskip);
  775. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity]
  776. internal static extern void GeomBoxGetLengths(IntPtr geom, out Vector3 len);
  777. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxGetLengths"), SuppressUnmanagedCodeSecurity]
  778. internal static extern void GeomBoxGetLengths(IntPtr geom, out dReal x);
  779. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxPointDepth"), SuppressUnmanagedCodeSecurity]
  780. internal static extern dReal GeomBoxPointDepth(IntPtr geom, dReal x, dReal y, dReal z);
  781. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomBoxSetLengths"), SuppressUnmanagedCodeSecurity]
  782. internal static extern void GeomBoxSetLengths(IntPtr geom, dReal x, dReal y, dReal z);
  783. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleGetParams"), SuppressUnmanagedCodeSecurity]
  784. internal static extern void GeomCapsuleGetParams(IntPtr geom, out dReal radius, out dReal length);
  785. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsulePointDepth"), SuppressUnmanagedCodeSecurity]
  786. internal static extern dReal GeomCapsulePointDepth(IntPtr geom, dReal x, dReal y, dReal z);
  787. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCapsuleSetParams"), SuppressUnmanagedCodeSecurity]
  788. internal static extern void GeomCapsuleSetParams(IntPtr geom, dReal radius, dReal length);
  789. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomClearOffset"), SuppressUnmanagedCodeSecurity]
  790. internal static extern void GeomClearOffset(IntPtr geom);
  791. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity]
  792. internal static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref Vector3 pos);
  793. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetPosition"), SuppressUnmanagedCodeSecurity]
  794. internal static extern IntPtr GeomCopyOffsetPosition(IntPtr geom, ref dReal X);
  795. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity]
  796. internal static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref Quaternion Q);
  797. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetQuaternion"), SuppressUnmanagedCodeSecurity]
  798. internal static extern void GeomCopyOffsetQuaternion(IntPtr geom, ref dReal X);
  799. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity]
  800. internal static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref Matrix3 R);
  801. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyOffsetRotation"), SuppressUnmanagedCodeSecurity]
  802. internal static extern IntPtr GeomCopyOffsetRotation(IntPtr geom, ref dReal M00);
  803. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity]
  804. internal static extern void GeomCopyPosition(IntPtr geom, out Vector3 pos);
  805. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyPosition"), SuppressUnmanagedCodeSecurity]
  806. internal static extern void GeomCopyPosition(IntPtr geom, out dReal X);
  807. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity]
  808. internal static extern void GeomCopyRotation(IntPtr geom, out Matrix3 R);
  809. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCopyRotation"), SuppressUnmanagedCodeSecurity]
  810. internal static extern void GeomCopyRotation(IntPtr geom, out dReal M00);
  811. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderGetParams"), SuppressUnmanagedCodeSecurity]
  812. internal static extern void GeomCylinderGetParams(IntPtr geom, out dReal radius, out dReal length);
  813. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomCylinderSetParams"), SuppressUnmanagedCodeSecurity]
  814. internal static extern void GeomCylinderSetParams(IntPtr geom, dReal radius, dReal length);
  815. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity]
  816. internal static extern void GeomiDestroy(IntPtr geom);
  817. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  818. internal static void GeomDestroy(IntPtr geom)
  819. {
  820. NTotalGeoms--;
  821. GeomiDestroy(geom);
  822. }
  823. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity]
  824. internal static extern void GeomDisable(IntPtr geom);
  825. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomEnable"), SuppressUnmanagedCodeSecurity]
  826. internal static extern void GeomEnable(IntPtr geom);
  827. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetAABB"), SuppressUnmanagedCodeSecurity]
  828. internal static extern void GeomGetAABB(IntPtr geom, out AABB aabb);
  829. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetBody"), SuppressUnmanagedCodeSecurity]
  830. internal static extern IntPtr GeomGetBody(IntPtr geom);
  831. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCategoryBits"), SuppressUnmanagedCodeSecurity]
  832. internal static extern uint GeomGetCategoryBits(IntPtr geom);
  833. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClassData"), SuppressUnmanagedCodeSecurity]
  834. internal static extern IntPtr GeomGetClassData(IntPtr geom);
  835. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetCollideBits"), SuppressUnmanagedCodeSecurity]
  836. internal static extern uint GeomGetCollideBits(IntPtr geom);
  837. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetClass"), SuppressUnmanagedCodeSecurity]
  838. internal static extern GeomClassID GeomGetClass(IntPtr geom);
  839. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetData"), SuppressUnmanagedCodeSecurity]
  840. internal static extern IntPtr GeomGetData(IntPtr geom);
  841. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetPosition"), SuppressUnmanagedCodeSecurity]
  842. internal extern unsafe static Vector3* GeomGetOffsetPositionUnsafe(IntPtr geom);
  843. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  844. internal static Vector3 GeomGetOffsetPosition(IntPtr geom)
  845. {
  846. unsafe { return *(GeomGetOffsetPositionUnsafe(geom)); }
  847. }
  848. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetOffsetRotation"), SuppressUnmanagedCodeSecurity]
  849. internal extern unsafe static Matrix3* GeomGetOffsetRotationUnsafe(IntPtr geom);
  850. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  851. internal static Matrix3 GeomGetOffsetRotation(IntPtr geom)
  852. {
  853. unsafe { return *(GeomGetOffsetRotationUnsafe(geom)); }
  854. }
  855. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetPosition"), SuppressUnmanagedCodeSecurity]
  856. internal extern unsafe static Vector3* GeomGetPositionUnsafe(IntPtr geom);
  857. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  858. internal static Vector3 GeomGetPosition(IntPtr geom)
  859. {
  860. unsafe { return *(GeomGetPositionUnsafe(geom)); }
  861. }
  862. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  863. internal static OMV.Vector3 GeomGetPositionOMV(IntPtr geom)
  864. {
  865. unsafe
  866. {
  867. Vector3* vtmp = GeomGetPositionUnsafe(geom);
  868. return Unsafe.As<UBOdeNative.Vector3, OMV.Vector3>(ref *vtmp);
  869. }
  870. }
  871. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity]
  872. internal static extern void GeomCopyQuaternion(IntPtr geom, out Quaternion q);
  873. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  874. internal static OMV.Quaternion GeomGetQuaternionOMV(IntPtr geom)
  875. {
  876. GeomCopyQuaternion(geom, out Quaternion qtmp);
  877. return new OMV.Quaternion(qtmp.X, qtmp.Y, qtmp.Z, qtmp.W);
  878. }
  879. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetQuaternion"), SuppressUnmanagedCodeSecurity]
  880. internal static extern void GeomCopyQuaternion(IntPtr geom, out dReal X);
  881. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetRotation"), SuppressUnmanagedCodeSecurity]
  882. internal extern unsafe static Matrix3* GeomGetRotationUnsafe(IntPtr geom);
  883. internal static Matrix3 GeomGetRotation(IntPtr geom)
  884. {
  885. unsafe { return *(GeomGetRotationUnsafe(geom)); }
  886. }
  887. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomGetSpace"), SuppressUnmanagedCodeSecurity]
  888. internal static extern IntPtr GeomGetSpace(IntPtr geom);
  889. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity]
  890. internal static extern void GeomHeightfieldDataBuildByte(IntPtr d, byte[] pHeightData, int bCopyHeightData,
  891. dReal width, dReal depth, int widthSamples, int depthSamples,
  892. dReal scale, dReal offset, dReal thickness, int bWrap);
  893. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildByte"), SuppressUnmanagedCodeSecurity]
  894. internal static extern void GeomHeightfieldDataBuildByte(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
  895. dReal width, dReal depth, int widthSamples, int depthSamples,
  896. dReal scale, dReal offset, dReal thickness, int bWrap);
  897. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildCallback"), SuppressUnmanagedCodeSecurity]
  898. internal static extern void GeomHeightfieldDataBuildCallback(IntPtr d, IntPtr pUserData, HeightfieldGetHeight pCallback,
  899. dReal width, dReal depth, int widthSamples, int depthSamples,
  900. dReal scale, dReal offset, dReal thickness, int bWrap);
  901. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity]
  902. internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, ushort[] pHeightData, int bCopyHeightData,
  903. dReal width, dReal depth, int widthSamples, int depthSamples,
  904. dReal scale, dReal offset, dReal thickness, int bWrap);
  905. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity]
  906. internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, short[] pHeightData, int bCopyHeightData,
  907. dReal width, dReal depth, int widthSamples, int depthSamples,
  908. dReal scale, dReal offset, dReal thickness, int bWrap);
  909. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildShort"), SuppressUnmanagedCodeSecurity]
  910. internal static extern void GeomHeightfieldDataBuildShort(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
  911. dReal width, dReal depth, int widthSamples, int depthSamples,
  912. dReal scale, dReal offset, dReal thickness, int bWrap);
  913. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity]
  914. internal static extern void GeomHeightfieldDataBuildSingle(IntPtr d, float[] pHeightData, int bCopyHeightData,
  915. dReal width, dReal depth, int widthSamples, int depthSamples,
  916. dReal scale, dReal offset, dReal thickness, int bWrap);
  917. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildSingle"), SuppressUnmanagedCodeSecurity]
  918. internal static extern void GeomHeightfieldDataBuildSingle(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
  919. dReal width, dReal depth, int widthSamples, int depthSamples,
  920. dReal scale, dReal offset, dReal thickness, int bWrap);
  921. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity]
  922. internal static extern void GeomHeightfieldDataBuildDouble(IntPtr d, double[] pHeightData, int bCopyHeightData,
  923. dReal width, dReal depth, int widthSamples, int depthSamples,
  924. dReal scale, dReal offset, dReal thickness, int bWrap);
  925. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataBuildDouble"), SuppressUnmanagedCodeSecurity]
  926. internal static extern void GeomHeightfieldDataBuildDouble(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
  927. dReal width, dReal depth, int widthSamples, int depthSamples,
  928. dReal scale, dReal offset, dReal thickness, int bWrap);
  929. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataCreate"), SuppressUnmanagedCodeSecurity]
  930. internal static extern IntPtr GeomHeightfieldDataCreate();
  931. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataDestroy"), SuppressUnmanagedCodeSecurity]
  932. internal static extern void GeomHeightfieldDataDestroy(IntPtr d);
  933. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldDataSetBounds"), SuppressUnmanagedCodeSecurity]
  934. internal static extern void GeomHeightfieldDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight);
  935. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldGetHeightfieldData"), SuppressUnmanagedCodeSecurity]
  936. internal static extern IntPtr GeomHeightfieldGetHeightfieldData(IntPtr g);
  937. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomHeightfieldSetHeightfieldData"), SuppressUnmanagedCodeSecurity]
  938. internal static extern void GeomHeightfieldSetHeightfieldData(IntPtr g, IntPtr d);
  939. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
  940. internal static extern void GeomOSTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData,
  941. dReal sampleSize, int widthSamples, int depthSamples,
  942. dReal offset, dReal thickness, int bWrap);
  943. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
  944. internal static extern void GeomOSTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
  945. dReal sampleSize, int widthSamples, int depthSamples,
  946. dReal thickness, int bWrap);
  947. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataCreate"), SuppressUnmanagedCodeSecurity]
  948. internal static extern IntPtr GeomOSTerrainDataCreate();
  949. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataDestroy"), SuppressUnmanagedCodeSecurity]
  950. internal static extern void GeomOSTerrainDataDestroy(IntPtr d);
  951. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity]
  952. internal static extern void GeomOSTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight);
  953. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity]
  954. internal static extern IntPtr GeomOSTerrainGetHeightfieldData(IntPtr g);
  955. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity]
  956. internal static extern void GeomOSTerrainSetHeightfieldData(IntPtr g, IntPtr d);
  957. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity]
  958. internal static extern bool GeomIsEnabled(IntPtr geom);
  959. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsOffset"), SuppressUnmanagedCodeSecurity]
  960. internal static extern bool GeomIsOffset(IntPtr geom);
  961. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsSpace"), SuppressUnmanagedCodeSecurity]
  962. internal static extern bool GeomIsSpace(IntPtr geom);
  963. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity]
  964. internal static extern void GeomPlaneGetParams(IntPtr geom, ref Vector4 result);
  965. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneGetParams"), SuppressUnmanagedCodeSecurity]
  966. internal static extern void GeomPlaneGetParams(IntPtr geom, ref dReal A);
  967. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlanePointDepth"), SuppressUnmanagedCodeSecurity]
  968. internal static extern dReal GeomPlanePointDepth(IntPtr geom, dReal x, dReal y, dReal z);
  969. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomPlaneSetParams"), SuppressUnmanagedCodeSecurity]
  970. internal static extern void GeomPlaneSetParams(IntPtr plane, dReal a, dReal b, dReal c, dReal d);
  971. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity]
  972. internal static extern void GeomRayGet(IntPtr ray, ref Vector3 start, ref Vector3 dir);
  973. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGet"), SuppressUnmanagedCodeSecurity]
  974. internal static extern void GeomRayGet(IntPtr ray, ref dReal startX, ref dReal dirX);
  975. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetClosestHit"), SuppressUnmanagedCodeSecurity]
  976. internal static extern int GeomRayGetClosestHit(IntPtr ray);
  977. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetLength"), SuppressUnmanagedCodeSecurity]
  978. internal static extern dReal GeomRayGetLength(IntPtr ray);
  979. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRayGetParams"), SuppressUnmanagedCodeSecurity]
  980. internal static extern dReal GeomRayGetParams(IntPtr g, out int firstContact, out int backfaceCull);
  981. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySet"), SuppressUnmanagedCodeSecurity]
  982. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  983. internal static extern void GeomRaySet(IntPtr ray, dReal px, dReal py, dReal pz, dReal dx, dReal dy, dReal dz);
  984. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetClosestHit"), SuppressUnmanagedCodeSecurity]
  985. internal static extern void GeomRaySetClosestHit(IntPtr ray, int closestHit);
  986. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetLength"), SuppressUnmanagedCodeSecurity]
  987. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  988. internal static extern void GeomRaySetLength(IntPtr ray, dReal length);
  989. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomRaySetParams"), SuppressUnmanagedCodeSecurity]
  990. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  991. internal static extern void GeomRaySetParams(IntPtr ray, int firstContact, int backfaceCull);
  992. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetBody"), SuppressUnmanagedCodeSecurity]
  993. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  994. internal static extern void GeomSetBody(IntPtr geom, IntPtr body);
  995. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCategoryBits"), SuppressUnmanagedCodeSecurity]
  996. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  997. internal static extern void GeomSetCategoryBits(IntPtr geom, uint bits);
  998. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetCollideBits"), SuppressUnmanagedCodeSecurity]
  999. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  1000. internal static extern void GeomSetCollideBits(IntPtr geom, uint bits);
  1001. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetConvex"), SuppressUnmanagedCodeSecurity]
  1002. internal static extern IntPtr GeomSetConvex(IntPtr geom, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
  1003. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetData"), SuppressUnmanagedCodeSecurity]
  1004. internal static extern void GeomSetData(IntPtr geom, IntPtr data);
  1005. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetPosition"), SuppressUnmanagedCodeSecurity]
  1006. internal static extern void GeomSetOffsetPosition(IntPtr geom, dReal x, dReal y, dReal z);
  1007. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity]
  1008. internal static extern void GeomSetOffsetQuaternion(IntPtr geom, ref Quaternion Q);
  1009. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetQuaternion"), SuppressUnmanagedCodeSecurity]
  1010. internal static extern void GeomSetOffsetQuaternion(IntPtr geom, ref dReal X);
  1011. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity]
  1012. internal static extern void GeomSetOffsetRotation(IntPtr geom, ref Matrix3 R);
  1013. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetRotation"), SuppressUnmanagedCodeSecurity]
  1014. internal static extern void GeomSetOffsetRotation(IntPtr geom, ref dReal M00);
  1015. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldPosition"), SuppressUnmanagedCodeSecurity]
  1016. internal static extern void GeomSetOffsetWorldPosition(IntPtr geom, dReal x, dReal y, dReal z);
  1017. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity]
  1018. internal static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref Quaternion Q);
  1019. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldQuaternion"), SuppressUnmanagedCodeSecurity]
  1020. internal static extern void GeomSetOffsetWorldQuaternion(IntPtr geom, ref dReal X);
  1021. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity]
  1022. internal static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref Matrix3 R);
  1023. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetOffsetWorldRotation"), SuppressUnmanagedCodeSecurity]
  1024. internal static extern void GeomSetOffsetWorldRotation(IntPtr geom, ref dReal M00);
  1025. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetPosition"), SuppressUnmanagedCodeSecurity]
  1026. internal static extern void GeomSetPosition(IntPtr geom, dReal x, dReal y, dReal z);
  1027. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity]
  1028. internal static extern void GeomSetQuaternion(IntPtr geom, ref Quaternion quat);
  1029. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetQuaternion"), SuppressUnmanagedCodeSecurity]
  1030. internal static extern void GeomSetQuaternion(IntPtr geom, ref dReal w);
  1031. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity]
  1032. internal static extern void GeomSetRotation(IntPtr geom, ref Matrix3 R);
  1033. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSetRotation"), SuppressUnmanagedCodeSecurity]
  1034. internal static extern void GeomSetRotation(IntPtr geom, ref dReal M00);
  1035. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereGetRadius"), SuppressUnmanagedCodeSecurity]
  1036. internal static extern dReal GeomSphereGetRadius(IntPtr geom);
  1037. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSpherePointDepth"), SuppressUnmanagedCodeSecurity]
  1038. internal static extern dReal GeomSpherePointDepth(IntPtr geom, dReal x, dReal y, dReal z);
  1039. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomSphereSetRadius"), SuppressUnmanagedCodeSecurity]
  1040. internal static extern void GeomSphereSetRadius(IntPtr geom, dReal radius);
  1041. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetCleanup"), SuppressUnmanagedCodeSecurity]
  1042. internal static extern int GeomTransformGetCleanup(IntPtr geom);
  1043. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetGeom"), SuppressUnmanagedCodeSecurity]
  1044. internal static extern IntPtr GeomTransformGetGeom(IntPtr geom);
  1045. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformGetInfo"), SuppressUnmanagedCodeSecurity]
  1046. internal static extern int GeomTransformGetInfo(IntPtr geom);
  1047. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetCleanup"), SuppressUnmanagedCodeSecurity]
  1048. internal static extern void GeomTransformSetCleanup(IntPtr geom, int mode);
  1049. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetGeom"), SuppressUnmanagedCodeSecurity]
  1050. internal static extern void GeomTransformSetGeom(IntPtr geom, IntPtr obj);
  1051. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTransformSetInfo"), SuppressUnmanagedCodeSecurity]
  1052. internal static extern void GeomTransformSetInfo(IntPtr geom, int info);
  1053. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity]
  1054. internal static extern void GeomTriMeshDataBuildDouble(IntPtr d,
  1055. double[] vertices, int vertexStride, int vertexCount,
  1056. int[] indices, int indexCount, int triStride);
  1057. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble"), SuppressUnmanagedCodeSecurity]
  1058. internal static extern void GeomTriMeshDataBuildDouble(IntPtr d,
  1059. IntPtr vertices, int vertexStride, int vertexCount,
  1060. IntPtr indices, int indexCount, int triStride);
  1061. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity]
  1062. internal static extern void GeomTriMeshDataBuildDouble1(IntPtr d,
  1063. double[] vertices, int vertexStride, int vertexCount,
  1064. int[] indices, int indexCount, int triStride,
  1065. double[] normals);
  1066. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildDouble1"), SuppressUnmanagedCodeSecurity]
  1067. internal static extern void GeomTriMeshDataBuildDouble(IntPtr d,
  1068. IntPtr vertices, int vertexStride, int vertexCount,
  1069. IntPtr indices, int indexCount, int triStride,
  1070. IntPtr normals);
  1071. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity]
  1072. internal static extern void GeomTriMeshDataBuildSingle(IntPtr d,
  1073. dReal[] vertices, int vertexStride, int vertexCount,
  1074. int[] indices, int indexCount, int triStride);
  1075. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple"), SuppressUnmanagedCodeSecurity]
  1076. internal static extern void GeomTriMeshDataBuildSingle(IntPtr d,
  1077. IntPtr vertices, int vertexStride, int vertexCount,
  1078. IntPtr indices, int indexCount, int triStride);
  1079. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity]
  1080. internal static extern void GeomTriMeshDataBuildSingle1(IntPtr d,
  1081. dReal[] vertices, int vertexStride, int vertexCount,
  1082. int[] indices, int indexCount, int triStride,
  1083. dReal[] normals);
  1084. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSimple1"), SuppressUnmanagedCodeSecurity]
  1085. internal static extern void GeomTriMeshDataBuildSingle1(IntPtr d,
  1086. IntPtr vertices, int vertexStride, int vertexCount,
  1087. IntPtr indices, int indexCount, int triStride,
  1088. IntPtr normals);
  1089. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity]
  1090. internal static extern void GeomTriMeshDataBuildSimple(IntPtr d,
  1091. float[] vertices, int vertexStride, int vertexCount,
  1092. int[] indices, int indexCount, int triStride);
  1093. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle"), SuppressUnmanagedCodeSecurity]
  1094. internal static extern void GeomTriMeshDataBuildSimple(IntPtr d,
  1095. IntPtr vertices, int vertexStride, int vertexCount,
  1096. IntPtr indices, int indexCount, int triStride);
  1097. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity]
  1098. internal static extern void GeomTriMeshDataBuildSimple1(IntPtr d,
  1099. float[] vertices, int vertexStride, int vertexCount,
  1100. int[] indices, int indexCount, int triStride,
  1101. float[] normals);
  1102. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataBuildSingle1"), SuppressUnmanagedCodeSecurity]
  1103. internal static extern void GeomTriMeshDataBuildSimple1(IntPtr d,
  1104. IntPtr vertices, int vertexStride, int vertexCount,
  1105. IntPtr indices, int indexCount, int triStride,
  1106. IntPtr normals);
  1107. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshClearTCCache"), SuppressUnmanagedCodeSecurity]
  1108. internal static extern void GeomTriMeshClearTCCache(IntPtr g);
  1109. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataCreate"), SuppressUnmanagedCodeSecurity]
  1110. internal static extern IntPtr GeomTriMeshDataCreate();
  1111. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataDestroy"), SuppressUnmanagedCodeSecurity]
  1112. internal static extern void GeomTriMeshDataDestroy(IntPtr d);
  1113. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataGet"), SuppressUnmanagedCodeSecurity]
  1114. internal static extern IntPtr GeomTriMeshDataGet(IntPtr d, int data_id);
  1115. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataPreprocess"), SuppressUnmanagedCodeSecurity]
  1116. internal static extern void GeomTriMeshDataPreprocess(IntPtr d);
  1117. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataSet"), SuppressUnmanagedCodeSecurity]
  1118. internal static extern void GeomTriMeshDataSet(IntPtr d, int data_id, IntPtr in_data);
  1119. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshDataUpdate"), SuppressUnmanagedCodeSecurity]
  1120. internal static extern void GeomTriMeshDataUpdate(IntPtr d);
  1121. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshEnableTC"), SuppressUnmanagedCodeSecurity]
  1122. internal static extern void GeomTriMeshEnableTC(IntPtr g, int geomClass, bool enable);
  1123. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetArrayCallback"), SuppressUnmanagedCodeSecurity]
  1124. internal static extern TriArrayCallback GeomTriMeshGetArrayCallback(IntPtr g);
  1125. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetCallback"), SuppressUnmanagedCodeSecurity]
  1126. internal static extern TriCallback GeomTriMeshGetCallback(IntPtr g);
  1127. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetData"), SuppressUnmanagedCodeSecurity]
  1128. internal static extern IntPtr GeomTriMeshGetData(IntPtr g);
  1129. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetLastTransform"), SuppressUnmanagedCodeSecurity]
  1130. internal extern unsafe static Matrix4* GeomTriMeshGetLastTransformUnsafe(IntPtr geom);
  1131. internal static Matrix4 GeomTriMeshGetLastTransform(IntPtr geom)
  1132. {
  1133. unsafe { return *(GeomTriMeshGetLastTransformUnsafe(geom)); }
  1134. }
  1135. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetPoint"), SuppressUnmanagedCodeSecurity]
  1136. internal extern static void GeomTriMeshGetPoint(IntPtr g, int index, dReal u, dReal v, ref Vector3 outVec);
  1137. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetRayCallback"), SuppressUnmanagedCodeSecurity]
  1138. internal static extern TriRayCallback GeomTriMeshGetRayCallback(IntPtr g);
  1139. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangle"), SuppressUnmanagedCodeSecurity]
  1140. internal extern static void GeomTriMeshGetTriangle(IntPtr g, int index, ref Vector3 v0, ref Vector3 v1, ref Vector3 v2);
  1141. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriangleCount"), SuppressUnmanagedCodeSecurity]
  1142. internal extern static int GeomTriMeshGetTriangleCount(IntPtr g);
  1143. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshGetTriMeshDataID"), SuppressUnmanagedCodeSecurity]
  1144. internal static extern IntPtr GeomTriMeshGetTriMeshDataID(IntPtr g);
  1145. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshIsTCEnabled"), SuppressUnmanagedCodeSecurity]
  1146. internal static extern bool GeomTriMeshIsTCEnabled(IntPtr g, int geomClass);
  1147. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetArrayCallback"), SuppressUnmanagedCodeSecurity]
  1148. internal static extern void GeomTriMeshSetArrayCallback(IntPtr g, TriArrayCallback arrayCallback);
  1149. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetCallback"), SuppressUnmanagedCodeSecurity]
  1150. internal static extern void GeomTriMeshSetCallback(IntPtr g, TriCallback callback);
  1151. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetData"), SuppressUnmanagedCodeSecurity]
  1152. internal static extern void GeomTriMeshSetData(IntPtr g, IntPtr data);
  1153. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity]
  1154. internal static extern void GeomTriMeshSetLastTransform(IntPtr g, ref Matrix4 last_trans);
  1155. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetLastTransform"), SuppressUnmanagedCodeSecurity]
  1156. internal static extern void GeomTriMeshSetLastTransform(IntPtr g, ref dReal M00);
  1157. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomTriMeshSetRayCallback"), SuppressUnmanagedCodeSecurity]
  1158. internal static extern void GeomTriMeshSetRayCallback(IntPtr g, TriRayCallback callback);
  1159. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGetConfiguration"), SuppressUnmanagedCodeSecurity]
  1160. internal static extern IntPtr iGetConfiguration();
  1161. internal static string GetConfiguration()
  1162. {
  1163. IntPtr ptr = iGetConfiguration();
  1164. string s = Marshal.PtrToStringAnsi(ptr);
  1165. return s;
  1166. }
  1167. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceCreate"), SuppressUnmanagedCodeSecurity]
  1168. internal static extern IntPtr HashSpaceCreate(IntPtr space);
  1169. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceGetLevels"), SuppressUnmanagedCodeSecurity]
  1170. internal static extern void HashSpaceGetLevels(IntPtr space, out int minlevel, out int maxlevel);
  1171. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dHashSpaceSetLevels"), SuppressUnmanagedCodeSecurity]
  1172. internal static extern void HashSpaceSetLevels(IntPtr space, int minlevel, int maxlevel);
  1173. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInfiniteAABB"), SuppressUnmanagedCodeSecurity]
  1174. internal static extern void InfiniteAABB(IntPtr geom, out AABB aabb);
  1175. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE"), SuppressUnmanagedCodeSecurity]
  1176. internal static extern void InitODE();
  1177. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInitODE2"), SuppressUnmanagedCodeSecurity]
  1178. internal static extern int InitODE2(uint ODEInitFlags);
  1179. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dIsPositiveDefinite"), SuppressUnmanagedCodeSecurity]
  1180. internal static extern int IsPositiveDefinite(ref dReal A, int n);
  1181. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dInvertPDMatrix"), SuppressUnmanagedCodeSecurity]
  1182. internal static extern int InvertPDMatrix(ref dReal A, out dReal Ainv, int n);
  1183. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddAMotorTorques"), SuppressUnmanagedCodeSecurity]
  1184. internal static extern void JointAddAMotorTorques(IntPtr joint, dReal torque1, dReal torque2, dReal torque3);
  1185. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHingeTorque"), SuppressUnmanagedCodeSecurity]
  1186. internal static extern void JointAddHingeTorque(IntPtr joint, dReal torque);
  1187. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddHinge2Torque"), SuppressUnmanagedCodeSecurity]
  1188. internal static extern void JointAddHinge2Torques(IntPtr joint, dReal torque1, dReal torque2);
  1189. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddPRTorque"), SuppressUnmanagedCodeSecurity]
  1190. internal static extern void JointAddPRTorque(IntPtr joint, dReal torque);
  1191. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddUniversalTorque"), SuppressUnmanagedCodeSecurity]
  1192. internal static extern void JointAddUniversalTorques(IntPtr joint, dReal torque1, dReal torque2);
  1193. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAddSliderForce"), SuppressUnmanagedCodeSecurity]
  1194. internal static extern void JointAddSliderForce(IntPtr joint, dReal force);
  1195. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointAttach"), SuppressUnmanagedCodeSecurity]
  1196. internal static extern void JointAttach(IntPtr joint, IntPtr body1, IntPtr body2);
  1197. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateAMotor"), SuppressUnmanagedCodeSecurity]
  1198. internal static extern IntPtr JointCreateAMotor(IntPtr world, IntPtr group);
  1199. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateBall"), SuppressUnmanagedCodeSecurity]
  1200. internal static extern IntPtr JointCreateBall(IntPtr world, IntPtr group);
  1201. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity]
  1202. internal static extern IntPtr JointCreateContact(IntPtr world, IntPtr group, ref Contact contact);
  1203. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateContact"), SuppressUnmanagedCodeSecurity]
  1204. internal static extern IntPtr JointCreateContactPtr(IntPtr world, IntPtr group, IntPtr contact);
  1205. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateFixed"), SuppressUnmanagedCodeSecurity]
  1206. internal static extern IntPtr JointCreateFixed(IntPtr world, IntPtr group);
  1207. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge"), SuppressUnmanagedCodeSecurity]
  1208. internal static extern IntPtr JointCreateHinge(IntPtr world, IntPtr group);
  1209. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateHinge2"), SuppressUnmanagedCodeSecurity]
  1210. internal static extern IntPtr JointCreateHinge2(IntPtr world, IntPtr group);
  1211. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateLMotor"), SuppressUnmanagedCodeSecurity]
  1212. internal static extern IntPtr JointCreateLMotor(IntPtr world, IntPtr group);
  1213. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateNull"), SuppressUnmanagedCodeSecurity]
  1214. internal static extern IntPtr JointCreateNull(IntPtr world, IntPtr group);
  1215. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePR"), SuppressUnmanagedCodeSecurity]
  1216. internal static extern IntPtr JointCreatePR(IntPtr world, IntPtr group);
  1217. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreatePlane2D"), SuppressUnmanagedCodeSecurity]
  1218. internal static extern IntPtr JointCreatePlane2D(IntPtr world, IntPtr group);
  1219. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateSlider"), SuppressUnmanagedCodeSecurity]
  1220. internal static extern IntPtr JointCreateSlider(IntPtr world, IntPtr group);
  1221. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointCreateUniversal"), SuppressUnmanagedCodeSecurity]
  1222. internal static extern IntPtr JointCreateUniversal(IntPtr world, IntPtr group);
  1223. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointDestroy"), SuppressUnmanagedCodeSecurity]
  1224. internal static extern void JointDestroy(IntPtr j);
  1225. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngle"), SuppressUnmanagedCodeSecurity]
  1226. internal static extern dReal JointGetAMotorAngle(IntPtr j, int anum);
  1227. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAngleRate"), SuppressUnmanagedCodeSecurity]
  1228. internal static extern dReal JointGetAMotorAngleRate(IntPtr j, int anum);
  1229. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxis"), SuppressUnmanagedCodeSecurity]
  1230. internal static extern void JointGetAMotorAxis(IntPtr j, int anum, out Vector3 result);
  1231. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorAxisRel"), SuppressUnmanagedCodeSecurity]
  1232. internal static extern int JointGetAMotorAxisRel(IntPtr j, int anum);
  1233. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorMode"), SuppressUnmanagedCodeSecurity]
  1234. internal static extern int JointGetAMotorMode(IntPtr j);
  1235. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorNumAxes"), SuppressUnmanagedCodeSecurity]
  1236. internal static extern int JointGetAMotorNumAxes(IntPtr j);
  1237. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetAMotorParam"), SuppressUnmanagedCodeSecurity]
  1238. internal static extern dReal JointGetAMotorParam(IntPtr j, int parameter);
  1239. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor"), SuppressUnmanagedCodeSecurity]
  1240. internal static extern void JointGetBallAnchor(IntPtr j, out Vector3 result);
  1241. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBallAnchor2"), SuppressUnmanagedCodeSecurity]
  1242. internal static extern void JointGetBallAnchor2(IntPtr j, out Vector3 result);
  1243. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetBody"), SuppressUnmanagedCodeSecurity]
  1244. internal static extern IntPtr JointGetBody(IntPtr j);
  1245. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetData"), SuppressUnmanagedCodeSecurity]
  1246. internal static extern IntPtr JointGetData(IntPtr j);
  1247. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetFeedback"), SuppressUnmanagedCodeSecurity]
  1248. internal extern unsafe static JointFeedback* JointGetFeedbackUnsafe(IntPtr j);
  1249. internal static JointFeedback JointGetFeedback(IntPtr j)
  1250. {
  1251. unsafe { return *(JointGetFeedbackUnsafe(j)); }
  1252. }
  1253. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor"), SuppressUnmanagedCodeSecurity]
  1254. internal static extern void JointGetHingeAnchor(IntPtr j, out Vector3 result);
  1255. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngle"), SuppressUnmanagedCodeSecurity]
  1256. internal static extern dReal JointGetHingeAngle(IntPtr j);
  1257. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAngleRate"), SuppressUnmanagedCodeSecurity]
  1258. internal static extern dReal JointGetHingeAngleRate(IntPtr j);
  1259. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAxis"), SuppressUnmanagedCodeSecurity]
  1260. internal static extern void JointGetHingeAxis(IntPtr j, out Vector3 result);
  1261. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeParam"), SuppressUnmanagedCodeSecurity]
  1262. internal static extern dReal JointGetHingeParam(IntPtr j, int parameter);
  1263. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1"), SuppressUnmanagedCodeSecurity]
  1264. internal static extern dReal JointGetHinge2Angle1(IntPtr j);
  1265. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle1Rate"), SuppressUnmanagedCodeSecurity]
  1266. internal static extern dReal JointGetHinge2Angle1Rate(IntPtr j);
  1267. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Angle2Rate"), SuppressUnmanagedCodeSecurity]
  1268. internal static extern dReal JointGetHinge2Angle2Rate(IntPtr j);
  1269. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHingeAnchor2"), SuppressUnmanagedCodeSecurity]
  1270. internal static extern void JointGetHingeAnchor2(IntPtr j, out Vector3 result);
  1271. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor"), SuppressUnmanagedCodeSecurity]
  1272. internal static extern void JointGetHinge2Anchor(IntPtr j, out Vector3 result);
  1273. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Anchor2"), SuppressUnmanagedCodeSecurity]
  1274. internal static extern void JointGetHinge2Anchor2(IntPtr j, out Vector3 result);
  1275. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis1"), SuppressUnmanagedCodeSecurity]
  1276. internal static extern void JointGetHinge2Axis1(IntPtr j, out Vector3 result);
  1277. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Axis2"), SuppressUnmanagedCodeSecurity]
  1278. internal static extern void JointGetHinge2Axis2(IntPtr j, out Vector3 result);
  1279. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetHinge2Param"), SuppressUnmanagedCodeSecurity]
  1280. internal static extern dReal JointGetHinge2Param(IntPtr j, int parameter);
  1281. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorAxis"), SuppressUnmanagedCodeSecurity]
  1282. internal static extern void JointGetLMotorAxis(IntPtr j, int anum, out Vector3 result);
  1283. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorNumAxes"), SuppressUnmanagedCodeSecurity]
  1284. internal static extern int JointGetLMotorNumAxes(IntPtr j);
  1285. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetLMotorParam"), SuppressUnmanagedCodeSecurity]
  1286. internal static extern dReal JointGetLMotorParam(IntPtr j, int parameter);
  1287. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAnchor"), SuppressUnmanagedCodeSecurity]
  1288. internal static extern void JointGetPRAnchor(IntPtr j, out Vector3 result);
  1289. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis1"), SuppressUnmanagedCodeSecurity]
  1290. internal static extern void JointGetPRAxis1(IntPtr j, out Vector3 result);
  1291. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRAxis2"), SuppressUnmanagedCodeSecurity]
  1292. internal static extern void JointGetPRAxis2(IntPtr j, out Vector3 result);
  1293. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRParam"), SuppressUnmanagedCodeSecurity]
  1294. internal static extern dReal JointGetPRParam(IntPtr j, int parameter);
  1295. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPosition"), SuppressUnmanagedCodeSecurity]
  1296. internal static extern dReal JointGetPRPosition(IntPtr j);
  1297. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetPRPositionRate"), SuppressUnmanagedCodeSecurity]
  1298. internal static extern dReal JointGetPRPositionRate(IntPtr j);
  1299. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderAxis"), SuppressUnmanagedCodeSecurity]
  1300. internal static extern void JointGetSliderAxis(IntPtr j, out Vector3 result);
  1301. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderParam"), SuppressUnmanagedCodeSecurity]
  1302. internal static extern dReal JointGetSliderParam(IntPtr j, int parameter);
  1303. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPosition"), SuppressUnmanagedCodeSecurity]
  1304. internal static extern dReal JointGetSliderPosition(IntPtr j);
  1305. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetSliderPositionRate"), SuppressUnmanagedCodeSecurity]
  1306. internal static extern dReal JointGetSliderPositionRate(IntPtr j);
  1307. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetType"), SuppressUnmanagedCodeSecurity]
  1308. internal static extern JointType JointGetType(IntPtr j);
  1309. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor"), SuppressUnmanagedCodeSecurity]
  1310. internal static extern void JointGetUniversalAnchor(IntPtr j, out Vector3 result);
  1311. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAnchor2"), SuppressUnmanagedCodeSecurity]
  1312. internal static extern void JointGetUniversalAnchor2(IntPtr j, out Vector3 result);
  1313. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1"), SuppressUnmanagedCodeSecurity]
  1314. internal static extern dReal JointGetUniversalAngle1(IntPtr j);
  1315. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle1Rate"), SuppressUnmanagedCodeSecurity]
  1316. internal static extern dReal JointGetUniversalAngle1Rate(IntPtr j);
  1317. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2"), SuppressUnmanagedCodeSecurity]
  1318. internal static extern dReal JointGetUniversalAngle2(IntPtr j);
  1319. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngle2Rate"), SuppressUnmanagedCodeSecurity]
  1320. internal static extern dReal JointGetUniversalAngle2Rate(IntPtr j);
  1321. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAngles"), SuppressUnmanagedCodeSecurity]
  1322. internal static extern void JointGetUniversalAngles(IntPtr j, out dReal angle1, out dReal angle2);
  1323. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis1"), SuppressUnmanagedCodeSecurity]
  1324. internal static extern void JointGetUniversalAxis1(IntPtr j, out Vector3 result);
  1325. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalAxis2"), SuppressUnmanagedCodeSecurity]
  1326. internal static extern void JointGetUniversalAxis2(IntPtr j, out Vector3 result);
  1327. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGetUniversalParam"), SuppressUnmanagedCodeSecurity]
  1328. internal static extern dReal JointGetUniversalParam(IntPtr j, int parameter);
  1329. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupCreate"), SuppressUnmanagedCodeSecurity]
  1330. internal static extern IntPtr JointGroupCreate(int max_size);
  1331. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupDestroy"), SuppressUnmanagedCodeSecurity]
  1332. internal static extern void JointGroupDestroy(IntPtr group);
  1333. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointGroupEmpty"), SuppressUnmanagedCodeSecurity]
  1334. internal static extern void JointGroupEmpty(IntPtr group);
  1335. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAngle"), SuppressUnmanagedCodeSecurity]
  1336. internal static extern void JointSetAMotorAngle(IntPtr j, int anum, dReal angle);
  1337. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorAxis"), SuppressUnmanagedCodeSecurity]
  1338. internal static extern void JointSetAMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z);
  1339. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorMode"), SuppressUnmanagedCodeSecurity]
  1340. internal static extern void JointSetAMotorMode(IntPtr j, int mode);
  1341. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorNumAxes"), SuppressUnmanagedCodeSecurity]
  1342. internal static extern void JointSetAMotorNumAxes(IntPtr group, int num);
  1343. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetAMotorParam"), SuppressUnmanagedCodeSecurity]
  1344. internal static extern void JointSetAMotorParam(IntPtr group, int parameter, dReal value);
  1345. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor"), SuppressUnmanagedCodeSecurity]
  1346. internal static extern void JointSetBallAnchor(IntPtr j, dReal x, dReal y, dReal z);
  1347. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetBallAnchor2"), SuppressUnmanagedCodeSecurity]
  1348. internal static extern void JointSetBallAnchor2(IntPtr j, dReal x, dReal y, dReal z);
  1349. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetData"), SuppressUnmanagedCodeSecurity]
  1350. internal static extern void JointSetData(IntPtr j, IntPtr data);
  1351. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFeedback"), SuppressUnmanagedCodeSecurity]
  1352. internal static extern void JointSetFeedback(IntPtr j, out JointFeedback feedback);
  1353. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetFixed"), SuppressUnmanagedCodeSecurity]
  1354. internal static extern void JointSetFixed(IntPtr j);
  1355. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchor"), SuppressUnmanagedCodeSecurity]
  1356. internal static extern void JointSetHingeAnchor(IntPtr j, dReal x, dReal y, dReal z);
  1357. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAnchorDelta"), SuppressUnmanagedCodeSecurity]
  1358. internal static extern void JointSetHingeAnchorDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az);
  1359. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeAxis"), SuppressUnmanagedCodeSecurity]
  1360. internal static extern void JointSetHingeAxis(IntPtr j, dReal x, dReal y, dReal z);
  1361. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHingeParam"), SuppressUnmanagedCodeSecurity]
  1362. internal static extern void JointSetHingeParam(IntPtr j, int parameter, dReal value);
  1363. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Anchor"), SuppressUnmanagedCodeSecurity]
  1364. internal static extern void JointSetHinge2Anchor(IntPtr j, dReal x, dReal y, dReal z);
  1365. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis1"), SuppressUnmanagedCodeSecurity]
  1366. internal static extern void JointSetHinge2Axis1(IntPtr j, dReal x, dReal y, dReal z);
  1367. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Axis2"), SuppressUnmanagedCodeSecurity]
  1368. internal static extern void JointSetHinge2Axis2(IntPtr j, dReal x, dReal y, dReal z);
  1369. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetHinge2Param"), SuppressUnmanagedCodeSecurity]
  1370. internal static extern void JointSetHinge2Param(IntPtr j, int parameter, dReal value);
  1371. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorAxis"), SuppressUnmanagedCodeSecurity]
  1372. internal static extern void JointSetLMotorAxis(IntPtr j, int anum, int rel, dReal x, dReal y, dReal z);
  1373. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorNumAxes"), SuppressUnmanagedCodeSecurity]
  1374. internal static extern void JointSetLMotorNumAxes(IntPtr j, int num);
  1375. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetLMotorParam"), SuppressUnmanagedCodeSecurity]
  1376. internal static extern void JointSetLMotorParam(IntPtr j, int parameter, dReal value);
  1377. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DAngleParam"), SuppressUnmanagedCodeSecurity]
  1378. internal static extern void JointSetPlane2DAngleParam(IntPtr j, int parameter, dReal value);
  1379. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DXParam"), SuppressUnmanagedCodeSecurity]
  1380. internal static extern void JointSetPlane2DXParam(IntPtr j, int parameter, dReal value);
  1381. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPlane2DYParam"), SuppressUnmanagedCodeSecurity]
  1382. internal static extern void JointSetPlane2DYParam(IntPtr j, int parameter, dReal value);
  1383. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAnchor"), SuppressUnmanagedCodeSecurity]
  1384. internal static extern void JointSetPRAnchor(IntPtr j, dReal x, dReal y, dReal z);
  1385. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis1"), SuppressUnmanagedCodeSecurity]
  1386. internal static extern void JointSetPRAxis1(IntPtr j, dReal x, dReal y, dReal z);
  1387. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRAxis2"), SuppressUnmanagedCodeSecurity]
  1388. internal static extern void JointSetPRAxis2(IntPtr j, dReal x, dReal y, dReal z);
  1389. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetPRParam"), SuppressUnmanagedCodeSecurity]
  1390. internal static extern void JointSetPRParam(IntPtr j, int parameter, dReal value);
  1391. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxis"), SuppressUnmanagedCodeSecurity]
  1392. internal static extern void JointSetSliderAxis(IntPtr j, dReal x, dReal y, dReal z);
  1393. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderAxisDelta"), SuppressUnmanagedCodeSecurity]
  1394. internal static extern void JointSetSliderAxisDelta(IntPtr j, dReal x, dReal y, dReal z, dReal ax, dReal ay, dReal az);
  1395. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetSliderParam"), SuppressUnmanagedCodeSecurity]
  1396. internal static extern void JointSetSliderParam(IntPtr j, int parameter, dReal value);
  1397. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAnchor"), SuppressUnmanagedCodeSecurity]
  1398. internal static extern void JointSetUniversalAnchor(IntPtr j, dReal x, dReal y, dReal z);
  1399. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis1"), SuppressUnmanagedCodeSecurity]
  1400. internal static extern void JointSetUniversalAxis1(IntPtr j, dReal x, dReal y, dReal z);
  1401. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalAxis2"), SuppressUnmanagedCodeSecurity]
  1402. internal static extern void JointSetUniversalAxis2(IntPtr j, dReal x, dReal y, dReal z);
  1403. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dJointSetUniversalParam"), SuppressUnmanagedCodeSecurity]
  1404. internal static extern void JointSetUniversalParam(IntPtr j, int parameter, dReal value);
  1405. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dLDLTAddTL"), SuppressUnmanagedCodeSecurity]
  1406. internal static extern void LDLTAddTL(ref dReal L, ref dReal d, ref dReal a, int n, int nskip);
  1407. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdd"), SuppressUnmanagedCodeSecurity]
  1408. internal static extern void MassAdd(ref Mass a, ref Mass b);
  1409. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassAdjust"), SuppressUnmanagedCodeSecurity]
  1410. internal static extern void MassAdjust(ref Mass m, dReal newmass);
  1411. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassCheck"), SuppressUnmanagedCodeSecurity]
  1412. internal static extern bool MassCheck(ref Mass m);
  1413. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity]
  1414. internal static extern void MassRotate(ref Mass mass, ref Matrix3 R);
  1415. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassRotate"), SuppressUnmanagedCodeSecurity]
  1416. internal static extern void MassRotate(ref Mass mass, ref dReal M00);
  1417. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBox"), SuppressUnmanagedCodeSecurity]
  1418. internal static extern void MassSetBox(out Mass mass, dReal density, dReal lx, dReal ly, dReal lz);
  1419. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetBoxTotal"), SuppressUnmanagedCodeSecurity]
  1420. internal static extern void MassSetBoxTotal(out Mass mass, dReal total_mass, dReal lx, dReal ly, dReal lz);
  1421. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsule"), SuppressUnmanagedCodeSecurity]
  1422. internal static extern void MassSetCapsule(out Mass mass, dReal density, int direction, dReal radius, dReal length);
  1423. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCapsuleTotal"), SuppressUnmanagedCodeSecurity]
  1424. internal static extern void MassSetCapsuleTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length);
  1425. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinder"), SuppressUnmanagedCodeSecurity]
  1426. internal static extern void MassSetCylinder(out Mass mass, dReal density, int direction, dReal radius, dReal length);
  1427. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetCylinderTotal"), SuppressUnmanagedCodeSecurity]
  1428. internal static extern void MassSetCylinderTotal(out Mass mass, dReal total_mass, int direction, dReal radius, dReal length);
  1429. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetParameters"), SuppressUnmanagedCodeSecurity]
  1430. internal static extern void MassSetParameters(out Mass mass, dReal themass,
  1431. dReal cgx, dReal cgy, dReal cgz,
  1432. dReal i11, dReal i22, dReal i33,
  1433. dReal i12, dReal i13, dReal i23);
  1434. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphere"), SuppressUnmanagedCodeSecurity]
  1435. internal static extern void MassSetSphere(out Mass mass, dReal density, dReal radius);
  1436. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetSphereTotal"), SuppressUnmanagedCodeSecurity]
  1437. internal static extern void dMassSetSphereTotal(out Mass mass, dReal total_mass, dReal radius);
  1438. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetTrimesh"), SuppressUnmanagedCodeSecurity]
  1439. internal static extern void MassSetTrimesh(out Mass mass, dReal density, IntPtr g);
  1440. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassSetZero"), SuppressUnmanagedCodeSecurity]
  1441. internal static extern void MassSetZero(out Mass mass);
  1442. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMassTranslate"), SuppressUnmanagedCodeSecurity]
  1443. internal static extern void MassTranslate(ref Mass mass, dReal x, dReal y, dReal z);
  1444. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity]
  1445. internal static extern void Multiply0(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r);
  1446. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply0"), SuppressUnmanagedCodeSecurity]
  1447. private static extern void MultiplyiM3V3(out Vector3 vout, ref Matrix3 matrix, ref Vector3 vect,int p, int q, int r);
  1448. internal static void MultiplyM3V3(out Vector3 outvector, ref Matrix3 matrix, ref Vector3 invector)
  1449. {
  1450. MultiplyiM3V3(out outvector, ref matrix, ref invector, 3, 3, 1);
  1451. }
  1452. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply1"), SuppressUnmanagedCodeSecurity]
  1453. internal static extern void Multiply1(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r);
  1454. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dMultiply2"), SuppressUnmanagedCodeSecurity]
  1455. internal static extern void Multiply2(out dReal A00, ref dReal B00, ref dReal C00, int p, int q, int r);
  1456. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQFromAxisAndAngle"), SuppressUnmanagedCodeSecurity]
  1457. internal static extern void QFromAxisAndAngle(out Quaternion q, dReal ax, dReal ay, dReal az, dReal angle);
  1458. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQfromR"), SuppressUnmanagedCodeSecurity]
  1459. internal static extern void QfromR(out Quaternion q, ref Matrix3 R);
  1460. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply0"), SuppressUnmanagedCodeSecurity]
  1461. internal static extern void QMultiply0(out Quaternion qa, ref Quaternion qb, ref Quaternion qc);
  1462. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply1"), SuppressUnmanagedCodeSecurity]
  1463. internal static extern void QMultiply1(out Quaternion qa, ref Quaternion qb, ref Quaternion qc);
  1464. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply2"), SuppressUnmanagedCodeSecurity]
  1465. internal static extern void QMultiply2(out Quaternion qa, ref Quaternion qb, ref Quaternion qc);
  1466. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQMultiply3"), SuppressUnmanagedCodeSecurity]
  1467. internal static extern void QMultiply3(out Quaternion qa, ref Quaternion qb, ref Quaternion qc);
  1468. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQSetIdentity"), SuppressUnmanagedCodeSecurity]
  1469. internal static extern void QSetIdentity(out Quaternion q);
  1470. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity]
  1471. internal static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref Vector3 center, ref Vector3 extents, int depth);
  1472. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dQuadTreeSpaceCreate"), SuppressUnmanagedCodeSecurity]
  1473. internal static extern IntPtr QuadTreeSpaceCreate(IntPtr space, ref dReal centerX, ref dReal extentsX, int depth);
  1474. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRandReal"), SuppressUnmanagedCodeSecurity]
  1475. internal static extern dReal RandReal();
  1476. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFrom2Axes"), SuppressUnmanagedCodeSecurity]
  1477. internal static extern void RFrom2Axes(out Matrix3 R, dReal ax, dReal ay, dReal az, dReal bx, dReal by, dReal bz);
  1478. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromAxisAndAngle"), SuppressUnmanagedCodeSecurity]
  1479. internal static extern void RFromAxisAndAngle(out Matrix3 R, dReal x, dReal y, dReal z, dReal angle);
  1480. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromEulerAngles"), SuppressUnmanagedCodeSecurity]
  1481. internal static extern void RFromEulerAngles(out Matrix3 R, dReal phi, dReal theta, dReal psi);
  1482. //[DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRfromQ"), SuppressUnmanagedCodeSecurity]
  1483. //internal static extern void RfromQ(out Matrix3 R, ref Quaternion q);
  1484. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRFromZAxis"), SuppressUnmanagedCodeSecurity]
  1485. internal static extern void RFromZAxis(out Matrix3 R, dReal ax, dReal ay, dReal az);
  1486. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dRSetIdentity"), SuppressUnmanagedCodeSecurity]
  1487. internal static extern void RSetIdentity(out Matrix3 R);
  1488. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetValue"), SuppressUnmanagedCodeSecurity]
  1489. internal static extern void SetValue(out dReal a, int n);
  1490. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSetZero"), SuppressUnmanagedCodeSecurity]
  1491. internal static extern void SetZero(out dReal a, int n);
  1492. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSimpleSpaceCreate"), SuppressUnmanagedCodeSecurity]
  1493. internal static extern IntPtr SimpleSpaceCreate(IntPtr space);
  1494. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveCholesky"), SuppressUnmanagedCodeSecurity]
  1495. internal static extern void SolveCholesky(ref dReal L, out dReal b, int n);
  1496. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1"), SuppressUnmanagedCodeSecurity]
  1497. internal static extern void SolveL1(ref dReal L, out dReal b, int n, int nskip);
  1498. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveL1T"), SuppressUnmanagedCodeSecurity]
  1499. internal static extern void SolveL1T(ref dReal L, out dReal b, int n, int nskip);
  1500. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSolveLDLT"), SuppressUnmanagedCodeSecurity]
  1501. internal static extern void SolveLDLT(ref dReal L, ref dReal d, out dReal b, int n, int nskip);
  1502. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceAdd"), SuppressUnmanagedCodeSecurity]
  1503. internal static extern void SpaceAdd(IntPtr space, IntPtr geom);
  1504. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceLockQuery"), SuppressUnmanagedCodeSecurity]
  1505. internal static extern bool SpaceLockQuery(IntPtr space);
  1506. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceClean"), SuppressUnmanagedCodeSecurity]
  1507. internal static extern void SpaceClean(IntPtr space);
  1508. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide"), SuppressUnmanagedCodeSecurity]
  1509. internal static extern void SpaceCollide(IntPtr space, IntPtr data, NearCallback callback);
  1510. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceCollide2"), SuppressUnmanagedCodeSecurity]
  1511. internal static extern void SpaceCollide2(IntPtr space1, IntPtr space2, IntPtr data, NearCallback callback);
  1512. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceDestroy"), SuppressUnmanagedCodeSecurity]
  1513. internal static extern void SpaceDestroy(IntPtr space);
  1514. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetCleanup"), SuppressUnmanagedCodeSecurity]
  1515. internal static extern bool SpaceGetCleanup(IntPtr space);
  1516. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetNumGeoms"), SuppressUnmanagedCodeSecurity]
  1517. internal static extern int SpaceGetNumGeoms(IntPtr space);
  1518. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetGeom"), SuppressUnmanagedCodeSecurity]
  1519. internal static extern IntPtr SpaceGetGeom(IntPtr space, int i);
  1520. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceGetSublevel"), SuppressUnmanagedCodeSecurity]
  1521. internal static extern int SpaceGetSublevel(IntPtr space);
  1522. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceQuery"), SuppressUnmanagedCodeSecurity]
  1523. internal static extern bool SpaceQuery(IntPtr space, IntPtr geom);
  1524. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceRemove"), SuppressUnmanagedCodeSecurity]
  1525. internal static extern void SpaceRemove(IntPtr space, IntPtr geom);
  1526. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetCleanup"), SuppressUnmanagedCodeSecurity]
  1527. internal static extern void SpaceSetCleanup(IntPtr space, bool mode);
  1528. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSpaceSetSublevel"), SuppressUnmanagedCodeSecurity]
  1529. internal static extern void SpaceSetSublevel(IntPtr space, int sublevel);
  1530. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dSweepAndPruneSpaceCreate"), SuppressUnmanagedCodeSecurity]
  1531. internal static extern IntPtr SweepAndPruneSpaceCreate(IntPtr space, int AxisOrder);
  1532. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dVectorScale"), SuppressUnmanagedCodeSecurity]
  1533. internal static extern void VectorScale(out dReal a, ref dReal d, int n);
  1534. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldCreate"), SuppressUnmanagedCodeSecurity]
  1535. internal static extern IntPtr WorldCreate();
  1536. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldDestroy"), SuppressUnmanagedCodeSecurity]
  1537. internal static extern void WorldDestroy(IntPtr world);
  1538. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity]
  1539. internal static extern int WorldGetAutoDisableAverageSamplesCount(IntPtr world);
  1540. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity]
  1541. internal static extern dReal WorldGetAutoDisableAngularThreshold(IntPtr world);
  1542. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableFlag"), SuppressUnmanagedCodeSecurity]
  1543. internal static extern bool WorldGetAutoDisableFlag(IntPtr world);
  1544. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity]
  1545. internal static extern dReal WorldGetAutoDisableLinearThreshold(IntPtr world);
  1546. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableSteps"), SuppressUnmanagedCodeSecurity]
  1547. internal static extern int WorldGetAutoDisableSteps(IntPtr world);
  1548. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoDisableTime"), SuppressUnmanagedCodeSecurity]
  1549. internal static extern dReal WorldGetAutoDisableTime(IntPtr world);
  1550. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity]
  1551. internal static extern int WorldGetAutoEnableDepthSF1(IntPtr world);
  1552. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetCFM"), SuppressUnmanagedCodeSecurity]
  1553. internal static extern dReal WorldGetCFM(IntPtr world);
  1554. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetERP"), SuppressUnmanagedCodeSecurity]
  1555. internal static extern dReal WorldGetERP(IntPtr world);
  1556. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity]
  1557. internal static extern void WorldGetGravity(IntPtr world, out Vector3 gravity);
  1558. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetGravity"), SuppressUnmanagedCodeSecurity]
  1559. internal static extern void WorldGetGravity(IntPtr world, out dReal X);
  1560. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity]
  1561. internal static extern dReal WorldGetContactMaxCorrectingVel(IntPtr world);
  1562. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity]
  1563. internal static extern dReal WorldGetContactSurfaceLayer(IntPtr world);
  1564. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDamping"), SuppressUnmanagedCodeSecurity]
  1565. internal static extern dReal WorldGetAngularDamping(IntPtr world);
  1566. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity]
  1567. internal static extern dReal WorldGetAngularDampingThreshold(IntPtr world);
  1568. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDamping"), SuppressUnmanagedCodeSecurity]
  1569. internal static extern dReal WorldGetLinearDamping(IntPtr world);
  1570. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity]
  1571. internal static extern dReal WorldGetLinearDampingThreshold(IntPtr world);
  1572. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity]
  1573. internal static extern int WorldGetQuickStepNumIterations(IntPtr world);
  1574. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetQuickStepW"), SuppressUnmanagedCodeSecurity]
  1575. internal static extern dReal WorldGetQuickStepW(IntPtr world);
  1576. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldGetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity]
  1577. internal static extern dReal WorldGetMaxAngularSpeed(IntPtr world);
  1578. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity]
  1579. internal static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out Vector3 force);
  1580. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldImpulseToForce"), SuppressUnmanagedCodeSecurity]
  1581. internal static extern void WorldImpulseToForce(IntPtr world, dReal stepsize, dReal ix, dReal iy, dReal iz, out dReal forceX);
  1582. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldQuickStep"), SuppressUnmanagedCodeSecurity]
  1583. internal static extern void WorldQuickStep(IntPtr world, dReal stepsize);
  1584. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDamping"), SuppressUnmanagedCodeSecurity]
  1585. internal static extern void WorldSetAngularDamping(IntPtr world, dReal scale);
  1586. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAngularDampingThreshold"), SuppressUnmanagedCodeSecurity]
  1587. internal static extern void WorldSetAngularDampingThreshold(IntPtr world, dReal threshold);
  1588. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAngularThreshold"), SuppressUnmanagedCodeSecurity]
  1589. internal static extern void WorldSetAutoDisableAngularThreshold(IntPtr world, dReal angular_threshold);
  1590. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableAverageSamplesCount"), SuppressUnmanagedCodeSecurity]
  1591. internal static extern void WorldSetAutoDisableAverageSamplesCount(IntPtr world, int average_samples_count);
  1592. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableFlag"), SuppressUnmanagedCodeSecurity]
  1593. internal static extern void WorldSetAutoDisableFlag(IntPtr world, bool do_auto_disable);
  1594. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableLinearThreshold"), SuppressUnmanagedCodeSecurity]
  1595. internal static extern void WorldSetAutoDisableLinearThreshold(IntPtr world, dReal linear_threshold);
  1596. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableSteps"), SuppressUnmanagedCodeSecurity]
  1597. internal static extern void WorldSetAutoDisableSteps(IntPtr world, int steps);
  1598. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoDisableTime"), SuppressUnmanagedCodeSecurity]
  1599. internal static extern void WorldSetAutoDisableTime(IntPtr world, dReal time);
  1600. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetAutoEnableDepthSF1"), SuppressUnmanagedCodeSecurity]
  1601. internal static extern void WorldSetAutoEnableDepthSF1(IntPtr world, int autoEnableDepth);
  1602. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetCFM"), SuppressUnmanagedCodeSecurity]
  1603. internal static extern void WorldSetCFM(IntPtr world, dReal cfm);
  1604. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactMaxCorrectingVel"), SuppressUnmanagedCodeSecurity]
  1605. internal static extern void WorldSetContactMaxCorrectingVel(IntPtr world, dReal vel);
  1606. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetContactSurfaceLayer"), SuppressUnmanagedCodeSecurity]
  1607. internal static extern void WorldSetContactSurfaceLayer(IntPtr world, dReal depth);
  1608. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetDamping"), SuppressUnmanagedCodeSecurity]
  1609. internal static extern void WorldSetDamping(IntPtr world, dReal linear_scale, dReal angular_scale);
  1610. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetERP"), SuppressUnmanagedCodeSecurity]
  1611. internal static extern void WorldSetERP(IntPtr world, dReal erp);
  1612. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetGravity"), SuppressUnmanagedCodeSecurity]
  1613. internal static extern void WorldSetGravity(IntPtr world, dReal x, dReal y, dReal z);
  1614. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDamping"), SuppressUnmanagedCodeSecurity]
  1615. internal static extern void WorldSetLinearDamping(IntPtr world, dReal scale);
  1616. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetLinearDampingThreshold"), SuppressUnmanagedCodeSecurity]
  1617. internal static extern void WorldSetLinearDampingThreshold(IntPtr world, dReal threshold);
  1618. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepNumIterations"), SuppressUnmanagedCodeSecurity]
  1619. internal static extern void WorldSetQuickStepNumIterations(IntPtr world, int num);
  1620. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetQuickStepW"), SuppressUnmanagedCodeSecurity]
  1621. internal static extern void WorldSetQuickStepW(IntPtr world, dReal over_relaxation);
  1622. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldSetMaxAngularSpeed"), SuppressUnmanagedCodeSecurity]
  1623. internal static extern void WorldSetMaxAngularSpeed(IntPtr world, dReal max_speed);
  1624. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStep"), SuppressUnmanagedCodeSecurity]
  1625. internal static extern void WorldStep(IntPtr world, dReal stepsize);
  1626. [DllImport("ubode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dWorldStepFast1"), SuppressUnmanagedCodeSecurity]
  1627. internal static extern void WorldStepFast1(IntPtr world, dReal stepsize, int maxiterations);
  1628. }
  1629. }