Drawable.cs 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Drawable.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
  18. {
  19. /// <summary>
  20. /// Base class for visible components.
  21. /// </summary>
  22. public unsafe partial class Drawable : Component
  23. {
  24. unsafe partial void OnDrawableCreated ();
  25. [Preserve]
  26. public Drawable (IntPtr handle) : base (handle)
  27. {
  28. OnDrawableCreated ();
  29. }
  30. [Preserve]
  31. protected Drawable (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnDrawableCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int Drawable_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (Drawable_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr Drawable_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (Drawable_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int Drawable_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(Drawable));
  54. return new StringHash (Drawable_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr Drawable_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(Drawable));
  61. return Marshal.PtrToStringAnsi (Drawable_GetTypeNameStatic ());
  62. }
  63. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  64. internal static extern void Drawable_RegisterObject (IntPtr context);
  65. /// <summary>
  66. /// Register object attributes. Drawable must be registered first.
  67. /// </summary>
  68. public new static void RegisterObject (Context context)
  69. {
  70. Runtime.Validate (typeof(Drawable));
  71. Drawable_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  72. }
  73. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  74. internal static extern void Drawable_OnSetEnabled (IntPtr handle);
  75. /// <summary>
  76. /// Handle enabled/disabled state change.
  77. /// </summary>
  78. public override void OnSetEnabled ()
  79. {
  80. Runtime.ValidateRefCounted (this);
  81. Drawable_OnSetEnabled (handle);
  82. }
  83. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  84. internal static extern UpdateGeometryType Drawable_GetUpdateGeometryType (IntPtr handle);
  85. /// <summary>
  86. /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
  87. /// </summary>
  88. private UpdateGeometryType GetUpdateGeometryType ()
  89. {
  90. Runtime.ValidateRefCounted (this);
  91. return Drawable_GetUpdateGeometryType (handle);
  92. }
  93. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  94. internal static extern IntPtr Drawable_GetLodGeometry (IntPtr handle, uint batchIndex, uint level);
  95. /// <summary>
  96. /// Return the geometry for a specific LOD level.
  97. /// </summary>
  98. public virtual Geometry GetLodGeometry (uint batchIndex, uint level)
  99. {
  100. Runtime.ValidateRefCounted (this);
  101. return Runtime.LookupObject<Geometry> (Drawable_GetLodGeometry (handle, batchIndex, level));
  102. }
  103. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  104. internal static extern uint Drawable_GetNumOccluderTriangles (IntPtr handle);
  105. /// <summary>
  106. /// Return number of occlusion geometry triangles.
  107. /// </summary>
  108. private uint GetNumOccluderTriangles ()
  109. {
  110. Runtime.ValidateRefCounted (this);
  111. return Drawable_GetNumOccluderTriangles (handle);
  112. }
  113. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  114. internal static extern bool Drawable_DrawOcclusion (IntPtr handle, IntPtr buffer);
  115. /// <summary>
  116. /// Draw to occlusion buffer. Return true if did not run out of triangles.
  117. /// </summary>
  118. public virtual bool DrawOcclusion (OcclusionBuffer buffer)
  119. {
  120. Runtime.ValidateRefCounted (this);
  121. return Drawable_DrawOcclusion (handle, (object)buffer == null ? IntPtr.Zero : buffer.Handle);
  122. }
  123. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  124. internal static extern void Drawable_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  125. /// <summary>
  126. /// Visualize the component as debug geometry.
  127. /// </summary>
  128. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  129. {
  130. Runtime.ValidateRefCounted (this);
  131. Drawable_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  132. }
  133. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  134. internal static extern void Drawable_SetDrawDistance (IntPtr handle, float distance);
  135. /// <summary>
  136. /// Set draw distance.
  137. /// </summary>
  138. private void SetDrawDistance (float distance)
  139. {
  140. Runtime.ValidateRefCounted (this);
  141. Drawable_SetDrawDistance (handle, distance);
  142. }
  143. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  144. internal static extern void Drawable_SetShadowDistance (IntPtr handle, float distance);
  145. /// <summary>
  146. /// Set shadow draw distance.
  147. /// </summary>
  148. private void SetShadowDistance (float distance)
  149. {
  150. Runtime.ValidateRefCounted (this);
  151. Drawable_SetShadowDistance (handle, distance);
  152. }
  153. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  154. internal static extern void Drawable_SetLodBias (IntPtr handle, float bias);
  155. /// <summary>
  156. /// Set LOD bias.
  157. /// </summary>
  158. private void SetLodBias (float bias)
  159. {
  160. Runtime.ValidateRefCounted (this);
  161. Drawable_SetLodBias (handle, bias);
  162. }
  163. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  164. internal static extern void Drawable_SetViewMask (IntPtr handle, uint mask);
  165. /// <summary>
  166. /// Set view mask. Is and'ed with camera's view mask to see if the object should be rendered.
  167. /// </summary>
  168. private void SetViewMask (uint mask)
  169. {
  170. Runtime.ValidateRefCounted (this);
  171. Drawable_SetViewMask (handle, mask);
  172. }
  173. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  174. internal static extern void Drawable_SetLightMask (IntPtr handle, uint mask);
  175. /// <summary>
  176. /// Set light mask. Is and'ed with light's and zone's light mask to see if the object should be lit.
  177. /// </summary>
  178. private void SetLightMask (uint mask)
  179. {
  180. Runtime.ValidateRefCounted (this);
  181. Drawable_SetLightMask (handle, mask);
  182. }
  183. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  184. internal static extern void Drawable_SetShadowMask (IntPtr handle, uint mask);
  185. /// <summary>
  186. /// Set shadow mask. Is and'ed with light's light mask and zone's shadow mask to see if the object should be rendered to a shadow map.
  187. /// </summary>
  188. private void SetShadowMask (uint mask)
  189. {
  190. Runtime.ValidateRefCounted (this);
  191. Drawable_SetShadowMask (handle, mask);
  192. }
  193. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  194. internal static extern void Drawable_SetZoneMask (IntPtr handle, uint mask);
  195. /// <summary>
  196. /// Set zone mask. Is and'ed with zone's zone mask to see if the object should belong to the zone.
  197. /// </summary>
  198. private void SetZoneMask (uint mask)
  199. {
  200. Runtime.ValidateRefCounted (this);
  201. Drawable_SetZoneMask (handle, mask);
  202. }
  203. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  204. internal static extern void Drawable_SetMaxLights (IntPtr handle, uint num);
  205. /// <summary>
  206. /// Set maximum number of per-pixel lights. Default 0 is unlimited.
  207. /// </summary>
  208. private void SetMaxLights (uint num)
  209. {
  210. Runtime.ValidateRefCounted (this);
  211. Drawable_SetMaxLights (handle, num);
  212. }
  213. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  214. internal static extern void Drawable_SetCastShadows (IntPtr handle, bool enable);
  215. /// <summary>
  216. /// Set shadowcaster flag.
  217. /// </summary>
  218. private void SetCastShadows (bool enable)
  219. {
  220. Runtime.ValidateRefCounted (this);
  221. Drawable_SetCastShadows (handle, enable);
  222. }
  223. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  224. internal static extern void Drawable_SetOccluder (IntPtr handle, bool enable);
  225. /// <summary>
  226. /// Set occlusion flag.
  227. /// </summary>
  228. private void SetOccluder (bool enable)
  229. {
  230. Runtime.ValidateRefCounted (this);
  231. Drawable_SetOccluder (handle, enable);
  232. }
  233. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  234. internal static extern void Drawable_SetOccludee (IntPtr handle, bool enable);
  235. /// <summary>
  236. /// Set occludee flag.
  237. /// </summary>
  238. private void SetOccludee (bool enable)
  239. {
  240. Runtime.ValidateRefCounted (this);
  241. Drawable_SetOccludee (handle, enable);
  242. }
  243. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  244. internal static extern void Drawable_MarkForUpdate (IntPtr handle);
  245. /// <summary>
  246. /// Mark for update and octree reinsertion. Update is automatically queued when the drawable's scene node moves or changes scale.
  247. /// </summary>
  248. public void MarkForUpdate ()
  249. {
  250. Runtime.ValidateRefCounted (this);
  251. Drawable_MarkForUpdate (handle);
  252. }
  253. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  254. internal static extern Urho.BoundingBox Drawable_GetBoundingBox (IntPtr handle);
  255. /// <summary>
  256. /// Return local space bounding box. May not be applicable or properly updated on all drawables.
  257. /// </summary>
  258. private Urho.BoundingBox GetBoundingBox ()
  259. {
  260. Runtime.ValidateRefCounted (this);
  261. return Drawable_GetBoundingBox (handle);
  262. }
  263. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  264. internal static extern Urho.BoundingBox Drawable_GetWorldBoundingBox (IntPtr handle);
  265. /// <summary>
  266. /// Return world-space bounding box.
  267. /// </summary>
  268. private Urho.BoundingBox GetWorldBoundingBox ()
  269. {
  270. Runtime.ValidateRefCounted (this);
  271. return Drawable_GetWorldBoundingBox (handle);
  272. }
  273. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  274. internal static extern byte Drawable_GetDrawableFlags (IntPtr handle);
  275. /// <summary>
  276. /// Return drawable flags.
  277. /// </summary>
  278. private byte GetDrawableFlags ()
  279. {
  280. Runtime.ValidateRefCounted (this);
  281. return Drawable_GetDrawableFlags (handle);
  282. }
  283. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  284. internal static extern float Drawable_GetDrawDistance (IntPtr handle);
  285. /// <summary>
  286. /// Return draw distance.
  287. /// </summary>
  288. private float GetDrawDistance ()
  289. {
  290. Runtime.ValidateRefCounted (this);
  291. return Drawable_GetDrawDistance (handle);
  292. }
  293. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  294. internal static extern float Drawable_GetShadowDistance (IntPtr handle);
  295. /// <summary>
  296. /// Return shadow draw distance.
  297. /// </summary>
  298. private float GetShadowDistance ()
  299. {
  300. Runtime.ValidateRefCounted (this);
  301. return Drawable_GetShadowDistance (handle);
  302. }
  303. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  304. internal static extern float Drawable_GetLodBias (IntPtr handle);
  305. /// <summary>
  306. /// Return LOD bias.
  307. /// </summary>
  308. private float GetLodBias ()
  309. {
  310. Runtime.ValidateRefCounted (this);
  311. return Drawable_GetLodBias (handle);
  312. }
  313. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  314. internal static extern uint Drawable_GetViewMask (IntPtr handle);
  315. /// <summary>
  316. /// Return view mask.
  317. /// </summary>
  318. private uint GetViewMask ()
  319. {
  320. Runtime.ValidateRefCounted (this);
  321. return Drawable_GetViewMask (handle);
  322. }
  323. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  324. internal static extern uint Drawable_GetLightMask (IntPtr handle);
  325. /// <summary>
  326. /// Return light mask.
  327. /// </summary>
  328. private uint GetLightMask ()
  329. {
  330. Runtime.ValidateRefCounted (this);
  331. return Drawable_GetLightMask (handle);
  332. }
  333. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  334. internal static extern uint Drawable_GetShadowMask (IntPtr handle);
  335. /// <summary>
  336. /// Return shadow mask.
  337. /// </summary>
  338. private uint GetShadowMask ()
  339. {
  340. Runtime.ValidateRefCounted (this);
  341. return Drawable_GetShadowMask (handle);
  342. }
  343. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  344. internal static extern uint Drawable_GetZoneMask (IntPtr handle);
  345. /// <summary>
  346. /// Return zone mask.
  347. /// </summary>
  348. private uint GetZoneMask ()
  349. {
  350. Runtime.ValidateRefCounted (this);
  351. return Drawable_GetZoneMask (handle);
  352. }
  353. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  354. internal static extern uint Drawable_GetMaxLights (IntPtr handle);
  355. /// <summary>
  356. /// Return maximum number of per-pixel lights.
  357. /// </summary>
  358. private uint GetMaxLights ()
  359. {
  360. Runtime.ValidateRefCounted (this);
  361. return Drawable_GetMaxLights (handle);
  362. }
  363. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  364. internal static extern bool Drawable_GetCastShadows (IntPtr handle);
  365. /// <summary>
  366. /// Return shadowcaster flag.
  367. /// </summary>
  368. private bool GetCastShadows ()
  369. {
  370. Runtime.ValidateRefCounted (this);
  371. return Drawable_GetCastShadows (handle);
  372. }
  373. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  374. internal static extern bool Drawable_IsOccluder (IntPtr handle);
  375. /// <summary>
  376. /// Return occluder flag.
  377. /// </summary>
  378. private bool IsOccluder ()
  379. {
  380. Runtime.ValidateRefCounted (this);
  381. return Drawable_IsOccluder (handle);
  382. }
  383. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  384. internal static extern bool Drawable_IsOccludee (IntPtr handle);
  385. /// <summary>
  386. /// Return occludee flag.
  387. /// </summary>
  388. private bool IsOccludee ()
  389. {
  390. Runtime.ValidateRefCounted (this);
  391. return Drawable_IsOccludee (handle);
  392. }
  393. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  394. internal static extern bool Drawable_IsInView (IntPtr handle);
  395. /// <summary>
  396. /// Return whether is in view this frame from any viewport camera. Excludes shadow map cameras.
  397. /// </summary>
  398. private bool IsInView ()
  399. {
  400. Runtime.ValidateRefCounted (this);
  401. return Drawable_IsInView (handle);
  402. }
  403. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  404. internal static extern bool Drawable_IsInView0 (IntPtr handle, IntPtr camera);
  405. /// <summary>
  406. /// Return whether is in view of a specific camera this frame. Pass in a null camera to allow any camera, including shadow map cameras.
  407. /// </summary>
  408. public bool IsInView (Camera camera)
  409. {
  410. Runtime.ValidateRefCounted (this);
  411. return Drawable_IsInView0 (handle, (object)camera == null ? IntPtr.Zero : camera.Handle);
  412. }
  413. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  414. internal static extern void Drawable_SetZone (IntPtr handle, IntPtr zone, bool temporary);
  415. /// <summary>
  416. /// Set new zone. Zone assignment may optionally be temporary, meaning it needs to be re-evaluated on the next frame.
  417. /// </summary>
  418. public void SetZone (Zone zone, bool temporary = false)
  419. {
  420. Runtime.ValidateRefCounted (this);
  421. Drawable_SetZone (handle, (object)zone == null ? IntPtr.Zero : zone.Handle, temporary);
  422. }
  423. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  424. internal static extern void Drawable_SetSortValue (IntPtr handle, float value);
  425. /// <summary>
  426. /// Set sorting value.
  427. /// </summary>
  428. private void SetSortValue (float value)
  429. {
  430. Runtime.ValidateRefCounted (this);
  431. Drawable_SetSortValue (handle, value);
  432. }
  433. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  434. internal static extern void Drawable_SetMinMaxZ (IntPtr handle, float minZ, float maxZ);
  435. /// <summary>
  436. /// Set view-space depth bounds.
  437. /// </summary>
  438. public void SetMinMaxZ (float minZ, float maxZ)
  439. {
  440. Runtime.ValidateRefCounted (this);
  441. Drawable_SetMinMaxZ (handle, minZ, maxZ);
  442. }
  443. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  444. internal static extern void Drawable_MarkInView (IntPtr handle, uint frameNumber);
  445. /// <summary>
  446. /// Mark in view without specifying a camera. Used for shadow casters.
  447. /// </summary>
  448. public void MarkInView (uint frameNumber)
  449. {
  450. Runtime.ValidateRefCounted (this);
  451. Drawable_MarkInView (handle, frameNumber);
  452. }
  453. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  454. internal static extern void Drawable_LimitLights (IntPtr handle);
  455. /// <summary>
  456. /// Sort and limit per-pixel lights to maximum allowed. Convert extra lights into vertex lights.
  457. /// </summary>
  458. public void LimitLights ()
  459. {
  460. Runtime.ValidateRefCounted (this);
  461. Drawable_LimitLights (handle);
  462. }
  463. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  464. internal static extern void Drawable_LimitVertexLights (IntPtr handle, bool removeConvertedLights);
  465. /// <summary>
  466. /// Sort and limit per-vertex lights to maximum allowed.
  467. /// </summary>
  468. public void LimitVertexLights (bool removeConvertedLights)
  469. {
  470. Runtime.ValidateRefCounted (this);
  471. Drawable_LimitVertexLights (handle, removeConvertedLights);
  472. }
  473. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  474. internal static extern void Drawable_SetBasePass (IntPtr handle, uint batchIndex);
  475. /// <summary>
  476. /// Set base pass flag for a batch.
  477. /// </summary>
  478. public void SetBasePass (uint batchIndex)
  479. {
  480. Runtime.ValidateRefCounted (this);
  481. Drawable_SetBasePass (handle, batchIndex);
  482. }
  483. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  484. internal static extern Octant* Drawable_GetOctant (IntPtr handle);
  485. /// <summary>
  486. /// Return octree octant.
  487. /// </summary>
  488. private Octant* GetOctant ()
  489. {
  490. Runtime.ValidateRefCounted (this);
  491. return Drawable_GetOctant (handle);
  492. }
  493. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  494. internal static extern IntPtr Drawable_GetZone (IntPtr handle);
  495. /// <summary>
  496. /// Return current zone.
  497. /// </summary>
  498. private Zone GetZone ()
  499. {
  500. Runtime.ValidateRefCounted (this);
  501. return Runtime.LookupObject<Zone> (Drawable_GetZone (handle));
  502. }
  503. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  504. internal static extern bool Drawable_IsZoneDirty (IntPtr handle);
  505. /// <summary>
  506. /// Return whether current zone is inconclusive or dirty due to the drawable moving.
  507. /// </summary>
  508. private bool IsZoneDirty ()
  509. {
  510. Runtime.ValidateRefCounted (this);
  511. return Drawable_IsZoneDirty (handle);
  512. }
  513. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  514. internal static extern float Drawable_GetDistance (IntPtr handle);
  515. /// <summary>
  516. /// Return distance from camera.
  517. /// </summary>
  518. private float GetDistance ()
  519. {
  520. Runtime.ValidateRefCounted (this);
  521. return Drawable_GetDistance (handle);
  522. }
  523. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  524. internal static extern float Drawable_GetLodDistance (IntPtr handle);
  525. /// <summary>
  526. /// Return LOD scaled distance from camera.
  527. /// </summary>
  528. private float GetLodDistance ()
  529. {
  530. Runtime.ValidateRefCounted (this);
  531. return Drawable_GetLodDistance (handle);
  532. }
  533. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  534. internal static extern float Drawable_GetSortValue (IntPtr handle);
  535. /// <summary>
  536. /// Return sorting value.
  537. /// </summary>
  538. private float GetSortValue ()
  539. {
  540. Runtime.ValidateRefCounted (this);
  541. return Drawable_GetSortValue (handle);
  542. }
  543. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  544. internal static extern bool Drawable_HasBasePass (IntPtr handle, uint batchIndex);
  545. /// <summary>
  546. /// Return whether has a base pass.
  547. /// </summary>
  548. public bool HasBasePass (uint batchIndex)
  549. {
  550. Runtime.ValidateRefCounted (this);
  551. return Drawable_HasBasePass (handle, batchIndex);
  552. }
  553. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  554. internal static extern IntPtr Drawable_GetFirstLight (IntPtr handle);
  555. /// <summary>
  556. /// Return the first added per-pixel light.
  557. /// </summary>
  558. private Light GetFirstLight ()
  559. {
  560. Runtime.ValidateRefCounted (this);
  561. return Runtime.LookupObject<Light> (Drawable_GetFirstLight (handle));
  562. }
  563. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  564. internal static extern float Drawable_GetMinZ (IntPtr handle);
  565. /// <summary>
  566. /// Return the minimum view-space depth.
  567. /// </summary>
  568. private float GetMinZ ()
  569. {
  570. Runtime.ValidateRefCounted (this);
  571. return Drawable_GetMinZ (handle);
  572. }
  573. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  574. internal static extern float Drawable_GetMaxZ (IntPtr handle);
  575. /// <summary>
  576. /// Return the maximum view-space depth.
  577. /// </summary>
  578. private float GetMaxZ ()
  579. {
  580. Runtime.ValidateRefCounted (this);
  581. return Drawable_GetMaxZ (handle);
  582. }
  583. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  584. internal static extern void Drawable_AddLight (IntPtr handle, IntPtr light);
  585. /// <summary>
  586. /// Add a per-pixel light affecting the object this frame.
  587. /// </summary>
  588. public void AddLight (Light light)
  589. {
  590. Runtime.ValidateRefCounted (this);
  591. Drawable_AddLight (handle, (object)light == null ? IntPtr.Zero : light.Handle);
  592. }
  593. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  594. internal static extern void Drawable_AddVertexLight (IntPtr handle, IntPtr light);
  595. /// <summary>
  596. /// Add a per-vertex light affecting the object this frame.
  597. /// </summary>
  598. public void AddVertexLight (Light light)
  599. {
  600. Runtime.ValidateRefCounted (this);
  601. Drawable_AddVertexLight (handle, (object)light == null ? IntPtr.Zero : light.Handle);
  602. }
  603. public override StringHash Type {
  604. get {
  605. return UrhoGetType ();
  606. }
  607. }
  608. public override string TypeName {
  609. get {
  610. return GetTypeName ();
  611. }
  612. }
  613. [Preserve]
  614. public new static StringHash TypeStatic {
  615. get {
  616. return GetTypeStatic ();
  617. }
  618. }
  619. public new static string TypeNameStatic {
  620. get {
  621. return GetTypeNameStatic ();
  622. }
  623. }
  624. /// <summary>
  625. /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
  626. /// </summary>
  627. public virtual UpdateGeometryType UpdateGeometryType {
  628. get {
  629. return GetUpdateGeometryType ();
  630. }
  631. }
  632. /// <summary>
  633. /// Return number of occlusion geometry triangles.
  634. /// </summary>
  635. public virtual uint NumOccluderTriangles {
  636. get {
  637. return GetNumOccluderTriangles ();
  638. }
  639. }
  640. /// <summary>
  641. /// Return draw distance.
  642. /// Or
  643. /// Set draw distance.
  644. /// </summary>
  645. public float DrawDistance {
  646. get {
  647. return GetDrawDistance ();
  648. }
  649. set {
  650. SetDrawDistance (value);
  651. }
  652. }
  653. /// <summary>
  654. /// Return shadow draw distance.
  655. /// Or
  656. /// Set shadow draw distance.
  657. /// </summary>
  658. public float ShadowDistance {
  659. get {
  660. return GetShadowDistance ();
  661. }
  662. set {
  663. SetShadowDistance (value);
  664. }
  665. }
  666. /// <summary>
  667. /// Return LOD bias.
  668. /// Or
  669. /// Set LOD bias.
  670. /// </summary>
  671. public float LodBias {
  672. get {
  673. return GetLodBias ();
  674. }
  675. set {
  676. SetLodBias (value);
  677. }
  678. }
  679. /// <summary>
  680. /// Return view mask.
  681. /// Or
  682. /// Set view mask. Is and'ed with camera's view mask to see if the object should be rendered.
  683. /// </summary>
  684. public uint ViewMask {
  685. get {
  686. return GetViewMask ();
  687. }
  688. set {
  689. SetViewMask (value);
  690. }
  691. }
  692. /// <summary>
  693. /// Return light mask.
  694. /// Or
  695. /// Set light mask. Is and'ed with light's and zone's light mask to see if the object should be lit.
  696. /// </summary>
  697. public uint LightMask {
  698. get {
  699. return GetLightMask ();
  700. }
  701. set {
  702. SetLightMask (value);
  703. }
  704. }
  705. /// <summary>
  706. /// Return shadow mask.
  707. /// Or
  708. /// Set shadow mask. Is and'ed with light's light mask and zone's shadow mask to see if the object should be rendered to a shadow map.
  709. /// </summary>
  710. public uint ShadowMask {
  711. get {
  712. return GetShadowMask ();
  713. }
  714. set {
  715. SetShadowMask (value);
  716. }
  717. }
  718. /// <summary>
  719. /// Return zone mask.
  720. /// Or
  721. /// Set zone mask. Is and'ed with zone's zone mask to see if the object should belong to the zone.
  722. /// </summary>
  723. public uint ZoneMask {
  724. get {
  725. return GetZoneMask ();
  726. }
  727. set {
  728. SetZoneMask (value);
  729. }
  730. }
  731. /// <summary>
  732. /// Return maximum number of per-pixel lights.
  733. /// Or
  734. /// Set maximum number of per-pixel lights. Default 0 is unlimited.
  735. /// </summary>
  736. public uint MaxLights {
  737. get {
  738. return GetMaxLights ();
  739. }
  740. set {
  741. SetMaxLights (value);
  742. }
  743. }
  744. /// <summary>
  745. /// Return shadowcaster flag.
  746. /// Or
  747. /// Set shadowcaster flag.
  748. /// </summary>
  749. public bool CastShadows {
  750. get {
  751. return GetCastShadows ();
  752. }
  753. set {
  754. SetCastShadows (value);
  755. }
  756. }
  757. /// <summary>
  758. /// Return occluder flag.
  759. /// Or
  760. /// Set occlusion flag.
  761. /// </summary>
  762. public bool Occluder {
  763. get {
  764. return IsOccluder ();
  765. }
  766. set {
  767. SetOccluder (value);
  768. }
  769. }
  770. /// <summary>
  771. /// Return occludee flag.
  772. /// Or
  773. /// Set occludee flag.
  774. /// </summary>
  775. public bool Occludee {
  776. get {
  777. return IsOccludee ();
  778. }
  779. set {
  780. SetOccludee (value);
  781. }
  782. }
  783. /// <summary>
  784. /// Return local space bounding box. May not be applicable or properly updated on all drawables.
  785. /// </summary>
  786. public Urho.BoundingBox BoundingBox {
  787. get {
  788. return GetBoundingBox ();
  789. }
  790. }
  791. /// <summary>
  792. /// Return world-space bounding box.
  793. /// </summary>
  794. public Urho.BoundingBox WorldBoundingBox {
  795. get {
  796. return GetWorldBoundingBox ();
  797. }
  798. }
  799. /// <summary>
  800. /// Return drawable flags.
  801. /// </summary>
  802. public byte DrawableFlags {
  803. get {
  804. return GetDrawableFlags ();
  805. }
  806. }
  807. /// <summary>
  808. /// Return whether is in view this frame from any viewport camera. Excludes shadow map cameras.
  809. /// </summary>
  810. public bool InView {
  811. get {
  812. return IsInView ();
  813. }
  814. }
  815. /// <summary>
  816. /// Return sorting value.
  817. /// Or
  818. /// Set sorting value.
  819. /// </summary>
  820. public float SortValue {
  821. get {
  822. return GetSortValue ();
  823. }
  824. set {
  825. SetSortValue (value);
  826. }
  827. }
  828. /// <summary>
  829. /// Return octree octant.
  830. /// </summary>
  831. public Octant* Octant {
  832. get {
  833. return GetOctant ();
  834. }
  835. }
  836. /// <summary>
  837. /// Return current zone.
  838. /// </summary>
  839. public Zone Zone {
  840. get {
  841. return GetZone ();
  842. }
  843. }
  844. /// <summary>
  845. /// Return whether current zone is inconclusive or dirty due to the drawable moving.
  846. /// </summary>
  847. public bool ZoneDirty {
  848. get {
  849. return IsZoneDirty ();
  850. }
  851. }
  852. /// <summary>
  853. /// Return distance from camera.
  854. /// </summary>
  855. public float Distance {
  856. get {
  857. return GetDistance ();
  858. }
  859. }
  860. /// <summary>
  861. /// Return LOD scaled distance from camera.
  862. /// </summary>
  863. public float LodDistance {
  864. get {
  865. return GetLodDistance ();
  866. }
  867. }
  868. /// <summary>
  869. /// Return the first added per-pixel light.
  870. /// </summary>
  871. public Light FirstLight {
  872. get {
  873. return GetFirstLight ();
  874. }
  875. }
  876. /// <summary>
  877. /// Return the minimum view-space depth.
  878. /// </summary>
  879. public float MinZ {
  880. get {
  881. return GetMinZ ();
  882. }
  883. }
  884. /// <summary>
  885. /// Return the maximum view-space depth.
  886. /// </summary>
  887. public float MaxZ {
  888. get {
  889. return GetMaxZ ();
  890. }
  891. }
  892. }
  893. }