common.bmx 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. ' common.bmx
  2. ?ptr64
  3. Const PAD:Int=2 ' 64-bit padding
  4. Const ONE32:Int=0
  5. ?Not ptr64
  6. Const PAD:Int=1
  7. Const ONE32:Int=1
  8. ?
  9. ' config.h
  10. ' Input parameter to the #aiProcess_SortByPType step:
  11. ' Specifies which primitive types are removed by the step
  12. Const AI_CONFIG_PP_SBP_REMOVE:String = "PP_SBP_REMOVE"
  13. ' types.h
  14. ' just for backwards compatibility, don't use these constants anymore
  15. Const AI_SUCCESS:Int = $0
  16. Const AI_FAILURE:Int = -$1
  17. Const AI_OUTOFMEMORY:Int = -$3
  18. Const AI_INVALIDFILE:Int = -$2
  19. Const AI_INVALIDARG:Int = -$4
  20. ' Maximum dimension for strings, ASSIMP strings are zero terminated.
  21. Const MAXLEN:Int = 1024
  22. ' postprocess.h
  23. ' enum aiPostProcessSteps - Defines the flags for all possible post processing step
  24. Const aiProcess_CalcTangentSpace:Int = $1
  25. Const aiProcess_JoinIdenticalVertices:Int = $2
  26. Const aiProcess_MakeLeftHanded:Int = $4
  27. Const aiProcess_Triangulate:Int = $8
  28. Const aiProcess_RemoveComponent:Int = $10
  29. Const aiProcess_GenNormals:Int = $20
  30. Const aiProcess_GenSmoothNormals:Int = $40
  31. Const aiProcess_SplitLargeMeshes:Int = $80
  32. Const aiProcess_PreTransformVertices:Int = $100
  33. Const aiProcess_LimitBoneWeights:Int = $200
  34. Const aiProcess_ValidateDataStructure:Int = $400
  35. Const aiProcess_ImproveCacheLocality:Int = $800
  36. Const aiProcess_RemoveRedundantMaterials:Int = $1000
  37. Const aiProcess_FixInfacingNormals:Int = $2000
  38. Const aiProcess_SortByPType:Int = $8000
  39. Const aiProcess_FindDegenerates:Int = $10000
  40. Const aiProcess_FindInvalidData:Int = $20000
  41. Const aiProcess_GenUVCoords:Int = $40000
  42. Const aiProcess_TransformUVCoords:Int = $80000
  43. Const aiProcess_FindInstances:Int = $100000
  44. Const aiProcess_OptimizeMeshes:Int = $200000
  45. Const aiProcess_OptimizeGraph:Int = $400000
  46. Const aiProcess_FlipUVs:Int = $800000
  47. Const aiProcess_FlipWindingOrder:Int = $1000000
  48. Const aiProcess_SplitByBoneCount:Int = $2000000
  49. Const aiProcess_Debone:Int = $4000000
  50. ' Shortcut to match Direct3D conventions: left-handed geometry, top-left origin for UV coords and clockwise face order
  51. Const aiProcess_ConvertToLeftHanded:Int = aiProcess_MakeLeftHanded | aiProcess_FlipUVs | aiProcess_FlipWindingOrder
  52. ' mesh.h
  53. ' Limits. These values are required to match the settings Assimp was compiled against.
  54. ' Supported number of vertex color sets per mesh
  55. Const AI_MAX_NUMBER_OF_COLOR_SETS:Int = $8
  56. ' Supported number of texture coord sets (UV(W) channels) per mesh
  57. Const AI_MAX_NUMBER_OF_TEXTURECOORDS:Int = $8
  58. ' enum aiPrimitiveType - Enumerates the types of geometric primitives supported by Assimp.
  59. Const aiPrimitiveType_POINT:Int = $1
  60. Const aiPrimitiveType_LINE:Int = $2
  61. Const aiPrimitiveType_TRIANGLE:Int = $4
  62. Const aiPrimitiveType_POLYGON:Int = $8
  63. ' material.h
  64. ' enum aiTextureOp
  65. ' enum aiTextureMapMode
  66. ' enum aiTextureMapping
  67. ' enum aiTextureType - Defines the purpose of a texture
  68. ' Dummy value.
  69. ' No texture, but the value to be used as 'texture semantic' (#aiMaterialProperty::mSemantic)
  70. ' for all material properties *not* related to textures.
  71. Const aiTextureType_NONE:Int = $0
  72. ' The texture is combined with the result of the diffuse lighting equation.
  73. Const aiTextureType_DIFFUSE:Int = $1
  74. ' The texture is combined with the result of the specular lighting equation.
  75. Const aiTextureType_SPECULAR:Int = $2
  76. ' The texture is combined with the result of the ambient lighting equation.
  77. Const aiTextureType_AMBIENT:Int = $3
  78. ' The texture is added to the result of the lighting calculation.
  79. ' It isn't influenced by incoming light.
  80. Const aiTextureType_EMISSIVE:Int = $4
  81. ' The texture is a height map.
  82. ' By convention, higher grey-scale values stand for higher elevations from the base height.
  83. Const aiTextureType_HEIGHT:Int = $5
  84. ' The texture is a (tangent space) normal-map.
  85. ' Again, there are several conventions for tangent-space normal maps.
  86. ' Assimp does (intentionally) not differenciate here.
  87. Const aiTextureType_NORMALS:Int = $6
  88. ' The texture defines the glossiness of the material.
  89. ' The glossiness is in fact the exponent of the specular (phong) lighting equation.
  90. ' Usually there is a conversion function defined to map the linear color values in the texture
  91. ' to a suitable exponent. Have fun.
  92. Const aiTextureType_SHININESS:Int = $7
  93. ' The texture defines per-pixel opacity.
  94. ' Usually 'white' means opaque and 'black' means 'transparency'. Or quite the opposite. Have fun.
  95. Const aiTextureType_OPACITY:Int = $8
  96. ' Displacement texture.
  97. ' The exact purpose and format is application-dependent.
  98. ' Higher color values stand for higher vertex displacements.
  99. Const aiTextureType_DISPLACEMENT:Int = $9
  100. ' Lightmap texture (aka Ambient Occlusion).
  101. ' Both 'Lightmaps' and dedicated 'ambient occlusion maps' are covered by this material property.
  102. ' The texture contains a scaling value for the final color value of a pixel.
  103. ' It's intensity is not affected by incoming light.
  104. Const aiTextureType_LIGHTMAP:Int = $A
  105. ' Reflection texture.
  106. ' Contains the color of a perfect mirror reflection.
  107. ' Rarely used, almost never for real-time applications.
  108. Const aiTextureType_REFLECTION:Int = $B
  109. ' Unknown texture.
  110. ' A texture reference that does not match any of the definitions above is considered to be 'unknown'.
  111. ' It is still imported, but is excluded from any further postprocessing.
  112. Const aiTextureType_UNKNOWN:Int = $C
  113. ' enum aiShadingMode
  114. ' enum aiTextureFlags
  115. ' enum aiBlendMode
  116. ' enum aiPropertyTypeInfo - material property buffer content type
  117. Const aiPTI_Float:Int = $1
  118. Const aiPTI_String:Int = $3
  119. Const aiPTI_Integer:Int = $4
  120. Const aiPTI_Buffer:Int = $5
  121. ' a few of the many matkey constants
  122. Const AI_MATKEY_NAME:String = "?mat.name"
  123. Const AI_MATKEY_TWOSIDED:String = "$mat.twosided"
  124. Const AI_MATKEY_OPACITY:String = "$mat.opacity"
  125. Const AI_MATKEY_SHININESS:String = "$mat.shininess"
  126. Const AI_MATKEY_COLOR_DIFFUSE:String = "$clr.diffuse"
  127. Const AI_MATKEY_COLOR_AMBIENT:String = "$clr.ambient"
  128. Const AI_MATKEY_COLOR_SPECULAR:String = "$clr.specular"
  129. Const AI_MATKEY_COLOR_EMISSIVE:String = "$clr.emissive"
  130. Const AI_MATKEY_COLOR_TRANSPARENT:String = "$clr.transparent"
  131. Const AI_MATKEY_COLOR_REFLECTIVE:String = "$clr.reflective"
  132. ' Pure key names for all texture-related properties
  133. Const AI_MATKEY_TEXTURE_BASE:String = "$tex.file"
  134. Const AI_MATKEY_UVWSRC_BASE:String = "$tex.uvwsrc"
  135. Const AI_MATKEY_TEXOP_BASE:String = "$tex.op"
  136. Const AI_MATKEY_MAPPING_BASE:String = "$tex.mapping"
  137. Const AI_MATKEY_TEXBLEND_BASE:String = "$tex.blend"
  138. Const AI_MATKEY_MAPPINGMODE_U_BASE:String = "$tex.mapmodeu"
  139. Const AI_MATKEY_MAPPINGMODE_V_BASE:String = "$tex.mapmodev"
  140. Const AI_MATKEY_TEXMAP_AXIS_BASE:String = "$tex.mapaxis"
  141. Const AI_MATKEY_UVTRANSFORM_BASE:String = "$tex.uvtrafo"
  142. Const AI_MATKEY_TEXFLAGS_BASE:String = "$tex.flags"
  143. Extern
  144. ' Assimp.cpp
  145. Rem
  146. bbdoc: Reads the given file and returns its content.
  147. about: See <a href="http://assimp.sourceforge.net/lib_html/class_assimp_1_1_importer.html">Assimp.cpp</a>
  148. and <a href="http://assimp.sourceforge.net/lib_html/cimport_8h.html">cimport.h</a>.
  149. End Rem
  150. Function aiImportFile:Byte Ptr( pFile$z, pFlags:Int ) = "aiImportFile"
  151. Rem
  152. bbdoc: Reads the given file from a given memory buffer.
  153. about: See <a href="http://assimp.sourceforge.net/lib_html/class_assimp_1_1_importer.html">Assimp.cpp</a>
  154. and <a href="http://assimp.sourceforge.net/lib_html/cimport_8h.html">cimport.h</a>.
  155. End Rem
  156. Function aiImportFileFromMemory:Byte Ptr( pBuffer:Byte Ptr,pLength:Int,pFlags:Int,pHint$z ) = "aiImportFileFromMemory"
  157. Rem
  158. bbdoc: Releases all resources associated with the given import process.
  159. about: See <a href="http://assimp.sourceforge.net/lib_html/class_assimp_1_1_importer.html">Assimp.cpp</a>
  160. and <a href="http://assimp.sourceforge.net/lib_html/cimport_8h.html">cimport.h</a>.
  161. End Rem
  162. Function aiReleaseImport( pScene:Byte Ptr ) = "aiReleaseImport"
  163. ' see assimplib.bmx
  164. Function aiIsExtensionSupported_:Int( pFile$z ) = "aiIsExtensionSupported"
  165. ' MaterialSystem.cpp
  166. Rem
  167. bbdoc: Get a color (3 or 4 floats) from the material.
  168. about: See <a href="http://assimp.sourceforge.net/lib_html/structai_material.html">MaterialSystem.cpp</a>
  169. and <a href="http://assimp.sourceforge.net/lib_html/material_8h.html">material.h</a>.
  170. End Rem
  171. Function aiGetMaterialColor:Int( pMat:Byte Ptr, pKey$z, iType:Int, ..
  172. index:Int, pOut:Byte Ptr ) = "aiGetMaterialColor"
  173. Rem
  174. bbdoc: Get a string from the material.
  175. about: See <a href="http://assimp.sourceforge.net/lib_html/structai_material.html">MaterialSystem.cpp</a>
  176. and <a href="http://assimp.sourceforge.net/lib_html/material_8h.html">material.h</a>.
  177. End Rem
  178. Function aiGetMaterialString:Int( pMat:Byte Ptr, pKey$z, iType:Int, ..
  179. index:Int, pOut:Byte Ptr ) = "aiGetMaterialString"
  180. Rem
  181. bbdoc: Get an array of integer values from the material.
  182. about: See <a href="http://assimp.sourceforge.net/lib_html/structai_material.html">MaterialSystem.cpp</a>
  183. and <a href="http://assimp.sourceforge.net/lib_html/material_8h.html">material.h</a>.
  184. End Rem
  185. Function aiGetMaterialIntegerArray:Int( pMat:Byte Ptr, pKey$z, iType:Int, ..
  186. index:Int, pOut:Int Ptr, pMax:Int Ptr ) = "aiGetMaterialIntegerArray"
  187. Rem
  188. bbdoc: Get an array of floating-point values from the material.
  189. about: See <a href="http://assimp.sourceforge.net/lib_html/structai_material.html">MaterialSystem.cpp</a>
  190. and <a href="http://assimp.sourceforge.net/lib_html/material_8h.html">material.h</a>.
  191. End Rem
  192. Function aiGetMaterialFloatArray:Int( pMat:Byte Ptr, pKey$z, iType:Int, ..
  193. index:Int, pOut:Float Ptr, pMax:Int Ptr ) = "aiGetMaterialFloatArray"
  194. Rem
  195. bbdoc: Get all values pertaining to a particular texture slot from the material.
  196. about: See <a href="http://assimp.sourceforge.net/lib_html/structai_material.html">MaterialSystem.cpp</a>
  197. and <a href="http://assimp.sourceforge.net/lib_html/material_8h.html">material.h</a>.
  198. End Rem
  199. Function aiGetMaterialTexture:Int( pMat:Byte Ptr, texType:Int, index:Int, path:Byte Ptr, ..
  200. mapping:Byte Ptr=Null, uvindex:Int Ptr=Null, blend:Float Ptr=Null, ..
  201. op:Byte Ptr=Null, mapmode:Byte Ptr=Null, flags:Int Ptr=Null ) = "aiGetMaterialTexture"
  202. Rem
  203. bbdoc: Get the number of textures for a particular texture type.
  204. about: See <a href="http://assimp.sourceforge.net/lib_html/structai_material.html">MaterialSystem.cpp</a>
  205. and <a href="http://assimp.sourceforge.net/lib_html/material_8h.html">material.h</a>.
  206. End Rem
  207. Function aiGetMaterialTextureCount:Int( pMat:Byte Ptr, texType:Int ) = "aiGetMaterialTextureCount"
  208. End Extern