Node.cs 80 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Node.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. /// %Scene node that may contain components and child nodes.
  21. /// </summary>
  22. public unsafe partial class Node : Animatable
  23. {
  24. unsafe partial void OnNodeCreated ();
  25. [Preserve]
  26. public Node (IntPtr handle) : base (handle)
  27. {
  28. OnNodeCreated ();
  29. }
  30. [Preserve]
  31. protected Node (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnNodeCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int Node_GetType (IntPtr handle);
  37. private StringHash GetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (Node_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr Node_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (Node_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int Node_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(Node));
  54. return new StringHash (Node_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr Node_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(Node));
  61. return Marshal.PtrToStringAnsi (Node_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public Node () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr Node_Node (IntPtr context);
  69. [Preserve]
  70. public Node (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(Node));
  73. handle = Node_Node ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnNodeCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void Node_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(Node));
  85. Node_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern bool Node_Load_File (IntPtr handle, IntPtr source, bool setInstanceDefault);
  89. /// <summary>
  90. /// Load from binary data. Return true if successful.
  91. /// </summary>
  92. public override bool Load (File source, bool setInstanceDefault = false)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. return Node_Load_File (handle, (object)source == null ? IntPtr.Zero : source.Handle, setInstanceDefault);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern bool Node_Load_MemoryBuffer (IntPtr handle, IntPtr source, bool setInstanceDefault);
  99. /// <summary>
  100. /// Load from binary data. Return true if successful.
  101. /// </summary>
  102. public override bool Load (MemoryBuffer source, bool setInstanceDefault = false)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. return Node_Load_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle, setInstanceDefault);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern bool Node_LoadXML (IntPtr handle, IntPtr source, bool setInstanceDefault);
  109. /// <summary>
  110. /// Load from XML data. Return true if successful.
  111. /// </summary>
  112. public override bool LoadXml (XmlElement source, bool setInstanceDefault = false)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. return Node_LoadXML (handle, (object)source == null ? IntPtr.Zero : source.Handle, setInstanceDefault);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern bool Node_Save_File (IntPtr handle, IntPtr dest);
  119. /// <summary>
  120. /// Save as binary data. Return true if successful.
  121. /// </summary>
  122. public override bool Save (File dest)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. return Node_Save_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern bool Node_Save_MemoryBuffer (IntPtr handle, IntPtr dest);
  129. /// <summary>
  130. /// Save as binary data. Return true if successful.
  131. /// </summary>
  132. public override bool Save (MemoryBuffer dest)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return Node_Save_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern bool Node_SaveXML (IntPtr handle, IntPtr dest);
  139. /// <summary>
  140. /// Save as XML data. Return true if successful.
  141. /// </summary>
  142. public override bool SaveXml (XmlElement dest)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. return Node_SaveXML (handle, (object)dest == null ? IntPtr.Zero : dest.Handle);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void Node_ApplyAttributes (IntPtr handle);
  149. /// <summary>
  150. /// Apply attribute changes that can not be applied immediately recursively to child nodes and components.
  151. /// </summary>
  152. public override void ApplyAttributes ()
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. Node_ApplyAttributes (handle);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern bool Node_SaveDefaultAttributes (IntPtr handle);
  159. /// <summary>
  160. /// Return whether should save default-valued attributes into XML. Always save node transforms for readability, even if identity.
  161. /// </summary>
  162. public override bool SaveDefaultAttributes ()
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. return Node_SaveDefaultAttributes (handle);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void Node_MarkNetworkUpdate (IntPtr handle);
  169. /// <summary>
  170. /// Mark for attribute check on the next network update.
  171. /// </summary>
  172. public override void MarkNetworkUpdate ()
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. Node_MarkNetworkUpdate (handle);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void Node_AddReplicationState (IntPtr handle, NodeReplicationState* state);
  179. /// <summary>
  180. /// Add a replication state that is tracking this node.
  181. /// </summary>
  182. public virtual void AddReplicationState (NodeReplicationState* state)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. Node_AddReplicationState (handle, state);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern bool Node_SaveXML0_File (IntPtr handle, IntPtr dest, string indentation);
  189. /// <summary>
  190. /// Save to an XML file. Return true if successful.
  191. /// </summary>
  192. public virtual bool SaveXml (File dest, string indentation = "\t")
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return Node_SaveXML0_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, indentation);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern bool Node_SaveXML0_MemoryBuffer (IntPtr handle, IntPtr dest, string indentation);
  199. /// <summary>
  200. /// Save to an XML file. Return true if successful.
  201. /// </summary>
  202. public virtual bool SaveXml (MemoryBuffer dest, string indentation = "\t")
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return Node_SaveXML0_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, indentation);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern bool Node_SaveJSON_File (IntPtr handle, IntPtr dest, string indentation);
  209. /// <summary>
  210. /// Save to a JSON file. Return true if successful.
  211. /// </summary>
  212. public virtual bool SaveJson (File dest, string indentation = "\t")
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return Node_SaveJSON_File (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, indentation);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern bool Node_SaveJSON_MemoryBuffer (IntPtr handle, IntPtr dest, string indentation);
  219. /// <summary>
  220. /// Save to a JSON file. Return true if successful.
  221. /// </summary>
  222. public virtual bool SaveJson (MemoryBuffer dest, string indentation = "\t")
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return Node_SaveJSON_MemoryBuffer (handle, (object)dest == null ? IntPtr.Zero : dest.Handle, indentation);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern void Node_SetName (IntPtr handle, string name);
  229. /// <summary>
  230. /// Set name of the scene node. Names are not required to be unique.
  231. /// </summary>
  232. private void SetName (string name)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. Node_SetName (handle, name);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void Node_AddTag (IntPtr handle, string tag);
  239. /// <summary>
  240. /// Add a tag.
  241. /// </summary>
  242. public void AddTag (string tag)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. Node_AddTag (handle, tag);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern bool Node_RemoveTag (IntPtr handle, string tag);
  249. /// <summary>
  250. /// Remove tag. Return true if existed.
  251. /// </summary>
  252. public bool RemoveTag (string tag)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. return Node_RemoveTag (handle, tag);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern void Node_RemoveAllTags (IntPtr handle);
  259. /// <summary>
  260. /// Remove all tags.
  261. /// </summary>
  262. public void RemoveAllTags ()
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. Node_RemoveAllTags (handle);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern void Node_SetPosition (IntPtr handle, ref Urho.Vector3 position);
  269. /// <summary>
  270. /// Set position in parent space. If the scene node is on the root level (is child of the scene itself), this is same as world space.
  271. /// </summary>
  272. private void SetPosition (Urho.Vector3 position)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. Node_SetPosition (handle, ref position);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern void Node_SetPosition2D (IntPtr handle, ref Urho.Vector2 position);
  279. /// <summary>
  280. /// Set position in parent space (for Urho2D).
  281. /// </summary>
  282. public void SetPosition2D (Urho.Vector2 position)
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. Node_SetPosition2D (handle, ref position);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern void Node_SetPosition2D1 (IntPtr handle, float x, float y);
  289. /// <summary>
  290. /// Set position in parent space (for Urho2D).
  291. /// </summary>
  292. public void SetPosition2D (float x, float y)
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. Node_SetPosition2D1 (handle, x, y);
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern void Node_SetRotation (IntPtr handle, ref Urho.Quaternion rotation);
  299. /// <summary>
  300. /// Set rotation in parent space.
  301. /// </summary>
  302. private void SetRotation (Urho.Quaternion rotation)
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. Node_SetRotation (handle, ref rotation);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern void Node_SetRotation2D (IntPtr handle, float rotation);
  309. /// <summary>
  310. /// Set rotation in parent space (for Urho2D).
  311. /// </summary>
  312. private void SetRotation2D (float rotation)
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. Node_SetRotation2D (handle, rotation);
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern void Node_SetDirection (IntPtr handle, ref Urho.Vector3 direction);
  319. /// <summary>
  320. /// Set forward direction in parent space. Positive Z axis equals identity rotation.
  321. /// </summary>
  322. public void SetDirection (Urho.Vector3 direction)
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. Node_SetDirection (handle, ref direction);
  326. }
  327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  328. internal static extern void Node_SetScale (IntPtr handle, float scale);
  329. /// <summary>
  330. /// Set uniform scale in parent space.
  331. /// </summary>
  332. public void SetScale (float scale)
  333. {
  334. Runtime.ValidateRefCounted (this);
  335. Node_SetScale (handle, scale);
  336. }
  337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  338. internal static extern void Node_SetScale2 (IntPtr handle, ref Urho.Vector3 scale);
  339. /// <summary>
  340. /// Set scale in parent space.
  341. /// </summary>
  342. private void SetScale (Urho.Vector3 scale)
  343. {
  344. Runtime.ValidateRefCounted (this);
  345. Node_SetScale2 (handle, ref scale);
  346. }
  347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  348. internal static extern void Node_SetScale2D (IntPtr handle, ref Urho.Vector2 scale);
  349. /// <summary>
  350. /// Set scale in parent space (for Urho2D).
  351. /// </summary>
  352. public void SetScale2D (Urho.Vector2 scale)
  353. {
  354. Runtime.ValidateRefCounted (this);
  355. Node_SetScale2D (handle, ref scale);
  356. }
  357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  358. internal static extern void Node_SetScale2D3 (IntPtr handle, float x, float y);
  359. /// <summary>
  360. /// Set scale in parent space (for Urho2D).
  361. /// </summary>
  362. public void SetScale2D (float x, float y)
  363. {
  364. Runtime.ValidateRefCounted (this);
  365. Node_SetScale2D3 (handle, x, y);
  366. }
  367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  368. internal static extern void Node_SetTransform (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  369. /// <summary>
  370. /// Set both position and rotation in parent space as an atomic operation. This is faster than setting position and rotation separately.
  371. /// </summary>
  372. public void SetTransform (Urho.Vector3 position, Urho.Quaternion rotation)
  373. {
  374. Runtime.ValidateRefCounted (this);
  375. Node_SetTransform (handle, ref position, ref rotation);
  376. }
  377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  378. internal static extern void Node_SetTransform4 (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation, float scale);
  379. /// <summary>
  380. /// Set both position, rotation and uniform scale in parent space as an atomic operation.
  381. /// </summary>
  382. public void SetTransform (Urho.Vector3 position, Urho.Quaternion rotation, float scale)
  383. {
  384. Runtime.ValidateRefCounted (this);
  385. Node_SetTransform4 (handle, ref position, ref rotation, scale);
  386. }
  387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  388. internal static extern void Node_SetTransform5 (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation, ref Urho.Vector3 scale);
  389. /// <summary>
  390. /// Set both position, rotation and scale in parent space as an atomic operation.
  391. /// </summary>
  392. public void SetTransform (Urho.Vector3 position, Urho.Quaternion rotation, Urho.Vector3 scale)
  393. {
  394. Runtime.ValidateRefCounted (this);
  395. Node_SetTransform5 (handle, ref position, ref rotation, ref scale);
  396. }
  397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  398. internal static extern void Node_SetTransform6 (IntPtr handle, ref Urho.Matrix3x4 matrix);
  399. /// <summary>
  400. /// Set node transformation in parent space as an atomic operation.
  401. /// </summary>
  402. public void SetTransform (Urho.Matrix3x4 matrix)
  403. {
  404. Runtime.ValidateRefCounted (this);
  405. Node_SetTransform6 (handle, ref matrix);
  406. }
  407. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  408. internal static extern void Node_SetTransform2D (IntPtr handle, ref Urho.Vector2 position, float rotation);
  409. /// <summary>
  410. /// Set both position and rotation in parent space as an atomic operation (for Urho2D).
  411. /// </summary>
  412. public void SetTransform2D (Urho.Vector2 position, float rotation)
  413. {
  414. Runtime.ValidateRefCounted (this);
  415. Node_SetTransform2D (handle, ref position, rotation);
  416. }
  417. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  418. internal static extern void Node_SetTransform2D7 (IntPtr handle, ref Urho.Vector2 position, float rotation, float scale);
  419. /// <summary>
  420. /// Set both position, rotation and uniform scale in parent space as an atomic operation (for Urho2D).
  421. /// </summary>
  422. public void SetTransform2D (Urho.Vector2 position, float rotation, float scale)
  423. {
  424. Runtime.ValidateRefCounted (this);
  425. Node_SetTransform2D7 (handle, ref position, rotation, scale);
  426. }
  427. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  428. internal static extern void Node_SetTransform2D8 (IntPtr handle, ref Urho.Vector2 position, float rotation, ref Urho.Vector2 scale);
  429. /// <summary>
  430. /// Set both position, rotation and scale in parent space as an atomic operation (for Urho2D).
  431. /// </summary>
  432. public void SetTransform2D (Urho.Vector2 position, float rotation, Urho.Vector2 scale)
  433. {
  434. Runtime.ValidateRefCounted (this);
  435. Node_SetTransform2D8 (handle, ref position, rotation, ref scale);
  436. }
  437. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  438. internal static extern void Node_SetWorldPosition (IntPtr handle, ref Urho.Vector3 position);
  439. /// <summary>
  440. /// Set position in world space.
  441. /// </summary>
  442. public void SetWorldPosition (Urho.Vector3 position)
  443. {
  444. Runtime.ValidateRefCounted (this);
  445. Node_SetWorldPosition (handle, ref position);
  446. }
  447. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  448. internal static extern void Node_SetWorldPosition2D (IntPtr handle, ref Urho.Vector2 position);
  449. /// <summary>
  450. /// Set position in world space (for Urho2D).
  451. /// </summary>
  452. public void SetWorldPosition2D (Urho.Vector2 position)
  453. {
  454. Runtime.ValidateRefCounted (this);
  455. Node_SetWorldPosition2D (handle, ref position);
  456. }
  457. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  458. internal static extern void Node_SetWorldPosition2D9 (IntPtr handle, float x, float y);
  459. /// <summary>
  460. /// Set position in world space (for Urho2D).
  461. /// </summary>
  462. public void SetWorldPosition2D (float x, float y)
  463. {
  464. Runtime.ValidateRefCounted (this);
  465. Node_SetWorldPosition2D9 (handle, x, y);
  466. }
  467. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  468. internal static extern void Node_SetWorldRotation (IntPtr handle, ref Urho.Quaternion rotation);
  469. /// <summary>
  470. /// Set rotation in world space.
  471. /// </summary>
  472. public void SetWorldRotation (Urho.Quaternion rotation)
  473. {
  474. Runtime.ValidateRefCounted (this);
  475. Node_SetWorldRotation (handle, ref rotation);
  476. }
  477. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  478. internal static extern void Node_SetWorldRotation2D (IntPtr handle, float rotation);
  479. /// <summary>
  480. /// Set rotation in world space (for Urho2D).
  481. /// </summary>
  482. private void SetWorldRotation2D (float rotation)
  483. {
  484. Runtime.ValidateRefCounted (this);
  485. Node_SetWorldRotation2D (handle, rotation);
  486. }
  487. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  488. internal static extern void Node_SetWorldDirection (IntPtr handle, ref Urho.Vector3 direction);
  489. /// <summary>
  490. /// Set forward direction in world space.
  491. /// </summary>
  492. public void SetWorldDirection (Urho.Vector3 direction)
  493. {
  494. Runtime.ValidateRefCounted (this);
  495. Node_SetWorldDirection (handle, ref direction);
  496. }
  497. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  498. internal static extern void Node_SetWorldScale (IntPtr handle, float scale);
  499. /// <summary>
  500. /// Set uniform scale in world space.
  501. /// </summary>
  502. public void SetWorldScale (float scale)
  503. {
  504. Runtime.ValidateRefCounted (this);
  505. Node_SetWorldScale (handle, scale);
  506. }
  507. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  508. internal static extern void Node_SetWorldScale10 (IntPtr handle, ref Urho.Vector3 scale);
  509. /// <summary>
  510. /// Set scale in world space.
  511. /// </summary>
  512. public void SetWorldScale (Urho.Vector3 scale)
  513. {
  514. Runtime.ValidateRefCounted (this);
  515. Node_SetWorldScale10 (handle, ref scale);
  516. }
  517. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  518. internal static extern void Node_SetWorldScale2D (IntPtr handle, ref Urho.Vector2 scale);
  519. /// <summary>
  520. /// Set scale in world space (for Urho2D).
  521. /// </summary>
  522. public void SetWorldScale2D (Urho.Vector2 scale)
  523. {
  524. Runtime.ValidateRefCounted (this);
  525. Node_SetWorldScale2D (handle, ref scale);
  526. }
  527. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  528. internal static extern void Node_SetWorldScale2D11 (IntPtr handle, float x, float y);
  529. /// <summary>
  530. /// Set scale in world space (for Urho2D).
  531. /// </summary>
  532. public void SetWorldScale2D (float x, float y)
  533. {
  534. Runtime.ValidateRefCounted (this);
  535. Node_SetWorldScale2D11 (handle, x, y);
  536. }
  537. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  538. internal static extern void Node_SetWorldTransform (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation);
  539. /// <summary>
  540. /// Set both position and rotation in world space as an atomic operation.
  541. /// </summary>
  542. public void SetWorldTransform (Urho.Vector3 position, Urho.Quaternion rotation)
  543. {
  544. Runtime.ValidateRefCounted (this);
  545. Node_SetWorldTransform (handle, ref position, ref rotation);
  546. }
  547. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  548. internal static extern void Node_SetWorldTransform12 (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation, float scale);
  549. /// <summary>
  550. /// Set both position, rotation and uniform scale in world space as an atomic operation.
  551. /// </summary>
  552. public void SetWorldTransform (Urho.Vector3 position, Urho.Quaternion rotation, float scale)
  553. {
  554. Runtime.ValidateRefCounted (this);
  555. Node_SetWorldTransform12 (handle, ref position, ref rotation, scale);
  556. }
  557. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  558. internal static extern void Node_SetWorldTransform13 (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation, ref Urho.Vector3 scale);
  559. /// <summary>
  560. /// Set both position, rotation and scale in world space as an atomic opration.
  561. /// </summary>
  562. public void SetWorldTransform (Urho.Vector3 position, Urho.Quaternion rotation, Urho.Vector3 scale)
  563. {
  564. Runtime.ValidateRefCounted (this);
  565. Node_SetWorldTransform13 (handle, ref position, ref rotation, ref scale);
  566. }
  567. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  568. internal static extern void Node_SetWorldTransform2D (IntPtr handle, ref Urho.Vector2 position, float rotation);
  569. /// <summary>
  570. /// Set both position and rotation in world space as an atomic operation (for Urho2D).
  571. /// </summary>
  572. public void SetWorldTransform2D (Urho.Vector2 position, float rotation)
  573. {
  574. Runtime.ValidateRefCounted (this);
  575. Node_SetWorldTransform2D (handle, ref position, rotation);
  576. }
  577. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  578. internal static extern void Node_SetWorldTransform2D14 (IntPtr handle, ref Urho.Vector2 position, float rotation, float scale);
  579. /// <summary>
  580. /// Set both position, rotation and uniform scale in world space as an atomic operation (for Urho2D).
  581. /// </summary>
  582. public void SetWorldTransform2D (Urho.Vector2 position, float rotation, float scale)
  583. {
  584. Runtime.ValidateRefCounted (this);
  585. Node_SetWorldTransform2D14 (handle, ref position, rotation, scale);
  586. }
  587. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  588. internal static extern void Node_SetWorldTransform2D15 (IntPtr handle, ref Urho.Vector2 position, float rotation, ref Urho.Vector2 scale);
  589. /// <summary>
  590. /// Set both position, rotation and scale in world space as an atomic opration (for Urho2D).
  591. /// </summary>
  592. public void SetWorldTransform2D (Urho.Vector2 position, float rotation, Urho.Vector2 scale)
  593. {
  594. Runtime.ValidateRefCounted (this);
  595. Node_SetWorldTransform2D15 (handle, ref position, rotation, ref scale);
  596. }
  597. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  598. internal static extern void Node_Translate (IntPtr handle, ref Urho.Vector3 delta, TransformSpace space);
  599. /// <summary>
  600. /// Move the scene node in the chosen transform space.
  601. /// </summary>
  602. public void Translate (Urho.Vector3 delta, TransformSpace space = TransformSpace.Local)
  603. {
  604. Runtime.ValidateRefCounted (this);
  605. Node_Translate (handle, ref delta, space);
  606. }
  607. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  608. internal static extern void Node_Translate2D (IntPtr handle, ref Urho.Vector2 delta, TransformSpace space);
  609. /// <summary>
  610. /// Move the scene node in the chosen transform space (for Urho2D).
  611. /// </summary>
  612. public void Translate2D (Urho.Vector2 delta, TransformSpace space = TransformSpace.Local)
  613. {
  614. Runtime.ValidateRefCounted (this);
  615. Node_Translate2D (handle, ref delta, space);
  616. }
  617. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  618. internal static extern void Node_Rotate (IntPtr handle, ref Urho.Quaternion delta, TransformSpace space);
  619. /// <summary>
  620. /// Rotate the scene node in the chosen transform space.
  621. /// </summary>
  622. public void Rotate (Urho.Quaternion delta, TransformSpace space = TransformSpace.Local)
  623. {
  624. Runtime.ValidateRefCounted (this);
  625. Node_Rotate (handle, ref delta, space);
  626. }
  627. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  628. internal static extern void Node_Rotate2D (IntPtr handle, float delta, TransformSpace space);
  629. /// <summary>
  630. /// Rotate the scene node in the chosen transform space (for Urho2D).
  631. /// </summary>
  632. public void Rotate2D (float delta, TransformSpace space = TransformSpace.Local)
  633. {
  634. Runtime.ValidateRefCounted (this);
  635. Node_Rotate2D (handle, delta, space);
  636. }
  637. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  638. internal static extern void Node_RotateAround (IntPtr handle, ref Urho.Vector3 point, ref Urho.Quaternion delta, TransformSpace space);
  639. /// <summary>
  640. /// Rotate around a point in the chosen transform space.
  641. /// </summary>
  642. public void RotateAround (Urho.Vector3 point, Urho.Quaternion delta, TransformSpace space = TransformSpace.Local)
  643. {
  644. Runtime.ValidateRefCounted (this);
  645. Node_RotateAround (handle, ref point, ref delta, space);
  646. }
  647. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  648. internal static extern void Node_RotateAround2D (IntPtr handle, ref Urho.Vector2 point, float delta, TransformSpace space);
  649. /// <summary>
  650. /// Rotate around a point in the chosen transform space (for Urho2D).
  651. /// </summary>
  652. public void RotateAround2D (Urho.Vector2 point, float delta, TransformSpace space = TransformSpace.Local)
  653. {
  654. Runtime.ValidateRefCounted (this);
  655. Node_RotateAround2D (handle, ref point, delta, space);
  656. }
  657. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  658. internal static extern void Node_Pitch (IntPtr handle, float angle, TransformSpace space);
  659. /// <summary>
  660. /// Rotate around the X axis.
  661. /// </summary>
  662. public void Pitch (float angle, TransformSpace space = TransformSpace.Local)
  663. {
  664. Runtime.ValidateRefCounted (this);
  665. Node_Pitch (handle, angle, space);
  666. }
  667. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  668. internal static extern void Node_Yaw (IntPtr handle, float angle, TransformSpace space);
  669. /// <summary>
  670. /// Rotate around the Y axis.
  671. /// </summary>
  672. public void Yaw (float angle, TransformSpace space = TransformSpace.Local)
  673. {
  674. Runtime.ValidateRefCounted (this);
  675. Node_Yaw (handle, angle, space);
  676. }
  677. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  678. internal static extern void Node_Roll (IntPtr handle, float angle, TransformSpace space);
  679. /// <summary>
  680. /// Rotate around the Z axis.
  681. /// </summary>
  682. public void Roll (float angle, TransformSpace space = TransformSpace.Local)
  683. {
  684. Runtime.ValidateRefCounted (this);
  685. Node_Roll (handle, angle, space);
  686. }
  687. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  688. internal static extern bool Node_LookAt (IntPtr handle, ref Urho.Vector3 target, ref Urho.Vector3 up, TransformSpace space);
  689. /// <summary>
  690. /// Look at a target position in the chosen transform space. Note that the up vector is always specified in world space. Return true if successful, or false if resulted in an illegal rotation, in which case the current rotation remains.
  691. /// </summary>
  692. public bool LookAt (Urho.Vector3 target, Urho.Vector3 up, TransformSpace space = TransformSpace.World)
  693. {
  694. Runtime.ValidateRefCounted (this);
  695. return Node_LookAt (handle, ref target, ref up, space);
  696. }
  697. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  698. internal static extern void Node_Scale (IntPtr handle, float scale);
  699. /// <summary>
  700. /// Modify scale in parent space uniformly.
  701. /// </summary>
  702. public void ScaleNode (float scale)
  703. {
  704. Runtime.ValidateRefCounted (this);
  705. Node_Scale (handle, scale);
  706. }
  707. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  708. internal static extern void Node_Scale16 (IntPtr handle, ref Urho.Vector3 scale);
  709. /// <summary>
  710. /// Modify scale in parent space.
  711. /// </summary>
  712. public void ScaleNode (Urho.Vector3 scale)
  713. {
  714. Runtime.ValidateRefCounted (this);
  715. Node_Scale16 (handle, ref scale);
  716. }
  717. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  718. internal static extern void Node_Scale2D (IntPtr handle, ref Urho.Vector2 scale);
  719. /// <summary>
  720. /// Modify scale in parent space (for Urho2D).
  721. /// </summary>
  722. public void ScaleNode2D (Urho.Vector2 scale)
  723. {
  724. Runtime.ValidateRefCounted (this);
  725. Node_Scale2D (handle, ref scale);
  726. }
  727. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  728. internal static extern void Node_SetEnabled (IntPtr handle, bool enable);
  729. /// <summary>
  730. /// Set enabled/disabled state without recursion. Components in a disabled node become effectively disabled regardless of their own enable/disable state.
  731. /// </summary>
  732. private void SetEnabled (bool enable)
  733. {
  734. Runtime.ValidateRefCounted (this);
  735. Node_SetEnabled (handle, enable);
  736. }
  737. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  738. internal static extern void Node_SetDeepEnabled (IntPtr handle, bool enable);
  739. /// <summary>
  740. /// Set enabled state on self and child nodes. Nodes' own enabled state is remembered (IsEnabledSelf) and can be restored.
  741. /// </summary>
  742. public void SetDeepEnabled (bool enable)
  743. {
  744. Runtime.ValidateRefCounted (this);
  745. Node_SetDeepEnabled (handle, enable);
  746. }
  747. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  748. internal static extern void Node_ResetDeepEnabled (IntPtr handle);
  749. /// <summary>
  750. /// Reset enabled state to the node's remembered state prior to calling SetDeepEnabled.
  751. /// </summary>
  752. public void ResetDeepEnabled ()
  753. {
  754. Runtime.ValidateRefCounted (this);
  755. Node_ResetDeepEnabled (handle);
  756. }
  757. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  758. internal static extern void Node_SetEnabledRecursive (IntPtr handle, bool enable);
  759. /// <summary>
  760. /// Set enabled state on self and child nodes. Unlike SetDeepEnabled this does not remember the nodes' own enabled state, but overwrites it.
  761. /// </summary>
  762. public void SetEnabledRecursive (bool enable)
  763. {
  764. Runtime.ValidateRefCounted (this);
  765. Node_SetEnabledRecursive (handle, enable);
  766. }
  767. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  768. internal static extern void Node_SetOwner (IntPtr handle, IntPtr owner);
  769. /// <summary>
  770. /// Set owner connection for networking.
  771. /// </summary>
  772. private void SetOwner (Connection owner)
  773. {
  774. Runtime.ValidateRefCounted (this);
  775. Node_SetOwner (handle, (object)owner == null ? IntPtr.Zero : owner.Handle);
  776. }
  777. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  778. internal static extern void Node_MarkDirty (IntPtr handle);
  779. /// <summary>
  780. /// Mark node and child nodes to need world transform recalculation. Notify listener components.
  781. /// </summary>
  782. public void MarkDirty ()
  783. {
  784. Runtime.ValidateRefCounted (this);
  785. Node_MarkDirty (handle);
  786. }
  787. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  788. internal static extern IntPtr Node_CreateChild (IntPtr handle, string name, CreateMode mode, uint id, bool temporary);
  789. /// <summary>
  790. /// Create a child scene node (with specified ID if provided).
  791. /// </summary>
  792. public Node CreateChild (string name = "", CreateMode mode = CreateMode.Replicated, uint id = 0, bool temporary = false)
  793. {
  794. Runtime.ValidateRefCounted (this);
  795. return Runtime.LookupObject<Node> (Node_CreateChild (handle, name, mode, id, temporary));
  796. }
  797. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  798. internal static extern IntPtr Node_CreateTemporaryChild (IntPtr handle, string name, CreateMode mode, uint id);
  799. /// <summary>
  800. /// Create a temporary child scene node (with specified ID if provided).
  801. /// </summary>
  802. public Node CreateTemporaryChild (string name = "", CreateMode mode = CreateMode.Replicated, uint id = 0)
  803. {
  804. Runtime.ValidateRefCounted (this);
  805. return Runtime.LookupObject<Node> (Node_CreateTemporaryChild (handle, name, mode, id));
  806. }
  807. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  808. internal static extern void Node_AddChild (IntPtr handle, IntPtr node, uint index);
  809. /// <summary>
  810. /// Add a child scene node at a specific index. If index is not explicitly specified or is greater than current children size, append the new child at the end.
  811. /// </summary>
  812. public void AddChild (Node node, uint index = uint.MaxValue)
  813. {
  814. Runtime.ValidateRefCounted (this);
  815. Node_AddChild (handle, (object)node == null ? IntPtr.Zero : node.Handle, index);
  816. }
  817. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  818. internal static extern void Node_RemoveChild (IntPtr handle, IntPtr node);
  819. /// <summary>
  820. /// Remove a child scene node.
  821. /// </summary>
  822. public void RemoveChild (Node node)
  823. {
  824. Runtime.ValidateRefCounted (this);
  825. Node_RemoveChild (handle, (object)node == null ? IntPtr.Zero : node.Handle);
  826. }
  827. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  828. internal static extern void Node_RemoveAllChildren (IntPtr handle);
  829. /// <summary>
  830. /// Remove all child scene nodes.
  831. /// </summary>
  832. public void RemoveAllChildren ()
  833. {
  834. Runtime.ValidateRefCounted (this);
  835. Node_RemoveAllChildren (handle);
  836. }
  837. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  838. internal static extern void Node_RemoveChildren (IntPtr handle, bool removeReplicated, bool removeLocal, bool recursive);
  839. /// <summary>
  840. /// Remove child scene nodes that match criteria.
  841. /// </summary>
  842. public void RemoveChildren (bool removeReplicated, bool removeLocal, bool recursive)
  843. {
  844. Runtime.ValidateRefCounted (this);
  845. Node_RemoveChildren (handle, removeReplicated, removeLocal, recursive);
  846. }
  847. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  848. internal static extern IntPtr Node_CreateComponent (IntPtr handle, int type, CreateMode mode, uint id);
  849. /// <summary>
  850. /// Create a component to this node (with specified ID if provided).
  851. /// </summary>
  852. public Component CreateComponent (StringHash type, CreateMode mode = CreateMode.Replicated, uint id = 0)
  853. {
  854. Runtime.ValidateRefCounted (this);
  855. return Runtime.LookupObject<Component> (Node_CreateComponent (handle, type.Code, mode, id));
  856. }
  857. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  858. internal static extern IntPtr Node_GetOrCreateComponent (IntPtr handle, int type, CreateMode mode, uint id);
  859. /// <summary>
  860. /// Create a component to this node if it does not exist already.
  861. /// </summary>
  862. public Component GetOrCreateComponent (StringHash type, CreateMode mode = CreateMode.Replicated, uint id = 0)
  863. {
  864. Runtime.ValidateRefCounted (this);
  865. return Runtime.LookupObject<Component> (Node_GetOrCreateComponent (handle, type.Code, mode, id));
  866. }
  867. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  868. internal static extern IntPtr Node_CloneComponent (IntPtr handle, IntPtr component, uint id);
  869. /// <summary>
  870. /// Clone a component from another node using its create mode. Return the clone if successful or null on failure.
  871. /// </summary>
  872. public Component CloneComponent (Component component, uint id = 0)
  873. {
  874. Runtime.ValidateRefCounted (this);
  875. return Runtime.LookupObject<Component> (Node_CloneComponent (handle, (object)component == null ? IntPtr.Zero : component.Handle, id));
  876. }
  877. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  878. internal static extern IntPtr Node_CloneComponent17 (IntPtr handle, IntPtr component, CreateMode mode, uint id);
  879. /// <summary>
  880. /// Clone a component from another node and specify the create mode. Return the clone if successful or null on failure.
  881. /// </summary>
  882. public Component CloneComponent (Component component, CreateMode mode, uint id = 0)
  883. {
  884. Runtime.ValidateRefCounted (this);
  885. return Runtime.LookupObject<Component> (Node_CloneComponent17 (handle, (object)component == null ? IntPtr.Zero : component.Handle, mode, id));
  886. }
  887. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  888. internal static extern void Node_RemoveComponent (IntPtr handle, IntPtr component);
  889. /// <summary>
  890. /// Remove a component from this node.
  891. /// </summary>
  892. public void RemoveComponent (Component component)
  893. {
  894. Runtime.ValidateRefCounted (this);
  895. Node_RemoveComponent (handle, (object)component == null ? IntPtr.Zero : component.Handle);
  896. }
  897. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  898. internal static extern void Node_RemoveComponent18 (IntPtr handle, int type);
  899. /// <summary>
  900. /// Remove the first component of specific type from this node.
  901. /// </summary>
  902. public void RemoveComponent (StringHash type)
  903. {
  904. Runtime.ValidateRefCounted (this);
  905. Node_RemoveComponent18 (handle, type.Code);
  906. }
  907. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  908. internal static extern void Node_RemoveComponents (IntPtr handle, bool removeReplicated, bool removeLocal);
  909. /// <summary>
  910. /// Remove components that match criteria.
  911. /// </summary>
  912. public void RemoveComponents (bool removeReplicated, bool removeLocal)
  913. {
  914. Runtime.ValidateRefCounted (this);
  915. Node_RemoveComponents (handle, removeReplicated, removeLocal);
  916. }
  917. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  918. internal static extern void Node_RemoveComponents19 (IntPtr handle, int type);
  919. /// <summary>
  920. /// Remove all components of specific type.
  921. /// </summary>
  922. public void RemoveComponents (StringHash type)
  923. {
  924. Runtime.ValidateRefCounted (this);
  925. Node_RemoveComponents19 (handle, type.Code);
  926. }
  927. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  928. internal static extern void Node_RemoveAllComponents (IntPtr handle);
  929. /// <summary>
  930. /// Remove all components from this node.
  931. /// </summary>
  932. public void RemoveAllComponents ()
  933. {
  934. Runtime.ValidateRefCounted (this);
  935. Node_RemoveAllComponents (handle);
  936. }
  937. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  938. internal static extern void Node_ReorderComponent (IntPtr handle, IntPtr component, uint index);
  939. /// <summary>
  940. /// Adjust index order of an existing component in this node.
  941. /// </summary>
  942. public void ReorderComponent (Component component, uint index)
  943. {
  944. Runtime.ValidateRefCounted (this);
  945. Node_ReorderComponent (handle, (object)component == null ? IntPtr.Zero : component.Handle, index);
  946. }
  947. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  948. internal static extern IntPtr Node_Clone (IntPtr handle, CreateMode mode);
  949. /// <summary>
  950. /// Clone scene node, components and child nodes. Return the clone.
  951. /// </summary>
  952. public Node Clone (CreateMode mode = CreateMode.Replicated)
  953. {
  954. Runtime.ValidateRefCounted (this);
  955. return Runtime.LookupObject<Node> (Node_Clone (handle, mode));
  956. }
  957. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  958. internal static extern void Node_Remove (IntPtr handle);
  959. /// <summary>
  960. /// Remove from the parent node. If no other shared pointer references exist, causes immediate deletion.
  961. /// </summary>
  962. public void Remove ()
  963. {
  964. Runtime.ValidateRefCounted (this);
  965. Node_Remove (handle);
  966. }
  967. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  968. internal static extern void Node_SetParent (IntPtr handle, IntPtr parent);
  969. /// <summary>
  970. /// Assign to a new parent scene node. Retains the world transform.
  971. /// </summary>
  972. private void SetParent (Node parent)
  973. {
  974. Runtime.ValidateRefCounted (this);
  975. Node_SetParent (handle, (object)parent == null ? IntPtr.Zero : parent.Handle);
  976. }
  977. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  978. internal static extern void Node_SetVar_0 (IntPtr handle, int key, ref Vector3 value);
  979. /// <summary>
  980. /// Set a user variable.
  981. /// </summary>
  982. public void SetVar (StringHash key, Vector3 value)
  983. {
  984. Runtime.ValidateRefCounted (this);
  985. Node_SetVar_0 (handle, key.Code, ref value);
  986. }
  987. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  988. internal static extern void Node_SetVar_1 (IntPtr handle, int key, ref IntRect value);
  989. /// <summary>
  990. /// Set a user variable.
  991. /// </summary>
  992. public void SetVar (StringHash key, IntRect value)
  993. {
  994. Runtime.ValidateRefCounted (this);
  995. Node_SetVar_1 (handle, key.Code, ref value);
  996. }
  997. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  998. internal static extern void Node_SetVar_2 (IntPtr handle, int key, ref Color value);
  999. /// <summary>
  1000. /// Set a user variable.
  1001. /// </summary>
  1002. public void SetVar (StringHash key, Color value)
  1003. {
  1004. Runtime.ValidateRefCounted (this);
  1005. Node_SetVar_2 (handle, key.Code, ref value);
  1006. }
  1007. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1008. internal static extern void Node_SetVar_3 (IntPtr handle, int key, ref Vector2 value);
  1009. /// <summary>
  1010. /// Set a user variable.
  1011. /// </summary>
  1012. public void SetVar (StringHash key, Vector2 value)
  1013. {
  1014. Runtime.ValidateRefCounted (this);
  1015. Node_SetVar_3 (handle, key.Code, ref value);
  1016. }
  1017. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1018. internal static extern void Node_SetVar_4 (IntPtr handle, int key, ref Vector4 value);
  1019. /// <summary>
  1020. /// Set a user variable.
  1021. /// </summary>
  1022. public void SetVar (StringHash key, Vector4 value)
  1023. {
  1024. Runtime.ValidateRefCounted (this);
  1025. Node_SetVar_4 (handle, key.Code, ref value);
  1026. }
  1027. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1028. internal static extern void Node_SetVar_5 (IntPtr handle, int key, ref IntVector2 value);
  1029. /// <summary>
  1030. /// Set a user variable.
  1031. /// </summary>
  1032. public void SetVar (StringHash key, IntVector2 value)
  1033. {
  1034. Runtime.ValidateRefCounted (this);
  1035. Node_SetVar_5 (handle, key.Code, ref value);
  1036. }
  1037. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1038. internal static extern void Node_SetVar_6 (IntPtr handle, int key, ref Quaternion value);
  1039. /// <summary>
  1040. /// Set a user variable.
  1041. /// </summary>
  1042. public void SetVar (StringHash key, Quaternion value)
  1043. {
  1044. Runtime.ValidateRefCounted (this);
  1045. Node_SetVar_6 (handle, key.Code, ref value);
  1046. }
  1047. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1048. internal static extern void Node_SetVar_7 (IntPtr handle, int key, ref Matrix4 value);
  1049. /// <summary>
  1050. /// Set a user variable.
  1051. /// </summary>
  1052. public void SetVar (StringHash key, Matrix4 value)
  1053. {
  1054. Runtime.ValidateRefCounted (this);
  1055. Node_SetVar_7 (handle, key.Code, ref value);
  1056. }
  1057. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1058. internal static extern void Node_SetVar_8 (IntPtr handle, int key, ref Matrix3x4 value);
  1059. /// <summary>
  1060. /// Set a user variable.
  1061. /// </summary>
  1062. public void SetVar (StringHash key, Matrix3x4 value)
  1063. {
  1064. Runtime.ValidateRefCounted (this);
  1065. Node_SetVar_8 (handle, key.Code, ref value);
  1066. }
  1067. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1068. internal static extern void Node_SetVar_9 (IntPtr handle, int key, int value);
  1069. /// <summary>
  1070. /// Set a user variable.
  1071. /// </summary>
  1072. public void SetVar (StringHash key, int value)
  1073. {
  1074. Runtime.ValidateRefCounted (this);
  1075. Node_SetVar_9 (handle, key.Code, value);
  1076. }
  1077. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1078. internal static extern void Node_SetVar_10 (IntPtr handle, int key, float value);
  1079. /// <summary>
  1080. /// Set a user variable.
  1081. /// </summary>
  1082. public void SetVar (StringHash key, float value)
  1083. {
  1084. Runtime.ValidateRefCounted (this);
  1085. Node_SetVar_10 (handle, key.Code, value);
  1086. }
  1087. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1088. internal static extern void Node_SetVar_11 (IntPtr handle, int key, string value);
  1089. /// <summary>
  1090. /// Set a user variable.
  1091. /// </summary>
  1092. public void SetVar (StringHash key, string value)
  1093. {
  1094. Runtime.ValidateRefCounted (this);
  1095. Node_SetVar_11 (handle, key.Code, value);
  1096. }
  1097. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1098. internal static extern void Node_SetVar_12 (IntPtr handle, int key, bool value);
  1099. /// <summary>
  1100. /// Set a user variable.
  1101. /// </summary>
  1102. public void SetVar (StringHash key, bool value)
  1103. {
  1104. Runtime.ValidateRefCounted (this);
  1105. Node_SetVar_12 (handle, key.Code, value);
  1106. }
  1107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1108. internal static extern void Node_AddListener (IntPtr handle, IntPtr component);
  1109. /// <summary>
  1110. /// Add listener component that is notified of node being dirtied. Can either be in the same node or another.
  1111. /// </summary>
  1112. public void AddListener (Component component)
  1113. {
  1114. Runtime.ValidateRefCounted (this);
  1115. Node_AddListener (handle, (object)component == null ? IntPtr.Zero : component.Handle);
  1116. }
  1117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1118. internal static extern void Node_RemoveListener (IntPtr handle, IntPtr component);
  1119. /// <summary>
  1120. /// Remove listener component.
  1121. /// </summary>
  1122. public void RemoveListener (Component component)
  1123. {
  1124. Runtime.ValidateRefCounted (this);
  1125. Node_RemoveListener (handle, (object)component == null ? IntPtr.Zero : component.Handle);
  1126. }
  1127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1128. internal static extern uint Node_GetID (IntPtr handle);
  1129. /// <summary>
  1130. /// Return ID.
  1131. /// </summary>
  1132. private uint GetID ()
  1133. {
  1134. Runtime.ValidateRefCounted (this);
  1135. return Node_GetID (handle);
  1136. }
  1137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1138. internal static extern IntPtr Node_GetName (IntPtr handle);
  1139. /// <summary>
  1140. /// Return name.
  1141. /// </summary>
  1142. private string GetName ()
  1143. {
  1144. Runtime.ValidateRefCounted (this);
  1145. return Marshal.PtrToStringAnsi (Node_GetName (handle));
  1146. }
  1147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1148. internal static extern int Node_GetNameHash (IntPtr handle);
  1149. /// <summary>
  1150. /// Return name hash.
  1151. /// </summary>
  1152. private StringHash GetNameHash ()
  1153. {
  1154. Runtime.ValidateRefCounted (this);
  1155. return new StringHash (Node_GetNameHash (handle));
  1156. }
  1157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1158. internal static extern bool Node_HasTag (IntPtr handle, string tag);
  1159. /// <summary>
  1160. /// Return whether has a specific tag.
  1161. /// </summary>
  1162. public bool HasTag (string tag)
  1163. {
  1164. Runtime.ValidateRefCounted (this);
  1165. return Node_HasTag (handle, tag);
  1166. }
  1167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1168. internal static extern IntPtr Node_GetParent (IntPtr handle);
  1169. /// <summary>
  1170. /// Return parent scene node.
  1171. /// </summary>
  1172. private Node GetParent ()
  1173. {
  1174. Runtime.ValidateRefCounted (this);
  1175. return Runtime.LookupObject<Node> (Node_GetParent (handle));
  1176. }
  1177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1178. internal static extern IntPtr Node_GetScene (IntPtr handle);
  1179. /// <summary>
  1180. /// Return scene.
  1181. /// </summary>
  1182. private Scene GetScene ()
  1183. {
  1184. Runtime.ValidateRefCounted (this);
  1185. return Runtime.LookupObject<Scene> (Node_GetScene (handle));
  1186. }
  1187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1188. internal static extern bool Node_IsChildOf (IntPtr handle, IntPtr node);
  1189. /// <summary>
  1190. /// Return whether is a direct or indirect child of specified node.
  1191. /// </summary>
  1192. public bool IsChildOf (Node node)
  1193. {
  1194. Runtime.ValidateRefCounted (this);
  1195. return Node_IsChildOf (handle, (object)node == null ? IntPtr.Zero : node.Handle);
  1196. }
  1197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1198. internal static extern bool Node_IsEnabled (IntPtr handle);
  1199. /// <summary>
  1200. /// Return whether is enabled. Disables nodes effectively disable all their components.
  1201. /// </summary>
  1202. private bool IsEnabled ()
  1203. {
  1204. Runtime.ValidateRefCounted (this);
  1205. return Node_IsEnabled (handle);
  1206. }
  1207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1208. internal static extern bool Node_IsEnabledSelf (IntPtr handle);
  1209. /// <summary>
  1210. /// Return the node's last own enabled state. May be different than the value returned by IsEnabled when SetDeepEnabled has been used.
  1211. /// </summary>
  1212. private bool IsEnabledSelf ()
  1213. {
  1214. Runtime.ValidateRefCounted (this);
  1215. return Node_IsEnabledSelf (handle);
  1216. }
  1217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1218. internal static extern IntPtr Node_GetOwner (IntPtr handle);
  1219. /// <summary>
  1220. /// Return owner connection in networking.
  1221. /// </summary>
  1222. private Connection GetOwner ()
  1223. {
  1224. Runtime.ValidateRefCounted (this);
  1225. return Runtime.LookupObject<Connection> (Node_GetOwner (handle));
  1226. }
  1227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1228. internal static extern Urho.Vector3 Node_GetPosition (IntPtr handle);
  1229. /// <summary>
  1230. /// Return position in parent space.
  1231. /// </summary>
  1232. private Urho.Vector3 GetPosition ()
  1233. {
  1234. Runtime.ValidateRefCounted (this);
  1235. return Node_GetPosition (handle);
  1236. }
  1237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1238. internal static extern Vector2 Node_GetPosition2D (IntPtr handle);
  1239. /// <summary>
  1240. /// Return position in parent space (for Urho2D).
  1241. /// </summary>
  1242. private Vector2 GetPosition2D ()
  1243. {
  1244. Runtime.ValidateRefCounted (this);
  1245. return Node_GetPosition2D (handle);
  1246. }
  1247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1248. internal static extern Urho.Quaternion Node_GetRotation (IntPtr handle);
  1249. /// <summary>
  1250. /// Return rotation in parent space.
  1251. /// </summary>
  1252. private Urho.Quaternion GetRotation ()
  1253. {
  1254. Runtime.ValidateRefCounted (this);
  1255. return Node_GetRotation (handle);
  1256. }
  1257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1258. internal static extern float Node_GetRotation2D (IntPtr handle);
  1259. /// <summary>
  1260. /// Return rotation in parent space (for Urho2D).
  1261. /// </summary>
  1262. private float GetRotation2D ()
  1263. {
  1264. Runtime.ValidateRefCounted (this);
  1265. return Node_GetRotation2D (handle);
  1266. }
  1267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1268. internal static extern Vector3 Node_GetDirection (IntPtr handle);
  1269. /// <summary>
  1270. /// Return forward direction in parent space. Positive Z axis equals identity rotation.
  1271. /// </summary>
  1272. private Vector3 GetDirection ()
  1273. {
  1274. Runtime.ValidateRefCounted (this);
  1275. return Node_GetDirection (handle);
  1276. }
  1277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1278. internal static extern Vector3 Node_GetUp (IntPtr handle);
  1279. /// <summary>
  1280. /// Return up direction in parent space. Positive Y axis equals identity rotation.
  1281. /// </summary>
  1282. private Vector3 GetUp ()
  1283. {
  1284. Runtime.ValidateRefCounted (this);
  1285. return Node_GetUp (handle);
  1286. }
  1287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1288. internal static extern Vector3 Node_GetRight (IntPtr handle);
  1289. /// <summary>
  1290. /// Return right direction in parent space. Positive X axis equals identity rotation.
  1291. /// </summary>
  1292. private Vector3 GetRight ()
  1293. {
  1294. Runtime.ValidateRefCounted (this);
  1295. return Node_GetRight (handle);
  1296. }
  1297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1298. internal static extern Urho.Vector3 Node_GetScale (IntPtr handle);
  1299. /// <summary>
  1300. /// Return scale in parent space.
  1301. /// </summary>
  1302. private Urho.Vector3 GetScale ()
  1303. {
  1304. Runtime.ValidateRefCounted (this);
  1305. return Node_GetScale (handle);
  1306. }
  1307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1308. internal static extern Vector2 Node_GetScale2D (IntPtr handle);
  1309. /// <summary>
  1310. /// Return scale in parent space (for Urho2D).
  1311. /// </summary>
  1312. private Vector2 GetScale2D ()
  1313. {
  1314. Runtime.ValidateRefCounted (this);
  1315. return Node_GetScale2D (handle);
  1316. }
  1317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1318. internal static extern Matrix3x4 Node_GetTransform (IntPtr handle);
  1319. /// <summary>
  1320. /// Return parent space transform matrix.
  1321. /// </summary>
  1322. private Matrix3x4 GetTransform ()
  1323. {
  1324. Runtime.ValidateRefCounted (this);
  1325. return Node_GetTransform (handle);
  1326. }
  1327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1328. internal static extern Vector3 Node_GetWorldPosition (IntPtr handle);
  1329. /// <summary>
  1330. /// Return position in world space.
  1331. /// </summary>
  1332. private Vector3 GetWorldPosition ()
  1333. {
  1334. Runtime.ValidateRefCounted (this);
  1335. return Node_GetWorldPosition (handle);
  1336. }
  1337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1338. internal static extern Vector2 Node_GetWorldPosition2D (IntPtr handle);
  1339. /// <summary>
  1340. /// Return position in world space (for Urho2D).
  1341. /// </summary>
  1342. private Vector2 GetWorldPosition2D ()
  1343. {
  1344. Runtime.ValidateRefCounted (this);
  1345. return Node_GetWorldPosition2D (handle);
  1346. }
  1347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1348. internal static extern Quaternion Node_GetWorldRotation (IntPtr handle);
  1349. /// <summary>
  1350. /// Return rotation in world space.
  1351. /// </summary>
  1352. private Quaternion GetWorldRotation ()
  1353. {
  1354. Runtime.ValidateRefCounted (this);
  1355. return Node_GetWorldRotation (handle);
  1356. }
  1357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1358. internal static extern float Node_GetWorldRotation2D (IntPtr handle);
  1359. /// <summary>
  1360. /// Return rotation in world space (for Urho2D).
  1361. /// </summary>
  1362. private float GetWorldRotation2D ()
  1363. {
  1364. Runtime.ValidateRefCounted (this);
  1365. return Node_GetWorldRotation2D (handle);
  1366. }
  1367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1368. internal static extern Vector3 Node_GetWorldDirection (IntPtr handle);
  1369. /// <summary>
  1370. /// Return direction in world space.
  1371. /// </summary>
  1372. private Vector3 GetWorldDirection ()
  1373. {
  1374. Runtime.ValidateRefCounted (this);
  1375. return Node_GetWorldDirection (handle);
  1376. }
  1377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1378. internal static extern Vector3 Node_GetWorldUp (IntPtr handle);
  1379. /// <summary>
  1380. /// Return node's up vector in world space.
  1381. /// </summary>
  1382. private Vector3 GetWorldUp ()
  1383. {
  1384. Runtime.ValidateRefCounted (this);
  1385. return Node_GetWorldUp (handle);
  1386. }
  1387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1388. internal static extern Vector3 Node_GetWorldRight (IntPtr handle);
  1389. /// <summary>
  1390. /// Return node's right vector in world space.
  1391. /// </summary>
  1392. private Vector3 GetWorldRight ()
  1393. {
  1394. Runtime.ValidateRefCounted (this);
  1395. return Node_GetWorldRight (handle);
  1396. }
  1397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1398. internal static extern Vector3 Node_GetWorldScale (IntPtr handle);
  1399. /// <summary>
  1400. /// Return scale in world space.
  1401. /// </summary>
  1402. private Vector3 GetWorldScale ()
  1403. {
  1404. Runtime.ValidateRefCounted (this);
  1405. return Node_GetWorldScale (handle);
  1406. }
  1407. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1408. internal static extern Vector3 Node_GetSignedWorldScale (IntPtr handle);
  1409. /// <summary>
  1410. /// Return signed scale in world space. Utilized for Urho2D physics.
  1411. /// </summary>
  1412. private Vector3 GetSignedWorldScale ()
  1413. {
  1414. Runtime.ValidateRefCounted (this);
  1415. return Node_GetSignedWorldScale (handle);
  1416. }
  1417. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1418. internal static extern Vector2 Node_GetWorldScale2D (IntPtr handle);
  1419. /// <summary>
  1420. /// Return scale in world space (for Urho2D).
  1421. /// </summary>
  1422. private Vector2 GetWorldScale2D ()
  1423. {
  1424. Runtime.ValidateRefCounted (this);
  1425. return Node_GetWorldScale2D (handle);
  1426. }
  1427. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1428. internal static extern Urho.Matrix3x4 Node_GetWorldTransform (IntPtr handle);
  1429. /// <summary>
  1430. /// Return world space transform matrix.
  1431. /// </summary>
  1432. private Urho.Matrix3x4 GetWorldTransform ()
  1433. {
  1434. Runtime.ValidateRefCounted (this);
  1435. return Node_GetWorldTransform (handle);
  1436. }
  1437. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1438. internal static extern Vector3 Node_LocalToWorld (IntPtr handle, ref Urho.Vector3 position);
  1439. /// <summary>
  1440. /// Convert a local space position to world space.
  1441. /// </summary>
  1442. public Vector3 LocalToWorld (Urho.Vector3 position)
  1443. {
  1444. Runtime.ValidateRefCounted (this);
  1445. return Node_LocalToWorld (handle, ref position);
  1446. }
  1447. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1448. internal static extern Vector3 Node_LocalToWorld20 (IntPtr handle, ref Urho.Vector4 vector);
  1449. /// <summary>
  1450. /// Convert a local space position or rotation to world space.
  1451. /// </summary>
  1452. public Vector3 LocalToWorld (Urho.Vector4 vector)
  1453. {
  1454. Runtime.ValidateRefCounted (this);
  1455. return Node_LocalToWorld20 (handle, ref vector);
  1456. }
  1457. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1458. internal static extern Vector2 Node_LocalToWorld2D (IntPtr handle, ref Urho.Vector2 vector);
  1459. /// <summary>
  1460. /// Convert a local space position or rotation to world space (for Urho2D).
  1461. /// </summary>
  1462. public Vector2 LocalToWorld2D (Urho.Vector2 vector)
  1463. {
  1464. Runtime.ValidateRefCounted (this);
  1465. return Node_LocalToWorld2D (handle, ref vector);
  1466. }
  1467. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1468. internal static extern Vector3 Node_WorldToLocal (IntPtr handle, ref Urho.Vector3 position);
  1469. /// <summary>
  1470. /// Convert a world space position to local space.
  1471. /// </summary>
  1472. public Vector3 WorldToLocal (Urho.Vector3 position)
  1473. {
  1474. Runtime.ValidateRefCounted (this);
  1475. return Node_WorldToLocal (handle, ref position);
  1476. }
  1477. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1478. internal static extern Vector3 Node_WorldToLocal21 (IntPtr handle, ref Urho.Vector4 vector);
  1479. /// <summary>
  1480. /// Convert a world space position or rotation to local space.
  1481. /// </summary>
  1482. public Vector3 WorldToLocal (Urho.Vector4 vector)
  1483. {
  1484. Runtime.ValidateRefCounted (this);
  1485. return Node_WorldToLocal21 (handle, ref vector);
  1486. }
  1487. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1488. internal static extern Vector2 Node_WorldToLocal2D (IntPtr handle, ref Urho.Vector2 vector);
  1489. /// <summary>
  1490. /// Convert a world space position or rotation to local space (for Urho2D).
  1491. /// </summary>
  1492. public Vector2 WorldToLocal2D (Urho.Vector2 vector)
  1493. {
  1494. Runtime.ValidateRefCounted (this);
  1495. return Node_WorldToLocal2D (handle, ref vector);
  1496. }
  1497. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1498. internal static extern bool Node_IsDirty (IntPtr handle);
  1499. /// <summary>
  1500. /// Return whether transform has changed and world transform needs recalculation.
  1501. /// </summary>
  1502. private bool IsDirty ()
  1503. {
  1504. Runtime.ValidateRefCounted (this);
  1505. return Node_IsDirty (handle);
  1506. }
  1507. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1508. internal static extern uint Node_GetNumChildren (IntPtr handle, bool recursive);
  1509. /// <summary>
  1510. /// Return number of child scene nodes.
  1511. /// </summary>
  1512. public uint GetNumChildren (bool recursive = false)
  1513. {
  1514. Runtime.ValidateRefCounted (this);
  1515. return Node_GetNumChildren (handle, recursive);
  1516. }
  1517. private IReadOnlyList<Node> _GetChildren_cache;
  1518. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1519. internal static extern IntPtr Node_GetChildren (IntPtr handle);
  1520. /// <summary>
  1521. /// Return immediate child scene nodes.
  1522. /// </summary>
  1523. private IReadOnlyList<Node> GetChildren ()
  1524. {
  1525. Runtime.ValidateRefCounted (this);
  1526. return _GetChildren_cache != null ? _GetChildren_cache : _GetChildren_cache = Runtime.CreateVectorSharedPtrProxy<Node> (Node_GetChildren (handle));
  1527. }
  1528. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1529. internal static extern IntPtr Node_GetChild (IntPtr handle, uint index);
  1530. /// <summary>
  1531. /// Return child scene node by index.
  1532. /// </summary>
  1533. public Node GetChild (uint index)
  1534. {
  1535. Runtime.ValidateRefCounted (this);
  1536. return Runtime.LookupObject<Node> (Node_GetChild (handle, index));
  1537. }
  1538. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1539. internal static extern IntPtr Node_GetChild22 (IntPtr handle, string name, bool recursive);
  1540. /// <summary>
  1541. /// Return child scene node by name.
  1542. /// </summary>
  1543. public Node GetChild (string name, bool recursive = false)
  1544. {
  1545. Runtime.ValidateRefCounted (this);
  1546. return Runtime.LookupObject<Node> (Node_GetChild22 (handle, name, recursive));
  1547. }
  1548. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1549. internal static extern IntPtr Node_GetChild23 (IntPtr handle, int nameHash, bool recursive);
  1550. /// <summary>
  1551. /// Return child scene node by name hash.
  1552. /// </summary>
  1553. public Node GetChild (StringHash nameHash, bool recursive = false)
  1554. {
  1555. Runtime.ValidateRefCounted (this);
  1556. return Runtime.LookupObject<Node> (Node_GetChild23 (handle, nameHash.Code, recursive));
  1557. }
  1558. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1559. internal static extern uint Node_GetNumComponents (IntPtr handle);
  1560. /// <summary>
  1561. /// Return number of components.
  1562. /// </summary>
  1563. private uint GetNumComponents ()
  1564. {
  1565. Runtime.ValidateRefCounted (this);
  1566. return Node_GetNumComponents (handle);
  1567. }
  1568. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1569. internal static extern uint Node_GetNumNetworkComponents (IntPtr handle);
  1570. /// <summary>
  1571. /// Return number of non-local components.
  1572. /// </summary>
  1573. private uint GetNumNetworkComponents ()
  1574. {
  1575. Runtime.ValidateRefCounted (this);
  1576. return Node_GetNumNetworkComponents (handle);
  1577. }
  1578. private IReadOnlyList<Component> _GetComponents_cache;
  1579. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1580. internal static extern IntPtr Node_GetComponents (IntPtr handle);
  1581. /// <summary>
  1582. /// Return all components.
  1583. /// </summary>
  1584. private IReadOnlyList<Component> GetComponents ()
  1585. {
  1586. Runtime.ValidateRefCounted (this);
  1587. return _GetComponents_cache != null ? _GetComponents_cache : _GetComponents_cache = Runtime.CreateVectorSharedPtrProxy<Component> (Node_GetComponents (handle));
  1588. }
  1589. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1590. internal static extern IntPtr Node_GetComponent (IntPtr handle, int type, bool recursive);
  1591. /// <summary>
  1592. /// Return component by type. If there are several, returns the first.
  1593. /// </summary>
  1594. public Component GetComponent (StringHash type, bool recursive = false)
  1595. {
  1596. Runtime.ValidateRefCounted (this);
  1597. return Runtime.LookupObject<Component> (Node_GetComponent (handle, type.Code, recursive));
  1598. }
  1599. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1600. internal static extern IntPtr Node_GetParentComponent (IntPtr handle, int type, bool fullTraversal);
  1601. /// <summary>
  1602. /// Return component in parent node. If there are several, returns the first. May optional traverse up to the root node.
  1603. /// </summary>
  1604. public Component GetParentComponent (StringHash type, bool fullTraversal = false)
  1605. {
  1606. Runtime.ValidateRefCounted (this);
  1607. return Runtime.LookupObject<Component> (Node_GetParentComponent (handle, type.Code, fullTraversal));
  1608. }
  1609. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1610. internal static extern bool Node_HasComponent (IntPtr handle, int type);
  1611. /// <summary>
  1612. /// Return whether has a specific component.
  1613. /// </summary>
  1614. public bool HasComponent (StringHash type)
  1615. {
  1616. Runtime.ValidateRefCounted (this);
  1617. return Node_HasComponent (handle, type.Code);
  1618. }
  1619. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1620. internal static extern void Node_SetID (IntPtr handle, uint id);
  1621. /// <summary>
  1622. /// Set ID. Called by Scene.
  1623. /// </summary>
  1624. private void SetID (uint id)
  1625. {
  1626. Runtime.ValidateRefCounted (this);
  1627. Node_SetID (handle, id);
  1628. }
  1629. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1630. internal static extern void Node_SetScene (IntPtr handle, IntPtr scene);
  1631. /// <summary>
  1632. /// Set scene. Called by Scene.
  1633. /// </summary>
  1634. private void SetScene (Scene scene)
  1635. {
  1636. Runtime.ValidateRefCounted (this);
  1637. Node_SetScene (handle, (object)scene == null ? IntPtr.Zero : scene.Handle);
  1638. }
  1639. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1640. internal static extern void Node_ResetScene (IntPtr handle);
  1641. /// <summary>
  1642. /// Reset scene, ID and owner. Called by Scene.
  1643. /// </summary>
  1644. public void ResetScene ()
  1645. {
  1646. Runtime.ValidateRefCounted (this);
  1647. Node_ResetScene (handle);
  1648. }
  1649. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1650. internal static extern void Node_SetNetPositionAttr (IntPtr handle, ref Urho.Vector3 value);
  1651. /// <summary>
  1652. /// Set network position attribute.
  1653. /// </summary>
  1654. private void SetNetPositionAttr (Urho.Vector3 value)
  1655. {
  1656. Runtime.ValidateRefCounted (this);
  1657. Node_SetNetPositionAttr (handle, ref value);
  1658. }
  1659. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1660. internal static extern Urho.Vector3 Node_GetNetPositionAttr (IntPtr handle);
  1661. /// <summary>
  1662. /// Return network position attribute.
  1663. /// </summary>
  1664. private Urho.Vector3 GetNetPositionAttr ()
  1665. {
  1666. Runtime.ValidateRefCounted (this);
  1667. return Node_GetNetPositionAttr (handle);
  1668. }
  1669. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1670. internal static extern void Node_PrepareNetworkUpdate (IntPtr handle);
  1671. /// <summary>
  1672. /// Prepare network update by comparing attributes and marking replication states dirty as necessary.
  1673. /// </summary>
  1674. public virtual void PrepareNetworkUpdate ()
  1675. {
  1676. Runtime.ValidateRefCounted (this);
  1677. Node_PrepareNetworkUpdate (handle);
  1678. }
  1679. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1680. internal static extern void Node_CleanupConnection (IntPtr handle, IntPtr connection);
  1681. /// <summary>
  1682. /// Clean up all references to a network connection that is about to be removed.
  1683. /// </summary>
  1684. public virtual void CleanupConnection (Connection connection)
  1685. {
  1686. Runtime.ValidateRefCounted (this);
  1687. Node_CleanupConnection (handle, (object)connection == null ? IntPtr.Zero : connection.Handle);
  1688. }
  1689. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1690. internal static extern void Node_MarkReplicationDirty (IntPtr handle);
  1691. /// <summary>
  1692. /// Mark node dirty in scene replication states.
  1693. /// </summary>
  1694. public void MarkReplicationDirty ()
  1695. {
  1696. Runtime.ValidateRefCounted (this);
  1697. Node_MarkReplicationDirty (handle);
  1698. }
  1699. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1700. internal static extern IntPtr Node_CreateChild24 (IntPtr handle, uint id, CreateMode mode, bool temporary);
  1701. /// <summary>
  1702. /// Create a child node with specific ID.
  1703. /// </summary>
  1704. public Node CreateChild (uint id, CreateMode mode, bool temporary = false)
  1705. {
  1706. Runtime.ValidateRefCounted (this);
  1707. return Runtime.LookupObject<Node> (Node_CreateChild24 (handle, id, mode, temporary));
  1708. }
  1709. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1710. internal static extern void Node_AddComponent (IntPtr handle, IntPtr component, uint id, CreateMode mode);
  1711. /// <summary>
  1712. /// Add a pre-created component. Using this function from application code is discouraged, as component operation without an owner node may not be well-defined in all cases. Prefer CreateComponent() instead.
  1713. /// </summary>
  1714. public void AddComponent (Component component, uint id, CreateMode mode)
  1715. {
  1716. Runtime.ValidateRefCounted (this);
  1717. Node_AddComponent (handle, (object)component == null ? IntPtr.Zero : component.Handle, id, mode);
  1718. }
  1719. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1720. internal static extern uint Node_GetNumPersistentChildren (IntPtr handle);
  1721. /// <summary>
  1722. /// Calculate number of non-temporary child nodes.
  1723. /// </summary>
  1724. private uint GetNumPersistentChildren ()
  1725. {
  1726. Runtime.ValidateRefCounted (this);
  1727. return Node_GetNumPersistentChildren (handle);
  1728. }
  1729. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1730. internal static extern uint Node_GetNumPersistentComponents (IntPtr handle);
  1731. /// <summary>
  1732. /// Calculate number of non-temporary components.
  1733. /// </summary>
  1734. private uint GetNumPersistentComponents ()
  1735. {
  1736. Runtime.ValidateRefCounted (this);
  1737. return Node_GetNumPersistentComponents (handle);
  1738. }
  1739. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1740. internal static extern void Node_SetPositionSilent (IntPtr handle, ref Urho.Vector3 position);
  1741. /// <summary>
  1742. /// Set position in parent space silently without marking the node
  1743. /// &
  1744. /// child nodes dirty. Used by animation code.
  1745. /// </summary>
  1746. public void SetPositionSilent (Urho.Vector3 position)
  1747. {
  1748. Runtime.ValidateRefCounted (this);
  1749. Node_SetPositionSilent (handle, ref position);
  1750. }
  1751. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1752. internal static extern void Node_SetRotationSilent (IntPtr handle, ref Urho.Quaternion rotation);
  1753. /// <summary>
  1754. /// Set position in parent space silently without marking the node
  1755. /// &
  1756. /// child nodes dirty. Used by animation code.
  1757. /// </summary>
  1758. public void SetRotationSilent (Urho.Quaternion rotation)
  1759. {
  1760. Runtime.ValidateRefCounted (this);
  1761. Node_SetRotationSilent (handle, ref rotation);
  1762. }
  1763. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1764. internal static extern void Node_SetScaleSilent (IntPtr handle, ref Urho.Vector3 scale);
  1765. /// <summary>
  1766. /// Set scale in parent space silently without marking the node
  1767. /// &
  1768. /// child nodes dirty. Used by animation code.
  1769. /// </summary>
  1770. public void SetScaleSilent (Urho.Vector3 scale)
  1771. {
  1772. Runtime.ValidateRefCounted (this);
  1773. Node_SetScaleSilent (handle, ref scale);
  1774. }
  1775. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1776. internal static extern void Node_SetTransformSilent (IntPtr handle, ref Urho.Vector3 position, ref Urho.Quaternion rotation, ref Urho.Vector3 scale);
  1777. /// <summary>
  1778. /// Set local transform silently without marking the node
  1779. /// &
  1780. /// child nodes dirty. Used by animation code.
  1781. /// </summary>
  1782. public void SetTransformSilent (Urho.Vector3 position, Urho.Quaternion rotation, Urho.Vector3 scale)
  1783. {
  1784. Runtime.ValidateRefCounted (this);
  1785. Node_SetTransformSilent (handle, ref position, ref rotation, ref scale);
  1786. }
  1787. public override StringHash Type {
  1788. get {
  1789. return GetType ();
  1790. }
  1791. }
  1792. public override string TypeName {
  1793. get {
  1794. return GetTypeName ();
  1795. }
  1796. }
  1797. [Preserve]
  1798. public new static StringHash TypeStatic {
  1799. get {
  1800. return GetTypeStatic ();
  1801. }
  1802. }
  1803. public new static string TypeNameStatic {
  1804. get {
  1805. return GetTypeNameStatic ();
  1806. }
  1807. }
  1808. /// <summary>
  1809. /// Return name.
  1810. /// Or
  1811. /// Set name of the scene node. Names are not required to be unique.
  1812. /// </summary>
  1813. public string Name {
  1814. get {
  1815. return GetName ();
  1816. }
  1817. set {
  1818. SetName (value);
  1819. }
  1820. }
  1821. /// <summary>
  1822. /// Return position in parent space.
  1823. /// Or
  1824. /// Set position in parent space. If the scene node is on the root level (is child of the scene itself), this is same as world space.
  1825. /// </summary>
  1826. public Urho.Vector3 Position {
  1827. get {
  1828. return GetPosition ();
  1829. }
  1830. set {
  1831. SetPosition (value);
  1832. }
  1833. }
  1834. /// <summary>
  1835. /// Return position in parent space (for Urho2D).
  1836. /// </summary>
  1837. public Vector2 Position2D {
  1838. get {
  1839. return GetPosition2D ();
  1840. }
  1841. }
  1842. /// <summary>
  1843. /// Return rotation in parent space.
  1844. /// Or
  1845. /// Set rotation in parent space.
  1846. /// </summary>
  1847. public Urho.Quaternion Rotation {
  1848. get {
  1849. return GetRotation ();
  1850. }
  1851. set {
  1852. SetRotation (value);
  1853. }
  1854. }
  1855. /// <summary>
  1856. /// Return rotation in parent space (for Urho2D).
  1857. /// Or
  1858. /// Set rotation in parent space (for Urho2D).
  1859. /// </summary>
  1860. public float Rotation2D {
  1861. get {
  1862. return GetRotation2D ();
  1863. }
  1864. set {
  1865. SetRotation2D (value);
  1866. }
  1867. }
  1868. /// <summary>
  1869. /// Return forward direction in parent space. Positive Z axis equals identity rotation.
  1870. /// </summary>
  1871. public Vector3 Direction {
  1872. get {
  1873. return GetDirection ();
  1874. }
  1875. }
  1876. /// <summary>
  1877. /// Return scale in parent space.
  1878. /// Or
  1879. /// Set scale in parent space.
  1880. /// </summary>
  1881. public Urho.Vector3 Scale {
  1882. get {
  1883. return GetScale ();
  1884. }
  1885. set {
  1886. SetScale (value);
  1887. }
  1888. }
  1889. /// <summary>
  1890. /// Return scale in parent space (for Urho2D).
  1891. /// </summary>
  1892. public Vector2 Scale2D {
  1893. get {
  1894. return GetScale2D ();
  1895. }
  1896. }
  1897. /// <summary>
  1898. /// Return parent space transform matrix.
  1899. /// </summary>
  1900. public Matrix3x4 Transform {
  1901. get {
  1902. return GetTransform ();
  1903. }
  1904. }
  1905. /// <summary>
  1906. /// Return position in world space.
  1907. /// </summary>
  1908. public Vector3 WorldPosition {
  1909. get {
  1910. return GetWorldPosition ();
  1911. }
  1912. }
  1913. /// <summary>
  1914. /// Return position in world space (for Urho2D).
  1915. /// </summary>
  1916. public Vector2 WorldPosition2D {
  1917. get {
  1918. return GetWorldPosition2D ();
  1919. }
  1920. }
  1921. /// <summary>
  1922. /// Return rotation in world space.
  1923. /// </summary>
  1924. public Quaternion WorldRotation {
  1925. get {
  1926. return GetWorldRotation ();
  1927. }
  1928. }
  1929. /// <summary>
  1930. /// Return rotation in world space (for Urho2D).
  1931. /// Or
  1932. /// Set rotation in world space (for Urho2D).
  1933. /// </summary>
  1934. public float WorldRotation2D {
  1935. get {
  1936. return GetWorldRotation2D ();
  1937. }
  1938. set {
  1939. SetWorldRotation2D (value);
  1940. }
  1941. }
  1942. /// <summary>
  1943. /// Return direction in world space.
  1944. /// </summary>
  1945. public Vector3 WorldDirection {
  1946. get {
  1947. return GetWorldDirection ();
  1948. }
  1949. }
  1950. /// <summary>
  1951. /// Return scale in world space.
  1952. /// </summary>
  1953. public Vector3 WorldScale {
  1954. get {
  1955. return GetWorldScale ();
  1956. }
  1957. }
  1958. /// <summary>
  1959. /// Return scale in world space (for Urho2D).
  1960. /// </summary>
  1961. public Vector2 WorldScale2D {
  1962. get {
  1963. return GetWorldScale2D ();
  1964. }
  1965. }
  1966. /// <summary>
  1967. /// Return whether is enabled. Disables nodes effectively disable all their components.
  1968. /// Or
  1969. /// Set enabled/disabled state without recursion. Components in a disabled node become effectively disabled regardless of their own enable/disable state.
  1970. /// </summary>
  1971. public bool Enabled {
  1972. get {
  1973. return IsEnabled ();
  1974. }
  1975. set {
  1976. SetEnabled (value);
  1977. }
  1978. }
  1979. /// <summary>
  1980. /// Return owner connection in networking.
  1981. /// Or
  1982. /// Set owner connection for networking.
  1983. /// </summary>
  1984. public Connection Owner {
  1985. get {
  1986. return GetOwner ();
  1987. }
  1988. set {
  1989. SetOwner (value);
  1990. }
  1991. }
  1992. /// <summary>
  1993. /// Return parent scene node.
  1994. /// Or
  1995. /// Assign to a new parent scene node. Retains the world transform.
  1996. /// </summary>
  1997. public Node Parent {
  1998. get {
  1999. return GetParent ();
  2000. }
  2001. set {
  2002. SetParent (value);
  2003. }
  2004. }
  2005. /// <summary>
  2006. /// Return ID.
  2007. /// Or
  2008. /// Set ID. Called by Scene.
  2009. /// </summary>
  2010. public uint ID {
  2011. get {
  2012. return GetID ();
  2013. }
  2014. set {
  2015. SetID (value);
  2016. }
  2017. }
  2018. /// <summary>
  2019. /// Return name hash.
  2020. /// </summary>
  2021. public StringHash NameHash {
  2022. get {
  2023. return GetNameHash ();
  2024. }
  2025. }
  2026. /// <summary>
  2027. /// Return scene.
  2028. /// Or
  2029. /// Set scene. Called by Scene.
  2030. /// </summary>
  2031. public Scene Scene {
  2032. get {
  2033. return GetScene ();
  2034. }
  2035. set {
  2036. SetScene (value);
  2037. }
  2038. }
  2039. /// <summary>
  2040. /// Return the node's last own enabled state. May be different than the value returned by IsEnabled when SetDeepEnabled has been used.
  2041. /// </summary>
  2042. public bool EnabledSelf {
  2043. get {
  2044. return IsEnabledSelf ();
  2045. }
  2046. }
  2047. /// <summary>
  2048. /// Return up direction in parent space. Positive Y axis equals identity rotation.
  2049. /// </summary>
  2050. public Vector3 Up {
  2051. get {
  2052. return GetUp ();
  2053. }
  2054. }
  2055. /// <summary>
  2056. /// Return right direction in parent space. Positive X axis equals identity rotation.
  2057. /// </summary>
  2058. public Vector3 Right {
  2059. get {
  2060. return GetRight ();
  2061. }
  2062. }
  2063. /// <summary>
  2064. /// Return node's up vector in world space.
  2065. /// </summary>
  2066. public Vector3 WorldUp {
  2067. get {
  2068. return GetWorldUp ();
  2069. }
  2070. }
  2071. /// <summary>
  2072. /// Return node's right vector in world space.
  2073. /// </summary>
  2074. public Vector3 WorldRight {
  2075. get {
  2076. return GetWorldRight ();
  2077. }
  2078. }
  2079. /// <summary>
  2080. /// Return signed scale in world space. Utilized for Urho2D physics.
  2081. /// </summary>
  2082. public Vector3 SignedWorldScale {
  2083. get {
  2084. return GetSignedWorldScale ();
  2085. }
  2086. }
  2087. /// <summary>
  2088. /// Return world space transform matrix.
  2089. /// </summary>
  2090. public Urho.Matrix3x4 WorldTransform {
  2091. get {
  2092. return GetWorldTransform ();
  2093. }
  2094. }
  2095. /// <summary>
  2096. /// Return whether transform has changed and world transform needs recalculation.
  2097. /// </summary>
  2098. public bool Dirty {
  2099. get {
  2100. return IsDirty ();
  2101. }
  2102. }
  2103. /// <summary>
  2104. /// Return immediate child scene nodes.
  2105. /// </summary>
  2106. public IReadOnlyList<Node> Children {
  2107. get {
  2108. return GetChildren ();
  2109. }
  2110. }
  2111. /// <summary>
  2112. /// Return number of components.
  2113. /// </summary>
  2114. public uint NumComponents {
  2115. get {
  2116. return GetNumComponents ();
  2117. }
  2118. }
  2119. /// <summary>
  2120. /// Return number of non-local components.
  2121. /// </summary>
  2122. public uint NumNetworkComponents {
  2123. get {
  2124. return GetNumNetworkComponents ();
  2125. }
  2126. }
  2127. /// <summary>
  2128. /// Return all components.
  2129. /// </summary>
  2130. public IReadOnlyList<Component> Components {
  2131. get {
  2132. return GetComponents ();
  2133. }
  2134. }
  2135. /// <summary>
  2136. /// Return network position attribute.
  2137. /// Or
  2138. /// Set network position attribute.
  2139. /// </summary>
  2140. public Urho.Vector3 NetPositionAttr {
  2141. get {
  2142. return GetNetPositionAttr ();
  2143. }
  2144. set {
  2145. SetNetPositionAttr (value);
  2146. }
  2147. }
  2148. /// <summary>
  2149. /// Calculate number of non-temporary child nodes.
  2150. /// </summary>
  2151. public uint NumPersistentChildren {
  2152. get {
  2153. return GetNumPersistentChildren ();
  2154. }
  2155. }
  2156. /// <summary>
  2157. /// Calculate number of non-temporary components.
  2158. /// </summary>
  2159. public uint NumPersistentComponents {
  2160. get {
  2161. return GetNumPersistentComponents ();
  2162. }
  2163. }
  2164. }
  2165. }