CollisionShape.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // CollisionShape.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho.Physics
  18. {
  19. /// <summary>
  20. /// Physics collision shape component.
  21. /// </summary>
  22. public unsafe partial class CollisionShape : Component
  23. {
  24. unsafe partial void OnCollisionShapeCreated ();
  25. [Preserve]
  26. public CollisionShape (IntPtr handle) : base (handle)
  27. {
  28. OnCollisionShapeCreated ();
  29. }
  30. [Preserve]
  31. protected CollisionShape (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnCollisionShapeCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int CollisionShape_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (CollisionShape_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr CollisionShape_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (CollisionShape_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int CollisionShape_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(CollisionShape));
  54. return new StringHash (CollisionShape_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr CollisionShape_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(CollisionShape));
  61. return Marshal.PtrToStringAnsi (CollisionShape_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public CollisionShape () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr CollisionShape_CollisionShape (IntPtr context);
  69. [Preserve]
  70. public CollisionShape (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(CollisionShape));
  73. handle = CollisionShape_CollisionShape ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnCollisionShapeCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void CollisionShape_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(CollisionShape));
  85. CollisionShape_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void CollisionShape_ApplyAttributes (IntPtr handle);
  89. /// <summary>
  90. /// Apply attribute changes that can not be applied immediately. Called after scene load or a network update.
  91. /// </summary>
  92. public override void ApplyAttributes ()
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. CollisionShape_ApplyAttributes (handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void CollisionShape_OnSetEnabled (IntPtr handle);
  99. /// <summary>
  100. /// Handle enabled/disabled state change.
  101. /// </summary>
  102. public override void OnSetEnabled ()
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. CollisionShape_OnSetEnabled (handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void CollisionShape_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  109. /// <summary>
  110. /// Visualize the component as debug geometry.
  111. /// </summary>
  112. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. CollisionShape_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void CollisionShape_SetBox (IntPtr handle, ref Urho.Vector3 size, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  119. /// <summary>
  120. /// Set as a box.
  121. /// </summary>
  122. public void SetBox (Urho.Vector3 size, Urho.Vector3 position, Urho.Quaternion rotation)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. CollisionShape_SetBox (handle, ref size, ref position, ref rotation);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern void CollisionShape_SetSphere (IntPtr handle, float diameter, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  129. /// <summary>
  130. /// Set as a sphere.
  131. /// </summary>
  132. public void SetSphere (float diameter, Urho.Vector3 position, Urho.Quaternion rotation)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. CollisionShape_SetSphere (handle, diameter, ref position, ref rotation);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void CollisionShape_SetStaticPlane (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  139. /// <summary>
  140. /// Set as a static plane.
  141. /// </summary>
  142. public void SetStaticPlane (Urho.Vector3 position, Urho.Quaternion rotation)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. CollisionShape_SetStaticPlane (handle, ref position, ref rotation);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void CollisionShape_SetCylinder (IntPtr handle, float diameter, float height, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  149. /// <summary>
  150. /// Set as a cylinder.
  151. /// </summary>
  152. public void SetCylinder (float diameter, float height, Urho.Vector3 position, Urho.Quaternion rotation)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. CollisionShape_SetCylinder (handle, diameter, height, ref position, ref rotation);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void CollisionShape_SetCapsule (IntPtr handle, float diameter, float height, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  159. /// <summary>
  160. /// Set as a capsule.
  161. /// </summary>
  162. public void SetCapsule (float diameter, float height, Urho.Vector3 position, Urho.Quaternion rotation)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. CollisionShape_SetCapsule (handle, diameter, height, ref position, ref rotation);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void CollisionShape_SetCone (IntPtr handle, float diameter, float height, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  169. /// <summary>
  170. /// Set as a cone.
  171. /// </summary>
  172. public void SetCone (float diameter, float height, Urho.Vector3 position, Urho.Quaternion rotation)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. CollisionShape_SetCone (handle, diameter, height, ref position, ref rotation);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void CollisionShape_SetTriangleMesh (IntPtr handle, IntPtr model, uint lodLevel, ref Urho.Vector3 scale, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  179. /// <summary>
  180. /// Set as a triangle mesh from Model. If you update a model's geometry and want to reapply the shape, call physicsWorld->RemoveCachedGeometry(model) first.
  181. /// </summary>
  182. public void SetTriangleMesh (Model model, uint lodLevel, Urho.Vector3 scale, Urho.Vector3 position, Urho.Quaternion rotation)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. CollisionShape_SetTriangleMesh (handle, (object)model == null ? IntPtr.Zero : model.Handle, lodLevel, ref scale, ref position, ref rotation);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern void CollisionShape_SetCustomTriangleMesh (IntPtr handle, IntPtr custom, ref Urho.Vector3 scale, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  189. /// <summary>
  190. /// Set as a triangle mesh from CustomGeometry.
  191. /// </summary>
  192. public void SetCustomTriangleMesh (CustomGeometry custom, Urho.Vector3 scale, Urho.Vector3 position, Urho.Quaternion rotation)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. CollisionShape_SetCustomTriangleMesh (handle, (object)custom == null ? IntPtr.Zero : custom.Handle, ref scale, ref position, ref rotation);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern void CollisionShape_SetConvexHull (IntPtr handle, IntPtr model, uint lodLevel, ref Urho.Vector3 scale, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  199. /// <summary>
  200. /// Set as a convex hull from Model.
  201. /// </summary>
  202. public void SetConvexHull (Model model, uint lodLevel, Urho.Vector3 scale, Urho.Vector3 position, Urho.Quaternion rotation)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. CollisionShape_SetConvexHull (handle, (object)model == null ? IntPtr.Zero : model.Handle, lodLevel, ref scale, ref position, ref rotation);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern void CollisionShape_SetCustomConvexHull (IntPtr handle, IntPtr custom, ref Urho.Vector3 scale, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  209. /// <summary>
  210. /// Set as a convex hull from CustomGeometry.
  211. /// </summary>
  212. public void SetCustomConvexHull (CustomGeometry custom, Urho.Vector3 scale, Urho.Vector3 position, Urho.Quaternion rotation)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. CollisionShape_SetCustomConvexHull (handle, (object)custom == null ? IntPtr.Zero : custom.Handle, ref scale, ref position, ref rotation);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern void CollisionShape_SetGImpactMesh (IntPtr handle, IntPtr model, uint lodLevel, ref Urho.Vector3 scale, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  219. /// <summary>
  220. /// Set as a triangle mesh from Model. If you update a model's geometry and want to reapply the shape, call physicsWorld->RemoveCachedGeometry(model) first.
  221. /// </summary>
  222. public void SetGImpactMesh (Model model, uint lodLevel, Urho.Vector3 scale, Urho.Vector3 position, Urho.Quaternion rotation)
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. CollisionShape_SetGImpactMesh (handle, (object)model == null ? IntPtr.Zero : model.Handle, lodLevel, ref scale, ref position, ref rotation);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern void CollisionShape_SetCustomGImpactMesh (IntPtr handle, IntPtr custom, ref Urho.Vector3 scale, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  229. /// <summary>
  230. /// Set as a triangle mesh from CustomGeometry.
  231. /// </summary>
  232. public void SetCustomGImpactMesh (CustomGeometry custom, Urho.Vector3 scale, Urho.Vector3 position, Urho.Quaternion rotation)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. CollisionShape_SetCustomGImpactMesh (handle, (object)custom == null ? IntPtr.Zero : custom.Handle, ref scale, ref position, ref rotation);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void CollisionShape_SetTerrain (IntPtr handle, uint lodLevel);
  239. /// <summary>
  240. /// Set as a terrain. Only works if the same scene node contains a Terrain component.
  241. /// </summary>
  242. public void SetTerrain (uint lodLevel = 0)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. CollisionShape_SetTerrain (handle, lodLevel);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern void CollisionShape_SetShapeType (IntPtr handle, ShapeType type);
  249. /// <summary>
  250. /// Set shape type.
  251. /// </summary>
  252. private void SetShapeType (ShapeType type)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. CollisionShape_SetShapeType (handle, type);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern void CollisionShape_SetSize (IntPtr handle, ref Urho.Vector3 size);
  259. /// <summary>
  260. /// Set shape size.
  261. /// </summary>
  262. private void SetSize (Urho.Vector3 size)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. CollisionShape_SetSize (handle, ref size);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern void CollisionShape_SetPosition (IntPtr handle, ref Urho.Vector3 position);
  269. /// <summary>
  270. /// Set offset position.
  271. /// </summary>
  272. private void SetPosition (Urho.Vector3 position)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. CollisionShape_SetPosition (handle, ref position);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern void CollisionShape_SetRotation (IntPtr handle, ref Urho.Quaternion rotation);
  279. /// <summary>
  280. /// Set offset rotation.
  281. /// </summary>
  282. private void SetRotation (Urho.Quaternion rotation)
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. CollisionShape_SetRotation (handle, ref rotation);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern void CollisionShape_SetTransform (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  289. /// <summary>
  290. /// Set offset transform.
  291. /// </summary>
  292. public void SetTransform (Urho.Vector3 position, Urho.Quaternion rotation)
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. CollisionShape_SetTransform (handle, ref position, ref rotation);
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern void CollisionShape_SetMargin (IntPtr handle, float margin);
  299. /// <summary>
  300. /// Set collision margin.
  301. /// </summary>
  302. private void SetMargin (float margin)
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. CollisionShape_SetMargin (handle, margin);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern void CollisionShape_SetModel (IntPtr handle, IntPtr model);
  309. /// <summary>
  310. /// Set triangle mesh / convex hull model.
  311. /// </summary>
  312. private void SetModel (Model model)
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. CollisionShape_SetModel (handle, (object)model == null ? IntPtr.Zero : model.Handle);
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern void CollisionShape_SetLodLevel (IntPtr handle, uint lodLevel);
  319. /// <summary>
  320. /// Set model LOD level.
  321. /// </summary>
  322. private void SetLodLevel (uint lodLevel)
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. CollisionShape_SetLodLevel (handle, lodLevel);
  326. }
  327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  328. internal static extern IntPtr CollisionShape_GetPhysicsWorld (IntPtr handle);
  329. /// <summary>
  330. /// Return physics world.
  331. /// </summary>
  332. private PhysicsWorld GetPhysicsWorld ()
  333. {
  334. Runtime.ValidateRefCounted (this);
  335. return Runtime.LookupObject<PhysicsWorld> (CollisionShape_GetPhysicsWorld (handle));
  336. }
  337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  338. internal static extern ShapeType CollisionShape_GetShapeType (IntPtr handle);
  339. /// <summary>
  340. /// Return shape type.
  341. /// </summary>
  342. private ShapeType GetShapeType ()
  343. {
  344. Runtime.ValidateRefCounted (this);
  345. return CollisionShape_GetShapeType (handle);
  346. }
  347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  348. internal static extern Urho.Vector3 CollisionShape_GetSize (IntPtr handle);
  349. /// <summary>
  350. /// Return shape size.
  351. /// </summary>
  352. private Urho.Vector3 GetSize ()
  353. {
  354. Runtime.ValidateRefCounted (this);
  355. return CollisionShape_GetSize (handle);
  356. }
  357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  358. internal static extern Urho.Vector3 CollisionShape_GetPosition (IntPtr handle);
  359. /// <summary>
  360. /// Return offset position.
  361. /// </summary>
  362. private Urho.Vector3 GetPosition ()
  363. {
  364. Runtime.ValidateRefCounted (this);
  365. return CollisionShape_GetPosition (handle);
  366. }
  367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  368. internal static extern Urho.Quaternion CollisionShape_GetRotation (IntPtr handle);
  369. /// <summary>
  370. /// Return offset rotation.
  371. /// </summary>
  372. private Urho.Quaternion GetRotation ()
  373. {
  374. Runtime.ValidateRefCounted (this);
  375. return CollisionShape_GetRotation (handle);
  376. }
  377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  378. internal static extern float CollisionShape_GetMargin (IntPtr handle);
  379. /// <summary>
  380. /// Return collision margin.
  381. /// </summary>
  382. private float GetMargin ()
  383. {
  384. Runtime.ValidateRefCounted (this);
  385. return CollisionShape_GetMargin (handle);
  386. }
  387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  388. internal static extern IntPtr CollisionShape_GetModel (IntPtr handle);
  389. /// <summary>
  390. /// Return triangle mesh / convex hull model.
  391. /// </summary>
  392. private Model GetModel ()
  393. {
  394. Runtime.ValidateRefCounted (this);
  395. return Runtime.LookupObject<Model> (CollisionShape_GetModel (handle));
  396. }
  397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  398. internal static extern uint CollisionShape_GetLodLevel (IntPtr handle);
  399. /// <summary>
  400. /// Return model LOD level.
  401. /// </summary>
  402. private uint GetLodLevel ()
  403. {
  404. Runtime.ValidateRefCounted (this);
  405. return CollisionShape_GetLodLevel (handle);
  406. }
  407. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  408. internal static extern BoundingBox CollisionShape_GetWorldBoundingBox (IntPtr handle);
  409. /// <summary>
  410. /// Return world-space bounding box.
  411. /// </summary>
  412. private BoundingBox GetWorldBoundingBox ()
  413. {
  414. Runtime.ValidateRefCounted (this);
  415. return CollisionShape_GetWorldBoundingBox (handle);
  416. }
  417. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  418. internal static extern void CollisionShape_NotifyRigidBody (IntPtr handle, bool updateMass);
  419. /// <summary>
  420. /// Update the new collision shape to the RigidBody.
  421. /// </summary>
  422. public void NotifyRigidBody (bool updateMass = true)
  423. {
  424. Runtime.ValidateRefCounted (this);
  425. CollisionShape_NotifyRigidBody (handle, updateMass);
  426. }
  427. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  428. internal static extern ResourceRef CollisionShape_GetModelAttr (IntPtr handle);
  429. /// <summary>
  430. /// Return model attribute.
  431. /// </summary>
  432. private ResourceRef GetModelAttr ()
  433. {
  434. Runtime.ValidateRefCounted (this);
  435. return CollisionShape_GetModelAttr (handle);
  436. }
  437. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  438. internal static extern void CollisionShape_ReleaseShape (IntPtr handle);
  439. /// <summary>
  440. /// Release the collision shape.
  441. /// </summary>
  442. public void ReleaseShape ()
  443. {
  444. Runtime.ValidateRefCounted (this);
  445. CollisionShape_ReleaseShape (handle);
  446. }
  447. public override StringHash Type {
  448. get {
  449. return UrhoGetType ();
  450. }
  451. }
  452. public override string TypeName {
  453. get {
  454. return GetTypeName ();
  455. }
  456. }
  457. [Preserve]
  458. public new static StringHash TypeStatic {
  459. get {
  460. return GetTypeStatic ();
  461. }
  462. }
  463. public new static string TypeNameStatic {
  464. get {
  465. return GetTypeNameStatic ();
  466. }
  467. }
  468. /// <summary>
  469. /// Return shape type.
  470. /// Or
  471. /// Set shape type.
  472. /// </summary>
  473. public ShapeType ShapeType {
  474. get {
  475. return GetShapeType ();
  476. }
  477. set {
  478. SetShapeType (value);
  479. }
  480. }
  481. /// <summary>
  482. /// Return shape size.
  483. /// Or
  484. /// Set shape size.
  485. /// </summary>
  486. public Urho.Vector3 Size {
  487. get {
  488. return GetSize ();
  489. }
  490. set {
  491. SetSize (value);
  492. }
  493. }
  494. /// <summary>
  495. /// Return offset position.
  496. /// Or
  497. /// Set offset position.
  498. /// </summary>
  499. public Urho.Vector3 Position {
  500. get {
  501. return GetPosition ();
  502. }
  503. set {
  504. SetPosition (value);
  505. }
  506. }
  507. /// <summary>
  508. /// Return offset rotation.
  509. /// Or
  510. /// Set offset rotation.
  511. /// </summary>
  512. public Urho.Quaternion Rotation {
  513. get {
  514. return GetRotation ();
  515. }
  516. set {
  517. SetRotation (value);
  518. }
  519. }
  520. /// <summary>
  521. /// Return collision margin.
  522. /// Or
  523. /// Set collision margin.
  524. /// </summary>
  525. public float Margin {
  526. get {
  527. return GetMargin ();
  528. }
  529. set {
  530. SetMargin (value);
  531. }
  532. }
  533. /// <summary>
  534. /// Return triangle mesh / convex hull model.
  535. /// Or
  536. /// Set triangle mesh / convex hull model.
  537. /// </summary>
  538. public Model Model {
  539. get {
  540. return GetModel ();
  541. }
  542. set {
  543. SetModel (value);
  544. }
  545. }
  546. /// <summary>
  547. /// Return model LOD level.
  548. /// Or
  549. /// Set model LOD level.
  550. /// </summary>
  551. public uint LodLevel {
  552. get {
  553. return GetLodLevel ();
  554. }
  555. set {
  556. SetLodLevel (value);
  557. }
  558. }
  559. /// <summary>
  560. /// Return physics world.
  561. /// </summary>
  562. public PhysicsWorld PhysicsWorld {
  563. get {
  564. return GetPhysicsWorld ();
  565. }
  566. }
  567. /// <summary>
  568. /// Return world-space bounding box.
  569. /// </summary>
  570. public BoundingBox WorldBoundingBox {
  571. get {
  572. return GetWorldBoundingBox ();
  573. }
  574. }
  575. /// <summary>
  576. /// Return model attribute.
  577. /// </summary>
  578. public ResourceRef ModelAttr {
  579. get {
  580. return GetModelAttr ();
  581. }
  582. }
  583. }
  584. }