aiConfig.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. /*
  2. ---------------------------------------------------------------------------
  3. Open Asset Import Library (ASSIMP)
  4. ---------------------------------------------------------------------------
  5. Copyright (c) 2006-2008, ASSIMP Development Team
  6. All rights reserved.
  7. Redistribution and use of this software in source and binary forms,
  8. with or without modification, are permitted provided that the following
  9. conditions are met:
  10. * Redistributions of source code must retain the above
  11. copyright notice, this list of conditions and the
  12. following disclaimer.
  13. * Redistributions in binary form must reproduce the above
  14. copyright notice, this list of conditions and the
  15. following disclaimer in the documentation and/or other
  16. materials provided with the distribution.
  17. * Neither the name of the ASSIMP team, nor the names of its
  18. contributors may be used to endorse or promote products
  19. derived from this software without specific prior
  20. written permission of the ASSIMP Development Team.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ---------------------------------------------------------------------------
  33. */
  34. /** @file Defines constants for configurable properties and helper
  35. functions to determine the version of the Assimp library being used */
  36. #ifndef __AI_CONFIG_H_INC__
  37. #define __AI_CONFIG_H_INC__
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41. // ---------------------------------------------------------------------------
  42. /** Returns a string with legal copyright and licensing information
  43. * about Assimp.
  44. *
  45. * @return Never NULL
  46. */
  47. ASSIMP_API const char* aiGetLegalString ();
  48. // ---------------------------------------------------------------------------
  49. /** Returns the current minor version number of Assimp.
  50. *
  51. * @return Minor version of the Assimp runtime the application was
  52. * linked/built against
  53. */
  54. ASSIMP_API unsigned int aiGetVersionMinor ();
  55. // ---------------------------------------------------------------------------
  56. /** Returns the current major version number of Assimp.
  57. *
  58. * @return Major version of the Assimp runtime the application was
  59. * linked/built against
  60. */
  61. ASSIMP_API unsigned int aiGetVersionMajor ();
  62. // ---------------------------------------------------------------------------
  63. /** Returns the repository revision of the Assimp runtime.
  64. *
  65. * @return Repository revision number of the Assimp runtime the application
  66. * was linked/built against
  67. */
  68. ASSIMP_API unsigned int aiGetVersionRevision ();
  69. #ifdef __cplusplus
  70. } // end extern "C"
  71. #endif
  72. // ---------------------------------------------------------------------------
  73. /** \brief Set the maximum number of vertices in a mesh.
  74. *
  75. * This is used by the "SplitLargeMeshes" PostProcess-Step to determine
  76. * whether a mesh must be splitted or not.
  77. * \note The default value is AI_SLM_DEFAULT_MAX_VERTICES, defined in
  78. * the internal header file SplitLargeMeshes.h
  79. * Property type: integer.
  80. */
  81. #define AI_CONFIG_PP_SLM_TRIANGLE_LIMIT "pp.slm.triangle_limit"
  82. // ---------------------------------------------------------------------------
  83. /** \brief Set the maximum number of triangles in a mesh.
  84. *
  85. * This is used by the "SplitLargeMeshes" PostProcess-Step to determine
  86. * whether a mesh must be splitted or not.
  87. * \note The default value is AI_SLM_DEFAULT_MAX_TRIANGLES, defined in
  88. * the internal header file SplitLargeMeshes.h
  89. * Property type: integer.
  90. */
  91. #define AI_CONFIG_PP_SLM_VERTEX_LIMIT "pp.slm.vertex_limit"
  92. // ---------------------------------------------------------------------------
  93. /** \brief Set the maximum number of bones affecting a single vertex
  94. *
  95. * This is used by the aiProcess_LimitBoneWeights PostProcess-Step.
  96. * \note The default value is AI_LBW_MAX_WEIGHTS, defined in
  97. * the internal header file LimitBoneWeightsProcess.h
  98. * Property type: integer.
  99. */
  100. #define AI_CONFIG_PP_LBW_MAX_WEIGHTS "pp.lbw.weights_limit"
  101. // ---------------------------------------------------------------------------
  102. /** \brief Set the vertex animation keyframe to be imported
  103. *
  104. * ASSIMP does not support vertex keyframes (only bone animation is supported).
  105. * The library reads only one frame of models with vertex animations.
  106. * By default this is the first frame´.
  107. * \note The default value is 0. This option applies to all importers.
  108. * However, it is also possible to override the global setting
  109. * for a specific loader. You can use the AI_CONFIG_IMPORT_XXX_KEYFRAME
  110. * options (where XXX is a placeholder for the file format for which you
  111. * want to override the global setting).
  112. * Property type: integer.
  113. */
  114. #define AI_CONFIG_IMPORT_GLOBAL_KEYFRAME "imp.global.kf"
  115. #define AI_CONFIG_IMPORT_MD3_KEYFRAME "imp.md3.kf"
  116. #define AI_CONFIG_IMPORT_MD2_KEYFRAME "imp.md2.kf"
  117. #define AI_CONFIG_IMPORT_MDL_KEYFRAME "imp.mdl.kf"
  118. #define AI_CONFIG_IMPORT_MDC_KEYFRAME "imp.mdc.kf"
  119. #define AI_CONFIG_IMPORT_MDR_KEYFRAME "imp.mdr.kf"
  120. #define AI_CONFIG_IMPORT_SMD_KEYFRAME "imp.smd.kf"
  121. // ---------------------------------------------------------------------------
  122. /** \brief Configures the AC loader to collect all surfaces which have the
  123. * "Backface cull" flag set in separate meshes.
  124. *
  125. * Property type: integer (0: false; !0: true). Default value: true.
  126. */
  127. #define AI_CONFIG_IMPORT_AC_SEPARATE_BFCULL "imp.ac.sepbfcull"
  128. // ---------------------------------------------------------------------------
  129. /** \brief Configures the ASE loader to always reconstruct normal vectors
  130. * basing on the smoothing groups loaded from the file.
  131. *
  132. * Many ASE files have invalid normals (they're not orthonormal). This
  133. * is the fault of 3DS Max ASE exporter.
  134. * Property type: integer (0: false; !0: true). Default value: false.
  135. */
  136. #define AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS "imp.ase.reconn"
  137. // ---------------------------------------------------------------------------
  138. /** \brief Configures the LWO loader to load just one layer from the model.
  139. *
  140. * LWO files consist of layers and in some cases it could be useful to load
  141. * only one of them. This property can be either a string - which specifies
  142. * the name of the layer - or an integer - the index of the layer. If the
  143. * property is not set the whole LWO model is loaded. Loading fails if the
  144. * requested layer is not available. The layer index is zero-based and the
  145. * layer name may not be empty.
  146. */
  147. #define AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY "imp.lwo.layer"
  148. // ---------------------------------------------------------------------------
  149. /** \brief Defines the output frame rate of the IRR loader.
  150. *
  151. * IRR animations are difficult to convert for Assimp and there will
  152. * always be a loss of quality. This setting defines how many keys per second
  153. * the converter will compute.<br>
  154. * Property type: integer. Default value: 100
  155. */
  156. #define AI_CONFIG_IMPORT_IRR_ANIM_FPS "imp.irr.fps"
  157. // ---------------------------------------------------------------------------
  158. /** \brief Specifies the maximum angle that may be between two vertex tangents
  159. * that their tangents and bitangents are smoothed.
  160. *
  161. * This applies to the CalcTangentSpace-Step. The angle is specified
  162. * in degrees, so 180 is PI. The default value is
  163. * 45 degrees. The maximum value is 175.
  164. * Property type: float.
  165. */
  166. #define AI_CONFIG_PP_CT_MAX_SMOOTHING_ANGLE "pp.ct.max_smoothing"
  167. // ---------------------------------------------------------------------------
  168. /** \brief Specifies the maximum angle that may be between two face normals
  169. * at the same vertex position that their are smoothed.
  170. *
  171. * This applies to the GenSmoothNormals-Step. The angle is specified
  172. * in degrees, so 180 is PI. The default value is
  173. * 175 degrees (all vertex normals are smoothed). The maximum value is 175
  174. * Property type: float. Warning: seting this option may cause a severe
  175. * loss of performance.
  176. */
  177. #define AI_CONFIG_PP_GSN_MAX_SMOOTHING_ANGLE "pp.gsn.max_smoothing"
  178. // ---------------------------------------------------------------------------
  179. /** \brief Specifies the minimum number of faces a node should have.
  180. * This is an input parameter to the OptimizeGraph-Step.
  181. *
  182. * Nodes whose referenced meshes have less faces than this value
  183. * are propably joined with neighbors with identical local matrices.
  184. * However, it is just a hint to the step.
  185. * Property type: integer
  186. */
  187. #define AI_CONFIG_PP_OG_MIN_NUM_FACES "pp.og.min_faces"
  188. // ---------------------------------------------------------------------------
  189. /** \brief Specifies whether the OptimizeGraphProcess joins nodes even if
  190. * their local transformations are inequal.
  191. *
  192. * By default, nodes with different local transformations are never joined.
  193. * The intention is that all vertices should remain in their original
  194. * local coordinate space where they are correctly centered and aligned,
  195. * which does also allow for some significant culling improvements.
  196. */
  197. #define AI_CONFIG_PP_OG_JOIN_INEQUAL_TRANSFORMS "pp.og.allow_diffwm"
  198. // ---------------------------------------------------------------------------
  199. /** \brief Sets the colormap (= palette) to be used to decode embedded
  200. * textures in MDL (Quake or 3DGS) files.
  201. *
  202. * This must be a valid path to a file. The file is 768 (256*3) bytes
  203. * large and contains RGB triplets for each of the 256 palette entries.
  204. * The default value is colormap.lmp. If the file is not found,
  205. * a default palette (from Quake 1) is used.
  206. * Property type: string.
  207. */
  208. #define AI_CONFIG_IMPORT_MDL_COLORMAP "imp.mdl.color_map"
  209. // ---------------------------------------------------------------------------
  210. /** \brief Enumerates components of the aiScene and aiMesh data structures
  211. * that can be excluded from the import with the RemoveComponent step.
  212. *
  213. * See the documentation to #aiProcess_RemoveComment for more details.
  214. */
  215. enum aiComponent
  216. {
  217. //! Normal vectors
  218. aiComponent_NORMALS = 0x2u,
  219. //! Tangents and bitangents go always together ...
  220. aiComponent_TANGENTS_AND_BITANGENTS = 0x4u,
  221. //! ALL color sets
  222. //! Use aiComponent_COLORn(N) to specifiy the N'th set
  223. aiComponent_COLORS = 0x8,
  224. //! ALL texture UV sets
  225. //! aiComponent_TEXCOORDn(N) to specifiy the N'th set
  226. aiComponent_TEXCOORDS = 0x10,
  227. //! Removes all bone weights from all meshes.
  228. //! The scenegraph nodes corresponding to the
  229. //! bones are removed
  230. aiComponent_BONEWEIGHTS = 0x20,
  231. //! Removes all bone animations (aiScene::mAnimations)
  232. aiComponent_ANIMATIONS = 0x40,
  233. //! Removes all embedded textures (aiScene::mTextures)
  234. aiComponent_TEXTURES = 0x80,
  235. //! Removes all light sources (aiScene::mLights)
  236. //! The scenegraph nodes corresponding to the
  237. //! light sources are removed.
  238. aiComponent_LIGHTS = 0x100,
  239. //! Removes all light sources (aiScene::mCameras)
  240. //! The scenegraph nodes corresponding to the
  241. //! cameras are removed.
  242. aiComponent_CAMERAS = 0x200,
  243. //! Removes all meshes (aiScene::mMeshes).
  244. aiComponent_MESHES = 0x400,
  245. //! Removes all materials. One default material will
  246. //! be generated, so aiScene::mNumMaterials will be 1.
  247. //! This makes no real sense without the aiComponent_TEXTURES flag.
  248. aiComponent_MATERIALS = 0x800,
  249. /** This value is not used. It is just there to force the
  250. * compiler to map this enum to a 32 Bit integer.
  251. */
  252. _aiComponent_Force32Bit = 0x9fffffff
  253. };
  254. #define aiComponent_COLORSn(n) (1u << (n+20u))
  255. #define aiComponent_TEXCOORDSn(n) (1u << (n+25u))
  256. // ---------------------------------------------------------------------------
  257. /** \brief Input parameter to the #aiProcess_RemoveComponent step:
  258. * Specifies the parts of the data structure to be removed.
  259. *
  260. * See the documentation to this step for further details. The property
  261. * is expected to be an integer, a bitwise combination of the
  262. * #aiComponent flags defined above in this header. The default
  263. * value is 0. Important: if no valid mesh is remaining after the
  264. * step has been executed (e.g you thought it was funny to specify ALL
  265. * of the flags defined above) the import FAILS. Mainly because there is
  266. * no data to work on anymore ...
  267. */
  268. #define AI_CONFIG_PP_RVC_FLAGS "pp.rvc.flags"
  269. // ---------------------------------------------------------------------------
  270. /** \brief Input parameter to the #aiProcess_SortByPType step:
  271. * Specifies which primitive types are removed by the step.
  272. *
  273. * This is a bitwise combination of the aiPrimitiveType flags.
  274. * Specifying all of them is illegal, of course. A typical use would
  275. * be to easily exclude all line and point meshes from the import. This
  276. * is an integer property, its default value is 0.
  277. */
  278. #define AI_CONFIG_PP_SBP_REMOVE "pp.sbp.remove"
  279. #define AI_UVTRAFO_SCALING 0x1
  280. #define AI_UVTRAFO_ROTATION 0x2
  281. #define AI_UVTRAFO_TRANSLATION 0x4
  282. #define AI_UVTRAFO_ALL (AI_UVTRAFO_SCALING | AI_UVTRAFO_ROTATION | AI_UVTRAFO_TRANSLATION)
  283. // ---------------------------------------------------------------------------
  284. /** \brief Input parameter to the #aiProcess_TransformUVCoords step:
  285. * Specifies which UV transformations are evaluated.
  286. *
  287. * This is a bitwise combination of the AI_UVTRAFO_XXX flags (integer
  288. * property, of course). By default all transformations are enabled
  289. * (AI_UVTRAFO_ALL).
  290. */
  291. #define AI_CONFIG_PP_TUV_EVALUATE "pp.tuv.process"
  292. // ---------------------------------------------------------------------------
  293. /** \brief Causes assimp to favour speed against import quality.
  294. *
  295. * Enabling this option may result in faster loading, but it needn't.
  296. * It represents just a hint to loaders and post-processing steps to use
  297. * faster code paths, if possible.
  298. * This property is expected to be an integer, != 0 stands for true.
  299. * The default value is 0.
  300. */
  301. #define AI_CONFIG_FAVOUR_SPEED "imp.speed_flag"
  302. #endif // !! AI_CONFIG_H_INC