AssimpInterop.cs 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627
  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Text;
  4. using UnityEngine;
  5. namespace TriLib
  6. {
  7. public static class AssimpInterop
  8. {
  9. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCreatePropertyStore")]
  10. public static extern IntPtr _aiCreatePropertyStore();
  11. public static IntPtr ai_CreatePropertyStore()
  12. {
  13. return AssimpInterop._aiCreatePropertyStore();
  14. }
  15. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiReleasePropertyStore")]
  16. public static extern void _aiReleasePropertyStore(IntPtr ptrPropertyStore);
  17. public static void ai_CreateReleasePropertyStore(IntPtr ptrPropertyStore)
  18. {
  19. AssimpInterop._aiReleasePropertyStore(ptrPropertyStore);
  20. }
  21. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiSetImportPropertyInteger")]
  22. public static extern IntPtr _aiSetImportPropertyInteger(IntPtr ptrStore, IntPtr name, int value);
  23. public static IntPtr ai_SetImportPropertyInteger(IntPtr ptrStore, string name, int value)
  24. {
  25. GCHandle stringBuffer = AssimpInterop.GetStringBuffer(name);
  26. IntPtr result = AssimpInterop._aiSetImportPropertyInteger(ptrStore, stringBuffer.AddrOfPinnedObject(), value);
  27. stringBuffer.Free();
  28. return result;
  29. }
  30. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiSetImportPropertyFloat")]
  31. public static extern IntPtr _aiSetImportPropertyFloat(IntPtr ptrStore, IntPtr name, float value);
  32. public static IntPtr ai_SetImportPropertyFloat(IntPtr ptrStore, string name, float value)
  33. {
  34. GCHandle stringBuffer = AssimpInterop.GetStringBuffer(name);
  35. IntPtr result = AssimpInterop._aiSetImportPropertyFloat(ptrStore, stringBuffer.AddrOfPinnedObject(), value);
  36. stringBuffer.Free();
  37. return result;
  38. }
  39. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiSetImportPropertyString")]
  40. public static extern IntPtr _aiSetImportPropertyString(IntPtr ptrStore, IntPtr name, IntPtr ptrValue);
  41. public static IntPtr ai_SetImportPropertyString(IntPtr ptrStore, string name, string value)
  42. {
  43. GCHandle stringBuffer = AssimpInterop.GetStringBuffer(name);
  44. IntPtr assimpStringBuffer = AssimpInterop.GetAssimpStringBuffer(value);
  45. IntPtr result = AssimpInterop._aiSetImportPropertyString(ptrStore, stringBuffer.AddrOfPinnedObject(), assimpStringBuffer);
  46. stringBuffer.Free();
  47. Marshal.FreeHGlobal(assimpStringBuffer);
  48. return result;
  49. }
  50. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiSetImportPropertyMatrix")]
  51. public static extern IntPtr _aiSetImportPropertyMatrix(IntPtr ptrStore, IntPtr name, IntPtr ptrValue);
  52. public static IntPtr ai_SetImportPropertyMatrix(IntPtr ptrStore, string name, Vector3 translation, Vector3 rotation, Vector3 scale)
  53. {
  54. GCHandle stringBuffer = AssimpInterop.GetStringBuffer(name);
  55. GCHandle gchandle = AssimpInterop.Matrix4x4ToAssimp(translation, rotation, scale);
  56. IntPtr result = AssimpInterop._aiSetImportPropertyMatrix(ptrStore, stringBuffer.AddrOfPinnedObject(), gchandle.AddrOfPinnedObject());
  57. stringBuffer.Free();
  58. gchandle.Free();
  59. return result;
  60. }
  61. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiImportFileFromMemory")]
  62. public static extern IntPtr _aiImportFileFromMemory(IntPtr ptrBuffer, uint uintLength, uint uintFlags, string strHint);
  63. public static IntPtr ai_ImportFileFromMemory(byte[] fileBytes, uint uintFlags, string strHint)
  64. {
  65. GCHandle gchandle = AssimpInterop.LockGc(fileBytes);
  66. IntPtr result = AssimpInterop._aiImportFileFromMemory(gchandle.AddrOfPinnedObject(), (uint)fileBytes.Length, uintFlags, strHint);
  67. gchandle.Free();
  68. return result;
  69. }
  70. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiImportFileFromMemoryWithProperties")]
  71. public static extern IntPtr _aiImportFileFromMemoryWithProperties(IntPtr ptrBuffer, uint uintLength, uint uintFlags, string strHint, IntPtr ptrProps);
  72. public static IntPtr ai_ImportFileFromMemoryWithProperties(byte[] fileBytes, uint uintFlags, string strHint, IntPtr ptrProps)
  73. {
  74. GCHandle gchandle = AssimpInterop.LockGc(fileBytes);
  75. IntPtr result = AssimpInterop._aiImportFileFromMemoryWithProperties(gchandle.AddrOfPinnedObject(), (uint)fileBytes.Length, uintFlags, strHint, ptrProps);
  76. gchandle.Free();
  77. return result;
  78. }
  79. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiImportFile")]
  80. public static extern IntPtr _aiImportFile(string filename, uint flags);
  81. public static IntPtr ai_ImportFile(string filename, uint flags)
  82. {
  83. return AssimpInterop._aiImportFile(filename, flags);
  84. }
  85. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiImportFileExWithProperties")]
  86. public static extern IntPtr _aiImportFileEx(string filename, uint flags, IntPtr ptrFS, IntPtr ptrProps);
  87. public static IntPtr ai_ImportFileEx(string filename, uint flags, IntPtr ptrFS, IntPtr ptrProp)
  88. {
  89. return AssimpInterop._aiImportFileEx(filename, flags, ptrFS, ptrProp);
  90. }
  91. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiReleaseImport")]
  92. public static extern void _aiReleaseImport(IntPtr scene);
  93. public static void ai_ReleaseImport(IntPtr scene)
  94. {
  95. AssimpInterop._aiReleaseImport(scene);
  96. }
  97. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiGetExtensionList")]
  98. public static extern void _aiGetExtensionList(IntPtr ptrExtensionList);
  99. public static void ai_GetExtensionList(out string strExtensionList)
  100. {
  101. byte[] array;
  102. GCHandle newStringBuffer = AssimpInterop.GetNewStringBuffer(out array);
  103. AssimpInterop._aiGetExtensionList(newStringBuffer.AddrOfPinnedObject());
  104. newStringBuffer.Free();
  105. long num = (!AssimpInterop.Is32Bits) ? BitConverter.ToInt64(array, 0) : ((long)BitConverter.ToInt32(array, 0));
  106. strExtensionList = Encoding.UTF8.GetString(array, AssimpInterop.IntSize, (int)num);
  107. }
  108. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiGetErrorString")]
  109. public static extern IntPtr _aiGetErrorString();
  110. public static string ai_GetErrorString()
  111. {
  112. IntPtr ptr = AssimpInterop._aiGetErrorString();
  113. return Marshal.PtrToStringAnsi(ptr);
  114. }
  115. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiIsExtensionSupported")]
  116. public static extern bool _aiIsExtensionSupported(IntPtr strExtension);
  117. public static bool ai_IsExtensionSupported(string strExtension)
  118. {
  119. GCHandle stringBuffer = AssimpInterop.GetStringBuffer(strExtension);
  120. bool result = AssimpInterop._aiIsExtensionSupported(stringBuffer.AddrOfPinnedObject());
  121. stringBuffer.Free();
  122. return result;
  123. }
  124. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_HasMaterials")]
  125. private static extern bool _aiScene_HasMaterials(IntPtr ptrScene);
  126. public static bool aiScene_HasMaterials(IntPtr ptrScene)
  127. {
  128. return AssimpInterop._aiScene_HasMaterials(ptrScene);
  129. }
  130. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetNumMaterials")]
  131. private static extern uint _aiScene_GetNumMaterials(IntPtr ptrScene);
  132. public static uint aiScene_GetNumMaterials(IntPtr ptrScene)
  133. {
  134. return AssimpInterop._aiScene_GetNumMaterials(ptrScene);
  135. }
  136. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetNumMeshes")]
  137. private static extern uint _aiScene_GetNumMeshes(IntPtr ptrScene);
  138. public static uint aiScene_GetNumMeshes(IntPtr ptrScene)
  139. {
  140. return AssimpInterop._aiScene_GetNumMeshes(ptrScene);
  141. }
  142. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetNumAnimations")]
  143. private static extern uint _aiScene_GetNumAnimations(IntPtr ptrScene);
  144. public static uint aiScene_GetNumAnimations(IntPtr ptrScene)
  145. {
  146. return AssimpInterop._aiScene_GetNumAnimations(ptrScene);
  147. }
  148. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetNumCameras")]
  149. private static extern uint _aiScene_GetNumCameras(IntPtr ptrScene);
  150. public static uint aiScene_GetNumCameras(IntPtr ptrScene)
  151. {
  152. return AssimpInterop._aiScene_GetNumCameras(ptrScene);
  153. }
  154. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetNumLights")]
  155. private static extern uint _aiScene_GetNumLights(IntPtr ptrScene);
  156. public static uint aiScene_GetNumLights(IntPtr ptrScene)
  157. {
  158. return AssimpInterop._aiScene_GetNumLights(ptrScene);
  159. }
  160. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_HasMeshes")]
  161. private static extern bool _aiScene_HasMeshes(IntPtr ptrScene);
  162. public static bool aiScene_HasMeshes(IntPtr ptrScene)
  163. {
  164. return AssimpInterop._aiScene_HasMeshes(ptrScene);
  165. }
  166. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_HasAnimation")]
  167. private static extern bool _aiScene_HasAnimation(IntPtr ptrScene);
  168. public static bool aiScene_HasAnimation(IntPtr ptrScene)
  169. {
  170. return AssimpInterop._aiScene_HasAnimation(ptrScene);
  171. }
  172. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_HasCameras")]
  173. private static extern bool _aiScene_HasCameras(IntPtr ptrScene);
  174. public static bool aiScene_HasCameras(IntPtr ptrScene)
  175. {
  176. return AssimpInterop._aiScene_HasCameras(ptrScene);
  177. }
  178. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_HasLights")]
  179. private static extern bool _aiScene_HasLights(IntPtr ptrScene);
  180. public static bool aiScene_HasLights(IntPtr ptrScene)
  181. {
  182. return AssimpInterop._aiScene_HasLights(ptrScene);
  183. }
  184. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetRootNode")]
  185. private static extern IntPtr _aiScene_GetRootNode(IntPtr ptrScene);
  186. public static IntPtr aiScene_GetRootNode(IntPtr ptrScene)
  187. {
  188. return AssimpInterop._aiScene_GetRootNode(ptrScene);
  189. }
  190. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetMaterial")]
  191. private static extern IntPtr _aiScene_GetMaterial(IntPtr ptrScene, uint uintIndex);
  192. public static IntPtr aiScene_GetMaterial(IntPtr ptrScene, uint uintIndex)
  193. {
  194. return AssimpInterop._aiScene_GetMaterial(ptrScene, uintIndex);
  195. }
  196. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetMesh")]
  197. private static extern IntPtr _aiScene_GetMesh(IntPtr ptrScene, uint uintIndex);
  198. public static IntPtr aiScene_GetMesh(IntPtr ptrScene, uint uintIndex)
  199. {
  200. return AssimpInterop._aiScene_GetMesh(ptrScene, uintIndex);
  201. }
  202. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetAnimation")]
  203. private static extern IntPtr _aiScene_GetAnimation(IntPtr ptrScene, uint uintIndex);
  204. public static IntPtr aiScene_GetAnimation(IntPtr ptrScene, uint uintIndex)
  205. {
  206. return AssimpInterop._aiScene_GetAnimation(ptrScene, uintIndex);
  207. }
  208. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetCamera")]
  209. private static extern IntPtr _aiScene_GetCamera(IntPtr ptrScene, uint uintIndex);
  210. public static IntPtr aiScene_GetCamera(IntPtr ptrScene, uint uintIndex)
  211. {
  212. return AssimpInterop._aiScene_GetCamera(ptrScene, uintIndex);
  213. }
  214. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetLight")]
  215. private static extern IntPtr _aiScene_GetLight(IntPtr ptrScene, uint uintIndex);
  216. public static IntPtr aiScene_GetLight(IntPtr ptrScene, uint uintIndex)
  217. {
  218. return AssimpInterop._aiScene_GetLight(ptrScene, uintIndex);
  219. }
  220. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNode_GetName")]
  221. private static extern IntPtr _aiNode_GetName(IntPtr ptrNode);
  222. public static string aiNode_GetName(IntPtr ptrNode)
  223. {
  224. IntPtr pointer = AssimpInterop._aiNode_GetName(ptrNode);
  225. return AssimpInterop.ReadStringFromPointer(pointer);
  226. }
  227. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNode_GetNumChildren")]
  228. private static extern uint _aiNode_GetNumChildren(IntPtr ptrNode);
  229. public static uint aiNode_GetNumChildren(IntPtr ptrNode)
  230. {
  231. return AssimpInterop._aiNode_GetNumChildren(ptrNode);
  232. }
  233. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNode_GetNumMeshes")]
  234. private static extern uint _aiNode_GetNumMeshes(IntPtr ptrNode);
  235. public static uint aiNode_GetNumMeshes(IntPtr ptrNode)
  236. {
  237. return AssimpInterop._aiNode_GetNumMeshes(ptrNode);
  238. }
  239. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNode_GetChildren")]
  240. private static extern IntPtr _aiNode_GetChildren(IntPtr ptrNode, uint uintIndex);
  241. public static IntPtr aiNode_GetChildren(IntPtr ptrNode, uint uintIndex)
  242. {
  243. return AssimpInterop._aiNode_GetChildren(ptrNode, uintIndex);
  244. }
  245. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNode_GetMeshIndex")]
  246. private static extern uint _aiNode_GetMeshIndex(IntPtr ptrNode, uint uintIndex);
  247. public static uint aiNode_GetMeshIndex(IntPtr ptrNode, uint uintIndex)
  248. {
  249. return AssimpInterop._aiNode_GetMeshIndex(ptrNode, uintIndex);
  250. }
  251. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNode_GetParent")]
  252. private static extern IntPtr _aiNode_GetParent(IntPtr ptrNode);
  253. public static IntPtr aiNode_GetParent(IntPtr ptrNode)
  254. {
  255. return AssimpInterop._aiNode_GetParent(ptrNode);
  256. }
  257. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNode_GetTransformation")]
  258. private static extern IntPtr _aiNode_GetTransformation(IntPtr ptrNode);
  259. public static Matrix4x4 aiNode_GetTransformation(IntPtr ptrNode)
  260. {
  261. IntPtr pointer = AssimpInterop._aiNode_GetTransformation(ptrNode);
  262. float[] newFloat16Array = AssimpInterop.GetNewFloat16Array(pointer);
  263. return AssimpInterop.LoadMatrix4x4FromArray(newFloat16Array);
  264. }
  265. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_IsEmbeddedTextureCompressed")]
  266. private static extern bool _aiMaterial_IsEmbeddedTextureCompressed(IntPtr ptrScene, IntPtr ptrTexture);
  267. public static bool aiMaterial_IsEmbeddedTextureCompressed(IntPtr ptrScene, IntPtr ptrTexture)
  268. {
  269. return AssimpInterop._aiMaterial_IsEmbeddedTextureCompressed(ptrScene, ptrTexture);
  270. }
  271. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetEmbeddedTextureDataSize")]
  272. private static extern uint _aiMaterial_GetEmbeddedTextureDataSize(IntPtr ptrScene, IntPtr ptrTexture, bool boolCompressed);
  273. public static uint aiMaterial_GetEmbeddedTextureDataSize(IntPtr ptrScene, IntPtr ptrTexture, bool boolCompressed)
  274. {
  275. return AssimpInterop._aiMaterial_GetEmbeddedTextureDataSize(ptrScene, ptrTexture, boolCompressed);
  276. }
  277. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetEmbeddedTextureData")]
  278. private static extern void _aiMaterial_GetEmbeddedTextureData(IntPtr ptrScene, IntPtr ptrData, IntPtr ptrTexture, uint uintSize);
  279. public static byte[] aiMaterial_GetEmbeddedTextureData(IntPtr ptrScene, IntPtr ptrTexture, uint uintSize)
  280. {
  281. byte[] array = new byte[uintSize];
  282. GCHandle gchandle = AssimpInterop.LockGc(array);
  283. AssimpInterop._aiMaterial_GetEmbeddedTextureData(ptrScene, gchandle.AddrOfPinnedObject(), ptrTexture, uintSize);
  284. gchandle.Free();
  285. return array;
  286. }
  287. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetEmbeddedTextureWidth")]
  288. private static extern int _aiMaterial_GetEmbeddedTextureWidth(IntPtr ptrTexture);
  289. public static int aiMaterial_GetEmbeddedTextureWidth(IntPtr ptrTexture)
  290. {
  291. return AssimpInterop._aiMaterial_GetEmbeddedTextureWidth(ptrTexture);
  292. }
  293. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetEmbeddedTextureHeight")]
  294. private static extern int _aiMaterial_GetEmbeddedTextureHeight(IntPtr ptrTexture);
  295. public static int aiMaterial_GetEmbeddedTextureHeight(IntPtr ptrTexture)
  296. {
  297. return AssimpInterop._aiMaterial_GetEmbeddedTextureHeight(ptrTexture);
  298. }
  299. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetEmbeddedTexture")]
  300. private static extern IntPtr _aiScene_GetEmbeddedTexture(IntPtr ptrScene, string strFilename);
  301. public static IntPtr aiScene_GetEmbeddedTexture(IntPtr ptrScene, string strFilename)
  302. {
  303. return AssimpInterop._aiScene_GetEmbeddedTexture(ptrScene, strFilename);
  304. }
  305. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetTextureCount")]
  306. private static extern uint _aiMaterial_GetTextureCount(IntPtr ptrMat, uint uintType);
  307. public static uint aiMaterial_GetTextureCount(IntPtr ptrMat, uint uintType)
  308. {
  309. return AssimpInterop._aiMaterial_GetTextureCount(ptrMat, uintType);
  310. }
  311. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasTextureDiffuse")]
  312. private static extern bool _aiMaterial_HasTextureDiffuse(IntPtr ptrMat, uint uintType);
  313. public static bool aiMaterial_HasTextureDiffuse(IntPtr ptrMat, uint uintType)
  314. {
  315. return AssimpInterop._aiMaterial_HasTextureDiffuse(ptrMat, uintType);
  316. }
  317. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetTextureDiffuse")]
  318. private static extern bool _aiMaterial_GetTextureDiffuse(IntPtr ptrMat, uint uintType, IntPtr strPath, IntPtr uintMapping, IntPtr uintUvIndex, IntPtr floatBlend, IntPtr uintOp, IntPtr uintMapMode);
  319. public static bool aiMaterial_GetTextureDiffuse(IntPtr ptrMat, uint uintType, out string strPath, out uint uintMapping, out uint uintUvIndex, out float floatBlend, out uint uintOp, out uint uintMapMode)
  320. {
  321. byte[] value;
  322. GCHandle newStringBuffer = AssimpInterop.GetNewStringBuffer(out value);
  323. GCHandle newUIntBuffer = AssimpInterop.GetNewUIntBuffer(out uintMapping);
  324. GCHandle newUIntBuffer2 = AssimpInterop.GetNewUIntBuffer(out uintUvIndex);
  325. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatBlend);
  326. GCHandle newUIntBuffer3 = AssimpInterop.GetNewUIntBuffer(out uintOp);
  327. GCHandle newUIntBuffer4 = AssimpInterop.GetNewUIntBuffer(out uintMapMode);
  328. bool result = AssimpInterop._aiMaterial_GetTextureDiffuse(ptrMat, uintType, newStringBuffer.AddrOfPinnedObject(), newUIntBuffer.AddrOfPinnedObject(), newUIntBuffer2.AddrOfPinnedObject(), newFloatBuffer.AddrOfPinnedObject(), newUIntBuffer3.AddrOfPinnedObject(), newUIntBuffer4.AddrOfPinnedObject());
  329. strPath = AssimpInterop.ByteArrayToString(value);
  330. newStringBuffer.Free();
  331. newUIntBuffer.Free();
  332. newUIntBuffer2.Free();
  333. newFloatBuffer.Free();
  334. newUIntBuffer3.Free();
  335. newUIntBuffer4.Free();
  336. return result;
  337. }
  338. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetNumTextureDiffuse")]
  339. private static extern uint _aiMaterial_GetNumTextureDiffuse(IntPtr ptrMat);
  340. public static uint aiMaterial_GetNumTextureDiffuse(IntPtr ptrMat)
  341. {
  342. return AssimpInterop._aiMaterial_GetNumTextureDiffuse(ptrMat);
  343. }
  344. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasTextureEmissive")]
  345. private static extern bool _aiMaterial_HasTextureEmissive(IntPtr ptrMat, uint uintIndex);
  346. public static bool aiMaterial_HasTextureEmissive(IntPtr ptrMat, uint uintIndex)
  347. {
  348. return AssimpInterop._aiMaterial_HasTextureEmissive(ptrMat, uintIndex);
  349. }
  350. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetTextureEmissive")]
  351. private static extern bool _aiMaterial_GetTextureEmissive(IntPtr ptrMat, uint uintIndex, IntPtr strPath, IntPtr uintMapping, IntPtr uintUvIndex, IntPtr floatBlend, IntPtr uintOp, IntPtr uintMapMode);
  352. public static bool aiMaterial_GetTextureEmissive(IntPtr ptrMat, uint uintIndex, out string strPath, out uint uintMapping, out uint uintUvIndex, out float floatBlend, out uint uintOp, out uint uintMapMode)
  353. {
  354. byte[] value;
  355. GCHandle newStringBuffer = AssimpInterop.GetNewStringBuffer(out value);
  356. GCHandle newUIntBuffer = AssimpInterop.GetNewUIntBuffer(out uintMapping);
  357. GCHandle newUIntBuffer2 = AssimpInterop.GetNewUIntBuffer(out uintUvIndex);
  358. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatBlend);
  359. GCHandle newUIntBuffer3 = AssimpInterop.GetNewUIntBuffer(out uintOp);
  360. GCHandle newUIntBuffer4 = AssimpInterop.GetNewUIntBuffer(out uintMapMode);
  361. bool result = AssimpInterop._aiMaterial_GetTextureEmissive(ptrMat, uintIndex, newStringBuffer.AddrOfPinnedObject(), newUIntBuffer.AddrOfPinnedObject(), newUIntBuffer2.AddrOfPinnedObject(), newFloatBuffer.AddrOfPinnedObject(), newUIntBuffer3.AddrOfPinnedObject(), newUIntBuffer4.AddrOfPinnedObject());
  362. strPath = AssimpInterop.ByteArrayToString(value);
  363. newStringBuffer.Free();
  364. newUIntBuffer.Free();
  365. newUIntBuffer2.Free();
  366. newFloatBuffer.Free();
  367. newUIntBuffer3.Free();
  368. newUIntBuffer4.Free();
  369. return result;
  370. }
  371. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetNumTextureEmissive")]
  372. private static extern uint _aiMaterial_GetNumTextureEmissive(IntPtr ptrMat);
  373. public static uint aiMaterial_GetNumTextureEmissive(IntPtr ptrMat)
  374. {
  375. return AssimpInterop._aiMaterial_GetNumTextureEmissive(ptrMat);
  376. }
  377. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasTextureSpecular")]
  378. private static extern bool _aiMaterial_HasTextureSpecular(IntPtr ptrMat, uint uintIndex);
  379. public static bool aiMaterial_HasTextureSpecular(IntPtr ptrMat, uint uintIndex)
  380. {
  381. return AssimpInterop._aiMaterial_HasTextureSpecular(ptrMat, uintIndex);
  382. }
  383. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetTextureSpecular")]
  384. private static extern bool _aiMaterial_GetTextureSpecular(IntPtr ptrMat, uint uintIndex, IntPtr strPath, IntPtr uintMapping, IntPtr uintUvIndex, IntPtr floatBlend, IntPtr uintOp, IntPtr uintMapMode);
  385. public static bool aiMaterial_GetTextureSpecular(IntPtr ptrMat, uint uintIndex, out string strPath, out uint uintMapping, out uint uintUvIndex, out float floatBlend, out uint uintOp, out uint uintMapMode)
  386. {
  387. byte[] value;
  388. GCHandle newStringBuffer = AssimpInterop.GetNewStringBuffer(out value);
  389. GCHandle newUIntBuffer = AssimpInterop.GetNewUIntBuffer(out uintMapping);
  390. GCHandle newUIntBuffer2 = AssimpInterop.GetNewUIntBuffer(out uintUvIndex);
  391. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatBlend);
  392. GCHandle newUIntBuffer3 = AssimpInterop.GetNewUIntBuffer(out uintOp);
  393. GCHandle newUIntBuffer4 = AssimpInterop.GetNewUIntBuffer(out uintMapMode);
  394. bool result = AssimpInterop._aiMaterial_GetTextureSpecular(ptrMat, uintIndex, newStringBuffer.AddrOfPinnedObject(), newUIntBuffer.AddrOfPinnedObject(), newUIntBuffer2.AddrOfPinnedObject(), newFloatBuffer.AddrOfPinnedObject(), newUIntBuffer3.AddrOfPinnedObject(), newUIntBuffer4.AddrOfPinnedObject());
  395. strPath = AssimpInterop.ByteArrayToString(value);
  396. newStringBuffer.Free();
  397. newUIntBuffer.Free();
  398. newUIntBuffer2.Free();
  399. newFloatBuffer.Free();
  400. newUIntBuffer3.Free();
  401. newUIntBuffer4.Free();
  402. return result;
  403. }
  404. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetNumTextureSpecular")]
  405. private static extern uint _aiMaterial_GetNumTextureSpecular(IntPtr ptrMat);
  406. public static uint aiMaterial_GetNumTextureSpecular(IntPtr ptrMat)
  407. {
  408. return AssimpInterop._aiMaterial_GetNumTextureSpecular(ptrMat);
  409. }
  410. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasTextureNormals")]
  411. private static extern bool _aiMaterial_HasTextureNormals(IntPtr ptrMat, uint uintIndex);
  412. public static bool aiMaterial_HasTextureNormals(IntPtr ptrMat, uint uintIndex)
  413. {
  414. return AssimpInterop._aiMaterial_HasTextureNormals(ptrMat, uintIndex);
  415. }
  416. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetTextureNormals")]
  417. private static extern bool _aiMaterial_GetTextureNormals(IntPtr ptrMat, uint uintIndex, IntPtr strPath, IntPtr uintMapping, IntPtr uintUvIndex, IntPtr floatBlend, IntPtr uintOp, IntPtr uintMapMode);
  418. public static bool aiMaterial_GetTextureNormals(IntPtr ptrMat, uint uintIndex, out string strPath, out uint uintMapping, out uint uintUvIndex, out float floatBlend, out uint uintOp, out uint uintMapMode)
  419. {
  420. byte[] value;
  421. GCHandle newStringBuffer = AssimpInterop.GetNewStringBuffer(out value);
  422. GCHandle newUIntBuffer = AssimpInterop.GetNewUIntBuffer(out uintMapping);
  423. GCHandle newUIntBuffer2 = AssimpInterop.GetNewUIntBuffer(out uintUvIndex);
  424. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatBlend);
  425. GCHandle newUIntBuffer3 = AssimpInterop.GetNewUIntBuffer(out uintOp);
  426. GCHandle newUIntBuffer4 = AssimpInterop.GetNewUIntBuffer(out uintMapMode);
  427. bool result = AssimpInterop._aiMaterial_GetTextureNormals(ptrMat, uintIndex, newStringBuffer.AddrOfPinnedObject(), newUIntBuffer.AddrOfPinnedObject(), newUIntBuffer2.AddrOfPinnedObject(), newFloatBuffer.AddrOfPinnedObject(), newUIntBuffer3.AddrOfPinnedObject(), newUIntBuffer4.AddrOfPinnedObject());
  428. strPath = AssimpInterop.ByteArrayToString(value);
  429. newStringBuffer.Free();
  430. newUIntBuffer.Free();
  431. newUIntBuffer2.Free();
  432. newFloatBuffer.Free();
  433. newUIntBuffer3.Free();
  434. newUIntBuffer4.Free();
  435. return result;
  436. }
  437. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetNumTextureNormals")]
  438. private static extern uint _aiMaterial_GetNumTextureNormals(IntPtr ptrMat);
  439. public static uint aiMaterial_GetNumTextureNormals(IntPtr ptrMat)
  440. {
  441. return AssimpInterop._aiMaterial_GetNumTextureNormals(ptrMat);
  442. }
  443. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasTextureHeight")]
  444. private static extern bool _aiMaterial_HasTextureHeight(IntPtr ptrMat, uint uintIndex);
  445. public static bool aiMaterial_HasTextureHeight(IntPtr ptrMat, uint uintIndex)
  446. {
  447. return AssimpInterop._aiMaterial_HasTextureHeight(ptrMat, uintIndex);
  448. }
  449. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetTextureHeight")]
  450. private static extern bool _aiMaterial_GetTextureHeight(IntPtr ptrMat, uint uintIndex, IntPtr strPath, IntPtr uintMapping, IntPtr uintUvIndex, IntPtr floatBlend, IntPtr uintOp, IntPtr uintMapMode);
  451. public static bool aiMaterial_GetTextureHeight(IntPtr ptrMat, uint uintIndex, out string strPath, out uint uintMapping, out uint uintUvIndex, out float floatBlend, out uint uintOp, out uint uintMapMode)
  452. {
  453. byte[] value;
  454. GCHandle newStringBuffer = AssimpInterop.GetNewStringBuffer(out value);
  455. GCHandle newUIntBuffer = AssimpInterop.GetNewUIntBuffer(out uintMapping);
  456. GCHandle newUIntBuffer2 = AssimpInterop.GetNewUIntBuffer(out uintUvIndex);
  457. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatBlend);
  458. GCHandle newUIntBuffer3 = AssimpInterop.GetNewUIntBuffer(out uintOp);
  459. GCHandle newUIntBuffer4 = AssimpInterop.GetNewUIntBuffer(out uintMapMode);
  460. bool result = AssimpInterop._aiMaterial_GetTextureHeight(ptrMat, uintIndex, newStringBuffer.AddrOfPinnedObject(), newUIntBuffer.AddrOfPinnedObject(), newUIntBuffer2.AddrOfPinnedObject(), newFloatBuffer.AddrOfPinnedObject(), newUIntBuffer3.AddrOfPinnedObject(), newUIntBuffer4.AddrOfPinnedObject());
  461. strPath = AssimpInterop.ByteArrayToString(value);
  462. newStringBuffer.Free();
  463. newUIntBuffer.Free();
  464. newUIntBuffer2.Free();
  465. newFloatBuffer.Free();
  466. newUIntBuffer3.Free();
  467. newUIntBuffer4.Free();
  468. return result;
  469. }
  470. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetNumTextureHeight")]
  471. private static extern uint _aiMaterial_GetNumTextureHeight(IntPtr ptrMat);
  472. public static uint aiMaterial_GetNumTextureHeight(IntPtr ptrMat)
  473. {
  474. return AssimpInterop._aiMaterial_GetNumTextureHeight(ptrMat);
  475. }
  476. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasAmbient")]
  477. private static extern bool _aiMaterial_HasAmbient(IntPtr ptrMat);
  478. public static bool aiMaterial_HasAmbient(IntPtr ptrMat)
  479. {
  480. return AssimpInterop._aiMaterial_HasAmbient(ptrMat);
  481. }
  482. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetAmbient")]
  483. private static extern bool _aiMaterial_GetAmbient(IntPtr ptrMat, IntPtr colorOut);
  484. public static bool aiMaterial_GetAmbient(IntPtr ptrMat, out Color colorOut)
  485. {
  486. float[] array;
  487. GCHandle newFloat4Buffer = AssimpInterop.GetNewFloat4Buffer(out array);
  488. bool result = AssimpInterop._aiMaterial_GetAmbient(ptrMat, newFloat4Buffer.AddrOfPinnedObject());
  489. colorOut = AssimpInterop.LoadColorFromArray(array);
  490. newFloat4Buffer.Free();
  491. return result;
  492. }
  493. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasDiffuse")]
  494. private static extern bool _aiMaterial_HasDiffuse(IntPtr ptrMat);
  495. public static bool aiMaterial_HasDiffuse(IntPtr ptrMat)
  496. {
  497. return AssimpInterop._aiMaterial_HasDiffuse(ptrMat);
  498. }
  499. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetDiffuse")]
  500. private static extern bool _aiMaterial_GetDiffuse(IntPtr ptrMat, IntPtr colorOut);
  501. public static bool aiMaterial_GetDiffuse(IntPtr ptrMat, out Color colorOut)
  502. {
  503. float[] array;
  504. GCHandle newFloat4Buffer = AssimpInterop.GetNewFloat4Buffer(out array);
  505. bool result = AssimpInterop._aiMaterial_GetDiffuse(ptrMat, newFloat4Buffer.AddrOfPinnedObject());
  506. colorOut = AssimpInterop.LoadColorFromArray(array);
  507. newFloat4Buffer.Free();
  508. return result;
  509. }
  510. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasSpecular")]
  511. private static extern bool _aiMaterial_HasSpecular(IntPtr ptrMat);
  512. public static bool aiMaterial_HasSpecular(IntPtr ptrMat)
  513. {
  514. return AssimpInterop._aiMaterial_HasSpecular(ptrMat);
  515. }
  516. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetSpecular")]
  517. private static extern bool _aiMaterial_GetSpecular(IntPtr ptrMat, IntPtr colorOut);
  518. public static bool aiMaterial_GetSpecular(IntPtr ptrMat, out Color colorOut)
  519. {
  520. float[] array;
  521. GCHandle newFloat4Buffer = AssimpInterop.GetNewFloat4Buffer(out array);
  522. bool result = AssimpInterop._aiMaterial_GetSpecular(ptrMat, newFloat4Buffer.AddrOfPinnedObject());
  523. colorOut = AssimpInterop.LoadColorFromArray(array);
  524. newFloat4Buffer.Free();
  525. return result;
  526. }
  527. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasEmissive")]
  528. private static extern bool _aiMaterial_HasEmissive(IntPtr ptrMat);
  529. public static bool aiMaterial_HasEmissive(IntPtr ptrMat)
  530. {
  531. return AssimpInterop._aiMaterial_HasEmissive(ptrMat);
  532. }
  533. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetEmissive")]
  534. private static extern bool _aiMaterial_GetEmissive(IntPtr ptrMat, IntPtr colorOut);
  535. public static bool aiMaterial_GetEmissive(IntPtr ptrMat, out Color colorOut)
  536. {
  537. float[] array;
  538. GCHandle newFloat4Buffer = AssimpInterop.GetNewFloat4Buffer(out array);
  539. bool result = AssimpInterop._aiMaterial_GetEmissive(ptrMat, newFloat4Buffer.AddrOfPinnedObject());
  540. colorOut = AssimpInterop.LoadColorFromArray(array);
  541. newFloat4Buffer.Free();
  542. return result;
  543. }
  544. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasName")]
  545. private static extern bool _aiMaterial_HasName(IntPtr ptrMat);
  546. public static bool aiMaterial_HasName(IntPtr ptrMat)
  547. {
  548. return AssimpInterop._aiMaterial_HasName(ptrMat);
  549. }
  550. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetName")]
  551. private static extern bool _aiMaterial_GetName(IntPtr ptrMat, IntPtr strName);
  552. public static bool aiMaterial_GetName(IntPtr ptrMat, out string strName)
  553. {
  554. byte[] value;
  555. GCHandle newStringBuffer = AssimpInterop.GetNewStringBuffer(out value);
  556. bool result = AssimpInterop._aiMaterial_GetName(ptrMat, newStringBuffer.AddrOfPinnedObject());
  557. strName = AssimpInterop.ByteArrayToString(value);
  558. newStringBuffer.Free();
  559. return result;
  560. }
  561. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasBumpScaling")]
  562. private static extern bool _aiMaterial_HasBumpScaling(IntPtr ptrMat);
  563. public static bool aiMaterial_HasBumpScaling(IntPtr ptrMat)
  564. {
  565. return AssimpInterop._aiMaterial_HasBumpScaling(ptrMat);
  566. }
  567. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetBumpScaling")]
  568. private static extern bool _aiMaterial_GetBumpScaling(IntPtr ptrMat, IntPtr floatOut);
  569. public static bool aiMaterial_GetBumpScaling(IntPtr ptrMat, out float floatOut)
  570. {
  571. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatOut);
  572. bool result = AssimpInterop._aiMaterial_GetBumpScaling(ptrMat, newFloatBuffer.AddrOfPinnedObject());
  573. newFloatBuffer.Free();
  574. return result;
  575. }
  576. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasShininess")]
  577. private static extern bool _aiMaterial_HasShininess(IntPtr ptrMat);
  578. public static bool aiMaterial_HasShininess(IntPtr ptrMat)
  579. {
  580. return AssimpInterop._aiMaterial_HasShininess(ptrMat);
  581. }
  582. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetShininess")]
  583. private static extern bool _aiMaterial_GetShininess(IntPtr ptrMat, IntPtr floatOut);
  584. public static bool aiMaterial_GetShininess(IntPtr ptrMat, out float floatOut)
  585. {
  586. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatOut);
  587. bool result = AssimpInterop._aiMaterial_GetShininess(ptrMat, newFloatBuffer.AddrOfPinnedObject());
  588. newFloatBuffer.Free();
  589. return result;
  590. }
  591. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasShininessStrength")]
  592. private static extern bool _aiMaterial_HasShininessStrength(IntPtr ptrMat);
  593. public static bool aiMaterial_HasShininessStrength(IntPtr ptrMat)
  594. {
  595. return AssimpInterop._aiMaterial_HasShininessStrength(ptrMat);
  596. }
  597. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetShininessStrength")]
  598. private static extern bool _aiMaterial_GetShininessStrength(IntPtr ptrMat, IntPtr floatOut);
  599. public static bool aiMaterial_GetShininessStrength(IntPtr ptrMat, out float floatOut)
  600. {
  601. GCHandle newFloatBuffer = AssimpInterop.GetNewFloatBuffer(out floatOut);
  602. bool result = AssimpInterop._aiMaterial_GetShininessStrength(ptrMat, newFloatBuffer.AddrOfPinnedObject());
  603. newFloatBuffer.Free();
  604. return result;
  605. }
  606. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_HasOpacity")]
  607. private static extern bool _aiMaterial_HasOpacity(IntPtr ptrMat);
  608. public static bool aiMaterial_HasOpacity(IntPtr ptrMat)
  609. {
  610. return AssimpInterop._aiMaterial_HasOpacity(ptrMat);
  611. }
  612. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMaterial_GetOpacity")]
  613. private static extern bool _aiMaterial_GetOpacity(IntPtr ptrMat, IntPtr floatOut);
  614. public static bool aiMaterial_GetOpacity(IntPtr ptrMat, out float floatOut)
  615. {
  616. IntPtr intPtr = Marshal.AllocHGlobal(4);
  617. bool result = AssimpInterop._aiMaterial_GetOpacity(ptrMat, intPtr);
  618. float[] array = new float[1];
  619. Marshal.Copy(intPtr, array, 0, 1);
  620. floatOut = array[0];
  621. Marshal.FreeHGlobal(intPtr);
  622. return result;
  623. }
  624. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_VertexCount")]
  625. private static extern uint _aiMesh_VertexCount(IntPtr ptrMesh);
  626. public static uint aiMesh_VertexCount(IntPtr ptrMesh)
  627. {
  628. return AssimpInterop._aiMesh_VertexCount(ptrMesh);
  629. }
  630. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_HasNormals")]
  631. private static extern bool _aiMesh_HasNormals(IntPtr ptrMesh);
  632. public static bool aiMesh_HasNormals(IntPtr ptrMesh)
  633. {
  634. return AssimpInterop._aiMesh_HasNormals(ptrMesh);
  635. }
  636. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_HasTangentsAndBitangents")]
  637. private static extern bool _aiMesh_HasTangentsAndBitangents(IntPtr ptrMesh);
  638. public static bool aiMesh_HasTangentsAndBitangents(IntPtr ptrMesh)
  639. {
  640. return AssimpInterop._aiMesh_HasTangentsAndBitangents(ptrMesh);
  641. }
  642. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_HasTextureCoords")]
  643. private static extern bool _aiMesh_HasTextureCoords(IntPtr ptrMesh, uint uintIndex);
  644. public static bool aiMesh_HasTextureCoords(IntPtr ptrMesh, uint uintIndex)
  645. {
  646. return AssimpInterop._aiMesh_HasTextureCoords(ptrMesh, uintIndex);
  647. }
  648. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_HasVertexColors")]
  649. private static extern bool _aiMesh_HasVertexColors(IntPtr ptrMesh, uint uintIndex);
  650. public static bool aiMesh_HasVertexColors(IntPtr ptrMesh, uint uintIndex)
  651. {
  652. return AssimpInterop._aiMesh_HasVertexColors(ptrMesh, uintIndex);
  653. }
  654. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetVertex")]
  655. private static extern IntPtr _aiMesh_GetVertex(IntPtr ptrMesh, uint uintIndex);
  656. public static Vector3 aiMesh_GetVertex(IntPtr ptrMesh, uint uintIndex)
  657. {
  658. IntPtr pointer = AssimpInterop._aiMesh_GetVertex(ptrMesh, uintIndex);
  659. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  660. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  661. }
  662. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetNormal")]
  663. private static extern IntPtr _aiMesh_GetNormal(IntPtr ptrMesh, uint uintIndex);
  664. public static Vector3 aiMesh_GetNormal(IntPtr ptrMesh, uint uintIndex)
  665. {
  666. IntPtr pointer = AssimpInterop._aiMesh_GetNormal(ptrMesh, uintIndex);
  667. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  668. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  669. }
  670. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetTangent")]
  671. private static extern IntPtr _aiMesh_GetTangent(IntPtr ptrMesh, uint uintIndex);
  672. public static Vector3 aiMesh_GetTangent(IntPtr ptrMesh, uint uintIndex)
  673. {
  674. IntPtr pointer = AssimpInterop._aiMesh_GetTangent(ptrMesh, uintIndex);
  675. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  676. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  677. }
  678. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetBitangent")]
  679. private static extern IntPtr _aiMesh_GetBitangent(IntPtr ptrMesh, uint uintIndex);
  680. public static Vector3 aiMesh_GetBitangent(IntPtr ptrMesh, uint uintIndex)
  681. {
  682. IntPtr pointer = AssimpInterop._aiMesh_GetBitangent(ptrMesh, uintIndex);
  683. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  684. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  685. }
  686. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetTextureCoord")]
  687. private static extern IntPtr _aiMesh_GetTextureCoord(IntPtr ptrMesh, uint uintChannel, uint uintIndex);
  688. public static Vector2 aiMesh_GetTextureCoord(IntPtr ptrMesh, uint uintChannel, uint uintIndex)
  689. {
  690. IntPtr pointer = AssimpInterop._aiMesh_GetTextureCoord(ptrMesh, uintChannel, uintIndex);
  691. float[] newFloat2Array = AssimpInterop.GetNewFloat2Array(pointer);
  692. return AssimpInterop.LoadVector2FromArray(newFloat2Array);
  693. }
  694. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetVertexColor")]
  695. private static extern IntPtr _aiMesh_GetVertexColor(IntPtr ptrMesh, uint uintChannel, uint uintIndex);
  696. public static Color aiMesh_GetVertexColor(IntPtr ptrMesh, uint uintChannel, uint uintIndex)
  697. {
  698. IntPtr pointer = AssimpInterop._aiMesh_GetVertexColor(ptrMesh, uintChannel, uintIndex);
  699. float[] newFloat4Array = AssimpInterop.GetNewFloat4Array(pointer);
  700. return AssimpInterop.LoadColorFromArray(newFloat4Array);
  701. }
  702. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetMatrialIndex")]
  703. private static extern uint _aiMesh_GetMatrialIndex(IntPtr ptrMesh);
  704. public static uint aiMesh_GetMatrialIndex(IntPtr ptrMesh)
  705. {
  706. return AssimpInterop._aiMesh_GetMatrialIndex(ptrMesh);
  707. }
  708. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetName")]
  709. private static extern IntPtr _aiMesh_GetName(IntPtr ptrMesh);
  710. public static string aiMesh_GetName(IntPtr ptrMesh)
  711. {
  712. IntPtr pointer = AssimpInterop._aiMesh_GetName(ptrMesh);
  713. return AssimpInterop.ReadStringFromPointer(pointer);
  714. }
  715. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_HasFaces")]
  716. private static extern bool _aiMesh_HasFaces(IntPtr ptrMesh);
  717. public static bool aiMesh_HasFaces(IntPtr ptrMesh)
  718. {
  719. return AssimpInterop._aiMesh_HasFaces(ptrMesh);
  720. }
  721. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetNumFaces")]
  722. private static extern uint _aiMesh_GetNumFaces(IntPtr ptrMesh);
  723. public static uint aiMesh_GetNumFaces(IntPtr ptrMesh)
  724. {
  725. return AssimpInterop._aiMesh_GetNumFaces(ptrMesh);
  726. }
  727. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetFace")]
  728. private static extern IntPtr _aiMesh_GetFace(IntPtr ptrMesh, uint uintIndex);
  729. public static IntPtr aiMesh_GetFace(IntPtr ptrMesh, uint uintIndex)
  730. {
  731. return AssimpInterop._aiMesh_GetFace(ptrMesh, uintIndex);
  732. }
  733. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_HasBones")]
  734. private static extern bool _aiMesh_HasBones(IntPtr ptrMesh);
  735. public static bool aiMesh_HasBones(IntPtr ptrMesh)
  736. {
  737. return AssimpInterop._aiMesh_HasBones(ptrMesh);
  738. }
  739. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetNumBones")]
  740. private static extern uint _aiMesh_GetNumBones(IntPtr ptrMesh);
  741. public static uint aiMesh_GetNumBones(IntPtr ptrMesh)
  742. {
  743. return AssimpInterop._aiMesh_GetNumBones(ptrMesh);
  744. }
  745. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiMesh_GetBone")]
  746. private static extern IntPtr _aiMesh_GetBone(IntPtr ptrMesh, uint uintIndex);
  747. public static IntPtr aiMesh_GetBone(IntPtr ptrMesh, uint uintIndex)
  748. {
  749. return AssimpInterop._aiMesh_GetBone(ptrMesh, uintIndex);
  750. }
  751. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiFace_GetNumIndices")]
  752. private static extern uint _aiFace_GetNumIndices(IntPtr ptrFace);
  753. public static uint aiFace_GetNumIndices(IntPtr ptrFace)
  754. {
  755. return AssimpInterop._aiFace_GetNumIndices(ptrFace);
  756. }
  757. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiFace_GetIndex")]
  758. private static extern uint _aiFace_GetIndex(IntPtr ptrFace, uint uintIndex);
  759. public static uint aiFace_GetIndex(IntPtr ptrFace, uint uintIndex)
  760. {
  761. return AssimpInterop._aiFace_GetIndex(ptrFace, uintIndex);
  762. }
  763. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiBone_GetName")]
  764. private static extern IntPtr _aiBone_GetName(IntPtr ptrBone);
  765. public static string aiBone_GetName(IntPtr ptrBone)
  766. {
  767. IntPtr pointer = AssimpInterop._aiBone_GetName(ptrBone);
  768. return AssimpInterop.ReadStringFromPointer(pointer);
  769. }
  770. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiBone_GetNumWeights")]
  771. private static extern uint _aiBone_GetNumWeights(IntPtr ptrBone);
  772. public static uint aiBone_GetNumWeights(IntPtr ptrBone)
  773. {
  774. return AssimpInterop._aiBone_GetNumWeights(ptrBone);
  775. }
  776. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiBone_GetWeights")]
  777. private static extern IntPtr _aiBone_GetWeights(IntPtr ptrBone, uint uintIndex);
  778. public static IntPtr aiBone_GetWeights(IntPtr ptrBone, uint uintIndex)
  779. {
  780. return AssimpInterop._aiBone_GetWeights(ptrBone, uintIndex);
  781. }
  782. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiBone_GetOffsetMatrix")]
  783. private static extern IntPtr _aiBone_GetOffsetMatrix(IntPtr ptrBone);
  784. public static Matrix4x4 aiBone_GetOffsetMatrix(IntPtr ptrBone)
  785. {
  786. IntPtr pointer = AssimpInterop._aiBone_GetOffsetMatrix(ptrBone);
  787. float[] newFloat16Array = AssimpInterop.GetNewFloat16Array(pointer);
  788. return AssimpInterop.LoadMatrix4x4FromArray(newFloat16Array);
  789. }
  790. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiVertexWeight_GetWeight")]
  791. private static extern float _aiVertexWeight_GetWeight(IntPtr ptrVweight);
  792. public static float aiVertexWeight_GetWeight(IntPtr ptrVweight)
  793. {
  794. return AssimpInterop._aiVertexWeight_GetWeight(ptrVweight);
  795. }
  796. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiVertexWeight_GetVertexId")]
  797. private static extern uint _aiVertexWeight_GetVertexId(IntPtr ptrVweight);
  798. public static uint aiVertexWeight_GetVertexId(IntPtr ptrVweight)
  799. {
  800. return AssimpInterop._aiVertexWeight_GetVertexId(ptrVweight);
  801. }
  802. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiAnimation_GetName")]
  803. private static extern IntPtr _aiAnimation_GetName(IntPtr ptrAnimation);
  804. public static string aiAnimation_GetName(IntPtr ptrAnimation)
  805. {
  806. IntPtr pointer = AssimpInterop._aiAnimation_GetName(ptrAnimation);
  807. return AssimpInterop.ReadStringFromPointer(pointer);
  808. }
  809. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiAnimation_GetDuraction")]
  810. private static extern float _aiAnimation_GetDuraction(IntPtr ptrAnimation);
  811. public static float aiAnimation_GetDuraction(IntPtr ptrAnimation)
  812. {
  813. return AssimpInterop._aiAnimation_GetDuraction(ptrAnimation);
  814. }
  815. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiAnimation_GetTicksPerSecond")]
  816. private static extern float _aiAnimation_GetTicksPerSecond(IntPtr ptrAnimation);
  817. public static float aiAnimation_GetTicksPerSecond(IntPtr ptrAnimation)
  818. {
  819. return AssimpInterop._aiAnimation_GetTicksPerSecond(ptrAnimation);
  820. }
  821. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiAnimation_GetNumChannels")]
  822. private static extern uint _aiAnimation_GetNumChannels(IntPtr ptrAnimation);
  823. public static uint aiAnimation_GetNumChannels(IntPtr ptrAnimation)
  824. {
  825. return AssimpInterop._aiAnimation_GetNumChannels(ptrAnimation);
  826. }
  827. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiAnimation_GetNumMorphChannels")]
  828. private static extern uint _aiAnimation_GetNumMorphChannels(IntPtr ptrAnimation);
  829. public static uint aiAnimation_GetNumMorphChannels(IntPtr ptrAnimation)
  830. {
  831. return AssimpInterop._aiAnimation_GetNumMorphChannels(ptrAnimation);
  832. }
  833. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiAnimation_GetNumMeshChannels")]
  834. private static extern uint _aiAnimation_GetNumMeshChannels(IntPtr ptrAnimation);
  835. public static uint aiAnimation_GetNumMeshChannels(IntPtr ptrAnimation)
  836. {
  837. return AssimpInterop._aiAnimation_GetNumMeshChannels(ptrAnimation);
  838. }
  839. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiAnimation_GetAnimationChannel")]
  840. private static extern IntPtr _aiAnimation_GetAnimationChannel(IntPtr ptrAnimation, uint uintIndex);
  841. public static IntPtr aiAnimation_GetAnimationChannel(IntPtr ptrAnimation, uint uintIndex)
  842. {
  843. return AssimpInterop._aiAnimation_GetAnimationChannel(ptrAnimation, uintIndex);
  844. }
  845. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetNodeName")]
  846. private static extern IntPtr _aiNodeAnim_GetNodeName(IntPtr ptrNodeAnim);
  847. public static string aiNodeAnim_GetNodeName(IntPtr ptrNodeAnim)
  848. {
  849. IntPtr pointer = AssimpInterop._aiNodeAnim_GetNodeName(ptrNodeAnim);
  850. return AssimpInterop.ReadStringFromPointer(pointer);
  851. }
  852. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetNumPositionKeys")]
  853. private static extern uint _aiNodeAnim_GetNumPositionKeys(IntPtr ptrNodeAnim);
  854. public static uint aiNodeAnim_GetNumPositionKeys(IntPtr ptrNodeAnim)
  855. {
  856. return AssimpInterop._aiNodeAnim_GetNumPositionKeys(ptrNodeAnim);
  857. }
  858. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetNumRotationKeys")]
  859. private static extern uint _aiNodeAnim_GetNumRotationKeys(IntPtr ptrNodeAnim);
  860. public static uint aiNodeAnim_GetNumRotationKeys(IntPtr ptrNodeAnim)
  861. {
  862. return AssimpInterop._aiNodeAnim_GetNumRotationKeys(ptrNodeAnim);
  863. }
  864. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetNumScalingKeys")]
  865. private static extern uint _aiNodeAnim_GetNumScalingKeys(IntPtr ptrNodeAnim);
  866. public static uint aiNodeAnim_GetNumScalingKeys(IntPtr ptrNodeAnim)
  867. {
  868. return AssimpInterop._aiNodeAnim_GetNumScalingKeys(ptrNodeAnim);
  869. }
  870. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetPostState")]
  871. private static extern uint _aiNodeAnim_GetPostState(IntPtr ptrNodeAnim);
  872. public static uint aiNodeAnim_GetPostState(IntPtr ptrNodeAnim)
  873. {
  874. return AssimpInterop._aiNodeAnim_GetPostState(ptrNodeAnim);
  875. }
  876. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetPreState")]
  877. private static extern uint _aiNodeAnim_GetPreState(IntPtr ptrNodeAnim);
  878. public static uint aiNodeAnim_GetPreState(IntPtr ptrNodeAnim)
  879. {
  880. return AssimpInterop._aiNodeAnim_GetPreState(ptrNodeAnim);
  881. }
  882. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetPositionKey")]
  883. private static extern IntPtr _aiNodeAnim_GetPositionKey(IntPtr ptrNodeAnim, uint uintIndex);
  884. public static IntPtr aiNodeAnim_GetPositionKey(IntPtr ptrNodeAnim, uint uintIndex)
  885. {
  886. return AssimpInterop._aiNodeAnim_GetPositionKey(ptrNodeAnim, uintIndex);
  887. }
  888. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetRotationKey")]
  889. private static extern IntPtr _aiNodeAnim_GetRotationKey(IntPtr ptrNodeAnim, uint uintIndex);
  890. public static IntPtr aiNodeAnim_GetRotationKey(IntPtr ptrNodeAnim, uint uintIndex)
  891. {
  892. return AssimpInterop._aiNodeAnim_GetRotationKey(ptrNodeAnim, uintIndex);
  893. }
  894. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiNodeAnim_GetScalingKey")]
  895. private static extern IntPtr _aiNodeAnim_GetScalingKey(IntPtr ptrNodeAnim, uint uintIndex);
  896. public static IntPtr aiNodeAnim_GetScalingKey(IntPtr ptrNodeAnim, uint uintIndex)
  897. {
  898. return AssimpInterop._aiNodeAnim_GetScalingKey(ptrNodeAnim, uintIndex);
  899. }
  900. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiVectorKey_GetTime")]
  901. private static extern float _aiVectorKey_GetTime(IntPtr ptrVectorKey);
  902. public static float aiVectorKey_GetTime(IntPtr ptrVectorKey)
  903. {
  904. return AssimpInterop._aiVectorKey_GetTime(ptrVectorKey);
  905. }
  906. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiVectorKey_GetValue")]
  907. private static extern IntPtr _aiVectorKey_GetValue(IntPtr ptrVectorKey);
  908. public static Vector3 aiVectorKey_GetValue(IntPtr ptrVectorKey)
  909. {
  910. IntPtr pointer = AssimpInterop._aiVectorKey_GetValue(ptrVectorKey);
  911. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  912. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  913. }
  914. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiQuatKey_GetTime")]
  915. private static extern float _aiQuatKey_GetTime(IntPtr ptrQuatKey);
  916. public static float aiQuatKey_GetTime(IntPtr ptrQuatKey)
  917. {
  918. return AssimpInterop._aiQuatKey_GetTime(ptrQuatKey);
  919. }
  920. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiQuatKey_GetValue")]
  921. private static extern IntPtr _aiQuatKey_GetValue(IntPtr ptrQuatKey);
  922. public static Quaternion aiQuatKey_GetValue(IntPtr ptrQuatKey)
  923. {
  924. IntPtr pointer = AssimpInterop._aiQuatKey_GetValue(ptrQuatKey);
  925. float[] newFloat4Array = AssimpInterop.GetNewFloat4Array(pointer);
  926. return AssimpInterop.LoadQuaternionFromArray(newFloat4Array);
  927. }
  928. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetAspect")]
  929. private static extern float _aiCamera_GetAspect(IntPtr ptrCamera);
  930. public static float aiCamera_GetAspect(IntPtr ptrCamera)
  931. {
  932. return AssimpInterop._aiCamera_GetAspect(ptrCamera);
  933. }
  934. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetClipPlaneFar")]
  935. private static extern float _aiCamera_GetClipPlaneFar(IntPtr ptrCamera);
  936. public static float aiCamera_GetClipPlaneFar(IntPtr ptrCamera)
  937. {
  938. return AssimpInterop._aiCamera_GetClipPlaneFar(ptrCamera);
  939. }
  940. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetClipPlaneNear")]
  941. private static extern float _aiCamera_GetClipPlaneNear(IntPtr ptrCamera);
  942. public static float aiCamera_GetClipPlaneNear(IntPtr ptrCamera)
  943. {
  944. return AssimpInterop._aiCamera_GetClipPlaneNear(ptrCamera);
  945. }
  946. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetHorizontalFOV")]
  947. private static extern float _aiCamera_GetHorizontalFOV(IntPtr ptrCamera);
  948. public static float aiCamera_GetHorizontalFOV(IntPtr ptrCamera)
  949. {
  950. return AssimpInterop._aiCamera_GetHorizontalFOV(ptrCamera);
  951. }
  952. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetLookAt")]
  953. private static extern IntPtr _aiCamera_GetLookAt(IntPtr ptrCamera);
  954. public static Vector3 aiCamera_GetLookAt(IntPtr ptrCamera)
  955. {
  956. IntPtr pointer = AssimpInterop._aiCamera_GetLookAt(ptrCamera);
  957. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  958. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  959. }
  960. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetName")]
  961. private static extern IntPtr _aiCamera_GetName(IntPtr ptrCamera);
  962. public static string aiCamera_GetName(IntPtr ptrCamera)
  963. {
  964. IntPtr pointer = AssimpInterop._aiCamera_GetName(ptrCamera);
  965. return AssimpInterop.ReadStringFromPointer(pointer);
  966. }
  967. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetPosition")]
  968. private static extern IntPtr _aiCamera_GetPosition(IntPtr ptrCamera);
  969. public static Vector3 aiCamera_GetPosition(IntPtr ptrCamera)
  970. {
  971. IntPtr pointer = AssimpInterop._aiCamera_GetPosition(ptrCamera);
  972. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  973. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  974. }
  975. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiCamera_GetUp")]
  976. private static extern IntPtr _aiCamera_GetUp(IntPtr ptrCamera);
  977. public static Vector3 aiCamera_GetUp(IntPtr ptrCamera)
  978. {
  979. IntPtr pointer = AssimpInterop._aiCamera_GetUp(ptrCamera);
  980. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  981. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  982. }
  983. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetAngleInnerCone")]
  984. private static extern float _aiLight_GetAngleInnerCone(IntPtr ptrLight);
  985. public static float aiLight_GetAngleInnerCone(IntPtr ptrLight)
  986. {
  987. return AssimpInterop._aiLight_GetAngleInnerCone(ptrLight);
  988. }
  989. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetAngleOuterCone")]
  990. private static extern float _aiLight_GetAngleOuterCone(IntPtr ptrLight);
  991. public static float aiLight_GetAngleOuterCone(IntPtr ptrLight)
  992. {
  993. return AssimpInterop._aiLight_GetAngleOuterCone(ptrLight);
  994. }
  995. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetAttenuationConstant")]
  996. private static extern float _aiLight_GetAttenuationConstant(IntPtr ptrLight);
  997. public static float aiLight_GetAttenuationConstant(IntPtr ptrLight)
  998. {
  999. return AssimpInterop._aiLight_GetAttenuationConstant(ptrLight);
  1000. }
  1001. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetAttenuationLinear")]
  1002. private static extern float _aiLight_GetAttenuationLinear(IntPtr ptrLight);
  1003. public static float aiLight_GetAttenuationLinear(IntPtr ptrLight)
  1004. {
  1005. return AssimpInterop._aiLight_GetAttenuationLinear(ptrLight);
  1006. }
  1007. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetAttenuationQuadratic")]
  1008. private static extern float _aiLight_GetAttenuationQuadratic(IntPtr ptrLight);
  1009. public static float aiLight_GetAttenuationQuadratic(IntPtr ptrLight)
  1010. {
  1011. return AssimpInterop._aiLight_GetAttenuationQuadratic(ptrLight);
  1012. }
  1013. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetColorAmbient")]
  1014. private static extern IntPtr _aiLight_GetColorAmbient(IntPtr ptrLight);
  1015. public static Color aiLight_GetColorAmbient(IntPtr ptrLight)
  1016. {
  1017. IntPtr pointer = AssimpInterop._aiLight_GetColorAmbient(ptrLight);
  1018. float[] newFloat4Array = AssimpInterop.GetNewFloat4Array(pointer);
  1019. return AssimpInterop.LoadColorFromArray(newFloat4Array);
  1020. }
  1021. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetColorDiffuse")]
  1022. private static extern IntPtr _aiLight_GetColorDiffuse(IntPtr ptrLight);
  1023. public static Color aiLight_GetColorDiffuse(IntPtr ptrLight)
  1024. {
  1025. IntPtr pointer = AssimpInterop._aiLight_GetColorDiffuse(ptrLight);
  1026. float[] newFloat4Array = AssimpInterop.GetNewFloat4Array(pointer);
  1027. return AssimpInterop.LoadColorFromArray(newFloat4Array);
  1028. }
  1029. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetColorSpecular")]
  1030. private static extern IntPtr _aiLight_GetColorSpecular(IntPtr ptrLight);
  1031. public static Color aiLight_GetColorSpecular(IntPtr ptrLight)
  1032. {
  1033. IntPtr pointer = AssimpInterop._aiLight_GetColorSpecular(ptrLight);
  1034. float[] newFloat4Array = AssimpInterop.GetNewFloat4Array(pointer);
  1035. return AssimpInterop.LoadColorFromArray(newFloat4Array);
  1036. }
  1037. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetDirection")]
  1038. private static extern IntPtr _aiLight_GetDirection(IntPtr ptrLight);
  1039. public static Vector3 aiLight_GetDirection(IntPtr ptrLight)
  1040. {
  1041. IntPtr pointer = AssimpInterop._aiLight_GetDirection(ptrLight);
  1042. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  1043. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  1044. }
  1045. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiLight_GetName")]
  1046. private static extern IntPtr _aiLight_GetName(IntPtr ptrLight);
  1047. public static string aiLight_GetName(IntPtr ptrLight)
  1048. {
  1049. IntPtr pointer = AssimpInterop._aiLight_GetName(ptrLight);
  1050. return AssimpInterop.ReadStringFromPointer(pointer);
  1051. }
  1052. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetMetadataCount")]
  1053. private static extern uint _aiScene_GetMetadataCount(IntPtr ptrScene);
  1054. public static uint aiScene_GetMetadataCount(IntPtr ptrScene)
  1055. {
  1056. return AssimpInterop._aiScene_GetMetadataCount(ptrScene);
  1057. }
  1058. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetMetadataKey")]
  1059. private static extern IntPtr _aiScene_GetMetadataKey(IntPtr ptrScene, uint uintIndex);
  1060. public static string aiScene_GetMetadataKey(IntPtr ptrScene, uint uintIndex)
  1061. {
  1062. IntPtr pointer = AssimpInterop._aiScene_GetMetadataKey(ptrScene, uintIndex);
  1063. return AssimpInterop.ReadStringFromPointer(pointer);
  1064. }
  1065. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetMetadataType")]
  1066. private static extern int _aiScene_GetMetadataType(IntPtr ptrScene, uint uintIndex);
  1067. public static AssimpMetadataType aiScene_GetMetadataType(IntPtr ptrScene, uint uintIndex)
  1068. {
  1069. return (AssimpMetadataType)AssimpInterop._aiScene_GetMetadataType(ptrScene, uintIndex);
  1070. }
  1071. [DllImport("assimp", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi, EntryPoint = "aiScene_GetMetadataValue")]
  1072. private static extern IntPtr _aiScene_GetMetadataValue(IntPtr ptrScene, uint uintIndex);
  1073. public static bool aiScene_GetMetadataBoolValue(IntPtr ptrScene, uint uintIndex)
  1074. {
  1075. IntPtr pointer = AssimpInterop._aiScene_GetMetadataValue(ptrScene, uintIndex);
  1076. return AssimpInterop.GetNewBool(pointer);
  1077. }
  1078. public static int aiScene_GetMetadataInt32Value(IntPtr ptrScene, uint uintIndex)
  1079. {
  1080. IntPtr pointer = AssimpInterop._aiScene_GetMetadataValue(ptrScene, uintIndex);
  1081. return AssimpInterop.GetNewInt32(pointer);
  1082. }
  1083. public static long aiScene_GetMetadataInt64Value(IntPtr ptrScene, uint uintIndex)
  1084. {
  1085. IntPtr pointer = AssimpInterop._aiScene_GetMetadataValue(ptrScene, uintIndex);
  1086. return AssimpInterop.GetNewInt64(pointer);
  1087. }
  1088. public static float aiScene_GetMetadataFloatValue(IntPtr ptrScene, uint uintIndex)
  1089. {
  1090. IntPtr pointer = AssimpInterop._aiScene_GetMetadataValue(ptrScene, uintIndex);
  1091. return AssimpInterop.GetNewFloat(pointer);
  1092. }
  1093. public static double aiScene_GetMetadataDoubleValue(IntPtr ptrScene, uint uintIndex)
  1094. {
  1095. IntPtr pointer = AssimpInterop._aiScene_GetMetadataValue(ptrScene, uintIndex);
  1096. return AssimpInterop.GetNewDouble(pointer);
  1097. }
  1098. public static string aiScene_GetMetadataStringValue(IntPtr ptrScene, uint uintIndex)
  1099. {
  1100. IntPtr pointer = AssimpInterop._aiScene_GetMetadataValue(ptrScene, uintIndex);
  1101. return AssimpInterop.ReadStringFromPointer(pointer);
  1102. }
  1103. public static Vector3 aiScene_GetMetadataVectorValue(IntPtr ptrScene, uint uintIndex)
  1104. {
  1105. IntPtr pointer = AssimpInterop._aiScene_GetMetadataValue(ptrScene, uintIndex);
  1106. float[] newFloat3Array = AssimpInterop.GetNewFloat3Array(pointer);
  1107. return AssimpInterop.LoadVector3FromArray(newFloat3Array);
  1108. }
  1109. public static byte[] StringToByteArray(string str, int length)
  1110. {
  1111. return Encoding.ASCII.GetBytes(str.PadRight(length, '\0'));
  1112. }
  1113. public static GCHandle LockGc(object value)
  1114. {
  1115. return GCHandle.Alloc(value, GCHandleType.Pinned);
  1116. }
  1117. public static GCHandle GetStringBuffer(string value)
  1118. {
  1119. byte[] value2 = AssimpInterop.StringToByteArray(value, 1024);
  1120. return AssimpInterop.LockGc(value2);
  1121. }
  1122. public static string ByteArrayToString(byte[] value)
  1123. {
  1124. int num = Array.IndexOf<byte>(value, 0, 0);
  1125. if (num < 0)
  1126. {
  1127. num = value.Length;
  1128. }
  1129. return Encoding.ASCII.GetString(value, 0, num);
  1130. }
  1131. public static IntPtr GetAssimpStringBuffer(string value)
  1132. {
  1133. int num = (!AssimpInterop.Is32Bits) ? 8 : 4;
  1134. IntPtr intPtr = Marshal.AllocHGlobal(num + value.Length);
  1135. if (AssimpInterop.Is32Bits)
  1136. {
  1137. Marshal.WriteInt32(intPtr, value.Length);
  1138. }
  1139. Marshal.WriteInt64(intPtr, (long)value.Length);
  1140. byte[] bytes = Encoding.ASCII.GetBytes(value);
  1141. Marshal.Copy(bytes, 0, new IntPtr((!AssimpInterop.Is32Bits) ? (intPtr.ToInt64() + (long)num) : ((long)intPtr.ToInt32())), value.Length);
  1142. return intPtr;
  1143. }
  1144. private static GCHandle GetNewStringBuffer(out byte[] byteArray)
  1145. {
  1146. byteArray = new byte[2048];
  1147. return AssimpInterop.LockGc(byteArray);
  1148. }
  1149. private static GCHandle GetNewFloatBuffer(out float value)
  1150. {
  1151. value = 0f;
  1152. return AssimpInterop.LockGc(value);
  1153. }
  1154. private static GCHandle GetNewFloat2Buffer(out float[] array)
  1155. {
  1156. array = new float[2];
  1157. return AssimpInterop.LockGc(array);
  1158. }
  1159. private static GCHandle GetNewFloat3Buffer(out float[] array)
  1160. {
  1161. array = new float[3];
  1162. return AssimpInterop.LockGc(array);
  1163. }
  1164. private static GCHandle GetNewFloat4Buffer(out float[] array)
  1165. {
  1166. array = new float[4];
  1167. return AssimpInterop.LockGc(array);
  1168. }
  1169. private static GCHandle GetNewFloat16Buffer(out float[] array)
  1170. {
  1171. array = new float[16];
  1172. return AssimpInterop.LockGc(array);
  1173. }
  1174. private static GCHandle GetNewUIntBuffer(out uint value)
  1175. {
  1176. value = 0u;
  1177. return AssimpInterop.LockGc(value);
  1178. }
  1179. private static bool GetNewBool(IntPtr pointer)
  1180. {
  1181. return Marshal.ReadByte(pointer) == 1;
  1182. }
  1183. private static int GetNewInt32(IntPtr pointer)
  1184. {
  1185. return Marshal.ReadInt32(pointer);
  1186. }
  1187. private static long GetNewInt64(IntPtr pointer)
  1188. {
  1189. return Marshal.ReadInt64(pointer);
  1190. }
  1191. private static float GetNewFloat(IntPtr pointer)
  1192. {
  1193. float[] array = new float[1];
  1194. Marshal.Copy(pointer, array, 0, 1);
  1195. return array[0];
  1196. }
  1197. private static double GetNewDouble(IntPtr pointer)
  1198. {
  1199. double[] array = new double[1];
  1200. Marshal.Copy(pointer, array, 0, 1);
  1201. return array[0];
  1202. }
  1203. private static float[] GetNewFloat2Array(IntPtr pointer)
  1204. {
  1205. float[] array = new float[2];
  1206. Marshal.Copy(pointer, array, 0, 2);
  1207. return array;
  1208. }
  1209. private static float[] GetNewFloat3Array(IntPtr pointer)
  1210. {
  1211. float[] array = new float[3];
  1212. Marshal.Copy(pointer, array, 0, 3);
  1213. return array;
  1214. }
  1215. private static float[] GetNewFloat4Array(IntPtr pointer)
  1216. {
  1217. float[] array = new float[4];
  1218. Marshal.Copy(pointer, array, 0, 4);
  1219. return array;
  1220. }
  1221. private static float[] GetNewFloat16Array(IntPtr pointer)
  1222. {
  1223. float[] array = new float[16];
  1224. Marshal.Copy(pointer, array, 0, 16);
  1225. return array;
  1226. }
  1227. private static string ReadStringFromPointer(IntPtr pointer)
  1228. {
  1229. return Marshal.PtrToStringAnsi(pointer);
  1230. }
  1231. private static Vector2 LoadVector2FromArray(float[] array)
  1232. {
  1233. return new Vector2(array[0], array[1]);
  1234. }
  1235. private static Vector3 LoadVector3FromArray(float[] array)
  1236. {
  1237. return new Vector3(array[0], array[1], array[2]);
  1238. }
  1239. private static Color LoadColorFromArray(float[] array)
  1240. {
  1241. return new Color(array[0], array[1], array[2], array[3]);
  1242. }
  1243. private static Quaternion LoadQuaternionFromArray(float[] array)
  1244. {
  1245. return new Quaternion(array[1], array[2], array[3], array[0]);
  1246. }
  1247. private static Matrix4x4 LoadMatrix4x4FromArray(float[] array)
  1248. {
  1249. Matrix4x4 result = default(Matrix4x4);
  1250. result[0] = array[0];
  1251. result[1] = array[4];
  1252. result[2] = array[8];
  1253. result[3] = array[12];
  1254. result[4] = array[1];
  1255. result[5] = array[5];
  1256. result[6] = array[9];
  1257. result[7] = array[13];
  1258. result[8] = array[2];
  1259. result[9] = array[6];
  1260. result[10] = array[10];
  1261. result[11] = array[14];
  1262. result[12] = array[3];
  1263. result[13] = array[7];
  1264. result[14] = array[11];
  1265. result[15] = array[15];
  1266. return result;
  1267. }
  1268. private static GCHandle Matrix4x4ToAssimp(Vector3 translation, Vector3 rotation, Vector3 scale)
  1269. {
  1270. Matrix4x4 matrix4x = Matrix4x4.TRS(translation, Quaternion.Euler(rotation), scale);
  1271. float[] array = new float[16];
  1272. array[0] = matrix4x[0];
  1273. array[4] = matrix4x[1];
  1274. array[8] = matrix4x[2];
  1275. array[12] = matrix4x[3];
  1276. array[1] = matrix4x[4];
  1277. array[5] = matrix4x[5];
  1278. array[9] = matrix4x[6];
  1279. array[13] = matrix4x[7];
  1280. array[2] = matrix4x[8];
  1281. array[6] = matrix4x[9];
  1282. array[10] = matrix4x[10];
  1283. array[14] = matrix4x[11];
  1284. array[3] = matrix4x[12];
  1285. array[7] = matrix4x[13];
  1286. array[11] = matrix4x[14];
  1287. array[15] = matrix4x[15];
  1288. return AssimpInterop.LockGc(array);
  1289. }
  1290. public const string DllPath = "assimp";
  1291. private const int MaxStringLength = 1024;
  1292. private const int MaxInputStringLength = 2048;
  1293. private static readonly bool Is32Bits = IntPtr.Size == 4;
  1294. private static readonly int IntSize = (!AssimpInterop.Is32Bits) ? 8 : 4;
  1295. }
  1296. }