AnimatedModel.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // AnimatedModel.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. /// Animated model component.
  21. /// </summary>
  22. public unsafe partial class AnimatedModel : StaticModel
  23. {
  24. unsafe partial void OnAnimatedModelCreated ();
  25. [Preserve]
  26. public AnimatedModel (IntPtr handle) : base (handle)
  27. {
  28. OnAnimatedModelCreated ();
  29. }
  30. [Preserve]
  31. protected AnimatedModel (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnAnimatedModelCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int AnimatedModel_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (AnimatedModel_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr AnimatedModel_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (AnimatedModel_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int AnimatedModel_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(AnimatedModel));
  54. return new StringHash (AnimatedModel_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr AnimatedModel_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(AnimatedModel));
  61. return Marshal.PtrToStringAnsi (AnimatedModel_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public AnimatedModel () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr AnimatedModel_AnimatedModel (IntPtr context);
  69. [Preserve]
  70. public AnimatedModel (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(AnimatedModel));
  73. handle = AnimatedModel_AnimatedModel ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnAnimatedModelCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void AnimatedModel_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory. Drawable must be registered first.
  81. /// </summary>
  82. public new static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(AnimatedModel));
  85. AnimatedModel_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern bool AnimatedModel_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 AnimatedModel_Load_File (handle, (object)source == null ? IntPtr.Zero : source.Handle, setInstanceDefault);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern bool AnimatedModel_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 AnimatedModel_Load_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle, setInstanceDefault);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern bool AnimatedModel_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 AnimatedModel_LoadXML (handle, (object)source == null ? IntPtr.Zero : source.Handle, setInstanceDefault);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void AnimatedModel_ApplyAttributes (IntPtr handle);
  119. /// <summary>
  120. /// Apply attribute changes that can not be applied immediately. Called after scene load or a network update.
  121. /// </summary>
  122. public override void ApplyAttributes ()
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. AnimatedModel_ApplyAttributes (handle);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern UpdateGeometryType AnimatedModel_GetUpdateGeometryType (IntPtr handle);
  129. /// <summary>
  130. /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
  131. /// </summary>
  132. private UpdateGeometryType GetUpdateGeometryType ()
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return AnimatedModel_GetUpdateGeometryType (handle);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern void AnimatedModel_DrawDebugGeometry (IntPtr handle, IntPtr debug, bool depthTest);
  139. /// <summary>
  140. /// Visualize the component as debug geometry.
  141. /// </summary>
  142. public override void DrawDebugGeometry (DebugRenderer debug, bool depthTest)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. AnimatedModel_DrawDebugGeometry (handle, (object)debug == null ? IntPtr.Zero : debug.Handle, depthTest);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void AnimatedModel_SetModel (IntPtr handle, IntPtr model, bool createBones);
  149. /// <summary>
  150. /// Set model.
  151. /// </summary>
  152. public void SetModel (Model model, bool createBones = true)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. AnimatedModel_SetModel (handle, (object)model == null ? IntPtr.Zero : model.Handle, createBones);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern IntPtr AnimatedModel_AddAnimationState (IntPtr handle, IntPtr animation);
  159. /// <summary>
  160. /// Add an animation.
  161. /// </summary>
  162. public AnimationState AddAnimationState (Animation animation)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. return Runtime.LookupRefCounted<AnimationState> (AnimatedModel_AddAnimationState (handle, (object)animation == null ? IntPtr.Zero : animation.Handle));
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void AnimatedModel_RemoveAnimationState (IntPtr handle, IntPtr animation);
  169. /// <summary>
  170. /// Remove an animation by animation pointer.
  171. /// </summary>
  172. public void RemoveAnimationState (Animation animation)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. AnimatedModel_RemoveAnimationState (handle, (object)animation == null ? IntPtr.Zero : animation.Handle);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void AnimatedModel_RemoveAnimationState0 (IntPtr handle, string animationName);
  179. /// <summary>
  180. /// Remove an animation by animation name.
  181. /// </summary>
  182. public void RemoveAnimationState (string animationName)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. AnimatedModel_RemoveAnimationState0 (handle, animationName);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern void AnimatedModel_RemoveAnimationState1 (IntPtr handle, int animationNameHash);
  189. /// <summary>
  190. /// Remove an animation by animation name hash.
  191. /// </summary>
  192. public void RemoveAnimationState (StringHash animationNameHash)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. AnimatedModel_RemoveAnimationState1 (handle, animationNameHash.Code);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern void AnimatedModel_RemoveAnimationState2 (IntPtr handle, IntPtr state);
  199. /// <summary>
  200. /// Remove an animation by AnimationState pointer.
  201. /// </summary>
  202. public void RemoveAnimationState (AnimationState state)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. AnimatedModel_RemoveAnimationState2 (handle, (object)state == null ? IntPtr.Zero : state.Handle);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern void AnimatedModel_RemoveAnimationState3 (IntPtr handle, uint index);
  209. /// <summary>
  210. /// Remove an animation by index.
  211. /// </summary>
  212. public void RemoveAnimationState (uint index)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. AnimatedModel_RemoveAnimationState3 (handle, index);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern void AnimatedModel_RemoveAllAnimationStates (IntPtr handle);
  219. /// <summary>
  220. /// Remove all animations.
  221. /// </summary>
  222. public void RemoveAllAnimationStates ()
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. AnimatedModel_RemoveAllAnimationStates (handle);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern void AnimatedModel_SetAnimationLodBias (IntPtr handle, float bias);
  229. /// <summary>
  230. /// Set animation LOD bias.
  231. /// </summary>
  232. private void SetAnimationLodBias (float bias)
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. AnimatedModel_SetAnimationLodBias (handle, bias);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void AnimatedModel_SetUpdateInvisible (IntPtr handle, bool enable);
  239. /// <summary>
  240. /// Set whether to update animation and the bounding box when not visible. Recommended to enable for physically controlled models like ragdolls.
  241. /// </summary>
  242. private void SetUpdateInvisible (bool enable)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. AnimatedModel_SetUpdateInvisible (handle, enable);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern void AnimatedModel_SetMorphWeight (IntPtr handle, uint index, float weight);
  249. /// <summary>
  250. /// Set vertex morph weight by index.
  251. /// </summary>
  252. public void SetMorphWeight (uint index, float weight)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. AnimatedModel_SetMorphWeight (handle, index, weight);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern void AnimatedModel_SetMorphWeight4 (IntPtr handle, string name, float weight);
  259. /// <summary>
  260. /// Set vertex morph weight by name.
  261. /// </summary>
  262. public void SetMorphWeight (string name, float weight)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. AnimatedModel_SetMorphWeight4 (handle, name, weight);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern void AnimatedModel_SetMorphWeight5 (IntPtr handle, int nameHash, float weight);
  269. /// <summary>
  270. /// Set vertex morph weight by name hash.
  271. /// </summary>
  272. public void SetMorphWeight (StringHash nameHash, float weight)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. AnimatedModel_SetMorphWeight5 (handle, nameHash.Code, weight);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern void AnimatedModel_ResetMorphWeights (IntPtr handle);
  279. /// <summary>
  280. /// Reset all vertex morphs to zero.
  281. /// </summary>
  282. public void ResetMorphWeights ()
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. AnimatedModel_ResetMorphWeights (handle);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern void AnimatedModel_ApplyAnimation (IntPtr handle);
  289. /// <summary>
  290. /// Apply all animation states to nodes.
  291. /// </summary>
  292. public void ApplyAnimation ()
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. AnimatedModel_ApplyAnimation (handle);
  296. }
  297. private IReadOnlyList<AnimationState> _GetAnimationStates_cache;
  298. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  299. internal static extern IntPtr AnimatedModel_GetAnimationStates (IntPtr handle);
  300. /// <summary>
  301. /// Return all animation states.
  302. /// </summary>
  303. private IReadOnlyList<AnimationState> GetAnimationStates ()
  304. {
  305. Runtime.ValidateRefCounted (this);
  306. return _GetAnimationStates_cache != null ? _GetAnimationStates_cache : _GetAnimationStates_cache = Runtime.CreateVectorSharedPtrRefcountedProxy<AnimationState> (AnimatedModel_GetAnimationStates (handle));
  307. }
  308. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  309. internal static extern uint AnimatedModel_GetNumAnimationStates (IntPtr handle);
  310. /// <summary>
  311. /// Return number of animation states.
  312. /// </summary>
  313. private uint GetNumAnimationStates ()
  314. {
  315. Runtime.ValidateRefCounted (this);
  316. return AnimatedModel_GetNumAnimationStates (handle);
  317. }
  318. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  319. internal static extern IntPtr AnimatedModel_GetAnimationState (IntPtr handle, IntPtr animation);
  320. /// <summary>
  321. /// Return animation state by animation pointer.
  322. /// </summary>
  323. public AnimationState GetAnimationState (Animation animation)
  324. {
  325. Runtime.ValidateRefCounted (this);
  326. return Runtime.LookupRefCounted<AnimationState> (AnimatedModel_GetAnimationState (handle, (object)animation == null ? IntPtr.Zero : animation.Handle));
  327. }
  328. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  329. internal static extern IntPtr AnimatedModel_GetAnimationState6 (IntPtr handle, string animationName);
  330. /// <summary>
  331. /// Return animation state by animation name.
  332. /// </summary>
  333. public AnimationState GetAnimationState (string animationName)
  334. {
  335. Runtime.ValidateRefCounted (this);
  336. return Runtime.LookupRefCounted<AnimationState> (AnimatedModel_GetAnimationState6 (handle, animationName));
  337. }
  338. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  339. internal static extern IntPtr AnimatedModel_GetAnimationState7 (IntPtr handle, int animationNameHash);
  340. /// <summary>
  341. /// Return animation state by animation name hash.
  342. /// </summary>
  343. public AnimationState GetAnimationState (StringHash animationNameHash)
  344. {
  345. Runtime.ValidateRefCounted (this);
  346. return Runtime.LookupRefCounted<AnimationState> (AnimatedModel_GetAnimationState7 (handle, animationNameHash.Code));
  347. }
  348. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  349. internal static extern IntPtr AnimatedModel_GetAnimationState8 (IntPtr handle, uint index);
  350. /// <summary>
  351. /// Return animation state by index.
  352. /// </summary>
  353. public AnimationState GetAnimationState (uint index)
  354. {
  355. Runtime.ValidateRefCounted (this);
  356. return Runtime.LookupRefCounted<AnimationState> (AnimatedModel_GetAnimationState8 (handle, index));
  357. }
  358. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  359. internal static extern float AnimatedModel_GetAnimationLodBias (IntPtr handle);
  360. /// <summary>
  361. /// Return animation LOD bias.
  362. /// </summary>
  363. private float GetAnimationLodBias ()
  364. {
  365. Runtime.ValidateRefCounted (this);
  366. return AnimatedModel_GetAnimationLodBias (handle);
  367. }
  368. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  369. internal static extern bool AnimatedModel_GetUpdateInvisible (IntPtr handle);
  370. /// <summary>
  371. /// Return whether to update animation when not visible.
  372. /// </summary>
  373. private bool GetUpdateInvisible ()
  374. {
  375. Runtime.ValidateRefCounted (this);
  376. return AnimatedModel_GetUpdateInvisible (handle);
  377. }
  378. private IReadOnlyList<VertexBuffer> _GetMorphVertexBuffers_cache;
  379. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  380. internal static extern IntPtr AnimatedModel_GetMorphVertexBuffers (IntPtr handle);
  381. /// <summary>
  382. /// Return all morph vertex buffers.
  383. /// </summary>
  384. private IReadOnlyList<VertexBuffer> GetMorphVertexBuffers ()
  385. {
  386. Runtime.ValidateRefCounted (this);
  387. return _GetMorphVertexBuffers_cache != null ? _GetMorphVertexBuffers_cache : _GetMorphVertexBuffers_cache = Runtime.CreateVectorSharedPtrProxy<VertexBuffer> (AnimatedModel_GetMorphVertexBuffers (handle));
  388. }
  389. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  390. internal static extern uint AnimatedModel_GetNumMorphs (IntPtr handle);
  391. /// <summary>
  392. /// Return number of vertex morphs.
  393. /// </summary>
  394. private uint GetNumMorphs ()
  395. {
  396. Runtime.ValidateRefCounted (this);
  397. return AnimatedModel_GetNumMorphs (handle);
  398. }
  399. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  400. internal static extern float AnimatedModel_GetMorphWeight (IntPtr handle, uint index);
  401. /// <summary>
  402. /// Return vertex morph weight by index.
  403. /// </summary>
  404. public float GetMorphWeight (uint index)
  405. {
  406. Runtime.ValidateRefCounted (this);
  407. return AnimatedModel_GetMorphWeight (handle, index);
  408. }
  409. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  410. internal static extern float AnimatedModel_GetMorphWeight9 (IntPtr handle, string name);
  411. /// <summary>
  412. /// Return vertex morph weight by name.
  413. /// </summary>
  414. public float GetMorphWeight (string name)
  415. {
  416. Runtime.ValidateRefCounted (this);
  417. return AnimatedModel_GetMorphWeight9 (handle, name);
  418. }
  419. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  420. internal static extern float AnimatedModel_GetMorphWeight10 (IntPtr handle, int nameHash);
  421. /// <summary>
  422. /// Return vertex morph weight by name hash.
  423. /// </summary>
  424. public float GetMorphWeight (StringHash nameHash)
  425. {
  426. Runtime.ValidateRefCounted (this);
  427. return AnimatedModel_GetMorphWeight10 (handle, nameHash.Code);
  428. }
  429. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  430. internal static extern bool AnimatedModel_IsMaster (IntPtr handle);
  431. /// <summary>
  432. /// Return whether is the master (first) animated model.
  433. /// </summary>
  434. private bool IsMaster ()
  435. {
  436. Runtime.ValidateRefCounted (this);
  437. return AnimatedModel_IsMaster (handle);
  438. }
  439. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  440. internal static extern ResourceRef AnimatedModel_GetModelAttr (IntPtr handle);
  441. /// <summary>
  442. /// Return model attribute.
  443. /// </summary>
  444. private ResourceRef GetModelAttr ()
  445. {
  446. Runtime.ValidateRefCounted (this);
  447. return AnimatedModel_GetModelAttr (handle);
  448. }
  449. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  450. internal static extern void AnimatedModel_UpdateBoneBoundingBox (IntPtr handle);
  451. /// <summary>
  452. /// Recalculate the bone bounding box. Normally called internally, but can also be manually called if up-to-date information before rendering is necessary.
  453. /// </summary>
  454. public void UpdateBoneBoundingBox ()
  455. {
  456. Runtime.ValidateRefCounted (this);
  457. AnimatedModel_UpdateBoneBoundingBox (handle);
  458. }
  459. public override StringHash Type {
  460. get {
  461. return UrhoGetType ();
  462. }
  463. }
  464. public override string TypeName {
  465. get {
  466. return GetTypeName ();
  467. }
  468. }
  469. [Preserve]
  470. public new static StringHash TypeStatic {
  471. get {
  472. return GetTypeStatic ();
  473. }
  474. }
  475. public new static string TypeNameStatic {
  476. get {
  477. return GetTypeNameStatic ();
  478. }
  479. }
  480. /// <summary>
  481. /// Return whether a geometry update is necessary, and if it can happen in a worker thread.
  482. /// </summary>
  483. public override UpdateGeometryType UpdateGeometryType {
  484. get {
  485. return GetUpdateGeometryType ();
  486. }
  487. }
  488. /// <summary>
  489. /// Return animation LOD bias.
  490. /// Or
  491. /// Set animation LOD bias.
  492. /// </summary>
  493. public float AnimationLodBias {
  494. get {
  495. return GetAnimationLodBias ();
  496. }
  497. set {
  498. SetAnimationLodBias (value);
  499. }
  500. }
  501. /// <summary>
  502. /// Return whether to update animation when not visible.
  503. /// Or
  504. /// Set whether to update animation and the bounding box when not visible. Recommended to enable for physically controlled models like ragdolls.
  505. /// </summary>
  506. public bool UpdateInvisible {
  507. get {
  508. return GetUpdateInvisible ();
  509. }
  510. set {
  511. SetUpdateInvisible (value);
  512. }
  513. }
  514. /// <summary>
  515. /// Return all animation states.
  516. /// </summary>
  517. public IReadOnlyList<AnimationState> AnimationStates {
  518. get {
  519. return GetAnimationStates ();
  520. }
  521. }
  522. /// <summary>
  523. /// Return number of animation states.
  524. /// </summary>
  525. public uint NumAnimationStates {
  526. get {
  527. return GetNumAnimationStates ();
  528. }
  529. }
  530. /// <summary>
  531. /// Return all morph vertex buffers.
  532. /// </summary>
  533. public IReadOnlyList<VertexBuffer> MorphVertexBuffers {
  534. get {
  535. return GetMorphVertexBuffers ();
  536. }
  537. }
  538. /// <summary>
  539. /// Return number of vertex morphs.
  540. /// </summary>
  541. public uint NumMorphs {
  542. get {
  543. return GetNumMorphs ();
  544. }
  545. }
  546. /// <summary>
  547. /// Return whether is the master (first) animated model.
  548. /// </summary>
  549. public bool Master {
  550. get {
  551. return IsMaster ();
  552. }
  553. }
  554. /// <summary>
  555. /// Return model attribute.
  556. /// </summary>
  557. public override ResourceRef ModelAttr {
  558. get {
  559. return GetModelAttr ();
  560. }
  561. }
  562. }
  563. }