2
0

aiPostProcess.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. Open Asset Import Library (ASSIMP)
  3. ----------------------------------------------------------------------
  4. Copyright (c) 2006-2008, ASSIMP Development Team
  5. All rights reserved.
  6. Redistribution and use of this software in source and binary forms,
  7. with or without modification, are permitted provided that the
  8. following conditions are met:
  9. * Redistributions of source code must retain the above
  10. copyright notice, this list of conditions and the
  11. following disclaimer.
  12. * Redistributions in binary form must reproduce the above
  13. copyright notice, this list of conditions and the
  14. following disclaimer in the documentation and/or other
  15. materials provided with the distribution.
  16. * Neither the name of the ASSIMP team, nor the names of its
  17. contributors may be used to endorse or promote products
  18. derived from this software without specific prior
  19. written permission of the ASSIMP Development Team.
  20. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. ----------------------------------------------------------------------
  32. */
  33. /** @file Definitions for import post processing steps */
  34. #ifndef AI_POSTPROCESS_H_INC
  35. #define AI_POSTPROCESS_H_INC
  36. #include "aiTypes.h"
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40. /** Defines the flags for all possible post processing steps. */
  41. enum aiPostProcessSteps
  42. {
  43. /** Calculates the tangents and bitangents for the imported meshes. Does nothing
  44. * if a mesh does not have normals. You might want this post processing step to be
  45. * executed if you plan to use tangent space calculations such as normal mapping
  46. * applied to the meshes.
  47. */
  48. aiProcess_CalcTangentSpace = 1,
  49. /** Identifies and joins identical vertex data sets within all imported meshes.
  50. * After this step is run each mesh does contain only unique vertices anymore,
  51. * so a vertex is possibly used by multiple faces. You propably always want
  52. * to use this post processing step.*/
  53. aiProcess_JoinIdenticalVertices = 2,
  54. /** Converts all the imported data to a left-handed coordinate space such as
  55. * the DirectX coordinate system. By default the data is returned in a right-handed
  56. * coordinate space which for example OpenGL prefers. In this space, +X points to the
  57. * right, +Y points towards the viewer and and +Z points upwards. In the DirectX
  58. * coordinate space +X points to the right, +Y points upwards and +Z points
  59. * away from the viewer.
  60. */
  61. aiProcess_ConvertToLeftHanded = 4,
  62. /** Triangulates all faces of all meshes. By default the imported mesh data might
  63. * contain faces with more than 3 indices. For rendering a mesh you usually need
  64. * all faces to be triangles. This post processing step splits up all higher faces
  65. * to triangles.
  66. */
  67. aiProcess_Triangulate = 8,
  68. /** Omits all normals found in the file. This can be used together
  69. * with either the aiProcess_GenNormals or the aiProcess_GenSmoothNormals
  70. * flag to force the recomputation of the normals.
  71. */
  72. aiProcess_KillNormals = 0x10,
  73. /** Generates normals for all faces of all meshes. The normals are shared
  74. * between the three vertices of a face. This is ignored
  75. * if normals are already existing. This flag may not be specified together
  76. * with aiProcess_GenSmoothNormals
  77. */
  78. aiProcess_GenNormals = 0x20,
  79. /** Generates smooth normals for all vertices in the mesh. This is ignored
  80. * if normals are already existing. This flag may not be specified together
  81. * with aiProcess_GenNormals
  82. */
  83. aiProcess_GenSmoothNormals = 0x40,
  84. /** Splits large meshes into submeshes
  85. * This is quite useful for realtime rendering where the number of vertices
  86. * is usually limited by the video driver.
  87. *
  88. * The split limits can be set through aiSetVertexSplitLimit() and
  89. * aiSetTriangleSplitLimit(). The default values for this are defined
  90. * in the internal SplitLargeMeshes.h header as AI_SLM_DEFAULT_MAX_VERTICES
  91. * and AI_SLM_DEFAULT_MAX_TRIANGLES.
  92. */
  93. aiProcess_SplitLargeMeshes = 0x80,
  94. /** Removes the node graph and pretransforms all vertices with
  95. * the local transformation matrices of their nodes. The output
  96. * scene does still contain nodes, however, there is only a
  97. * root node with childs, each one referencing only one mesh,
  98. * each mesh referencing one material. For rendering, you can
  99. * simply render all meshes in order, you don't need to pay
  100. * attention to local transformations and the node hierarchy.
  101. * Animations are removed during this step.
  102. * This step is intended for applications that have no scenegraph.
  103. * The step CAN cause some problems: if e.g. a mesh of the asset
  104. * contains normals and another, using the same material index, does not,
  105. * they will be brought together, but the first meshes's part of
  106. * the normal list will be zeroed.
  107. */
  108. aiProcess_PreTransformVertices = 0x100,
  109. };
  110. // ---------------------------------------------------------------------------
  111. /** \brief Set the maximum number of vertices in a mesh.
  112. *
  113. * This is used by the SplitLargeMeshes PostProcess-Step to determine
  114. * whether a mesh must be splitted or not.
  115. * \param pLimit Vertex limit.
  116. * \note The default value is AI_SLM_DEFAULT_MAX_VERTICES, defined in
  117. * the internal header file SplitLargeMeshes.h
  118. */
  119. aiReturn aiSetVertexSplitLimit(unsigned int pLimit);
  120. // ---------------------------------------------------------------------------
  121. /** \brief Set the maximum number of triangles in a mesh.
  122. *
  123. * This is used by the SplitLargeMeshes PostProcess-Step to determine
  124. * whether a mesh must be splitted or not.
  125. * \param pLimit Triangle limit
  126. * \note The default value is AI_SLM_DEFAULT_MAX_TRIANGLES, defined in
  127. * the internal header file SplitLargeMeshes.h
  128. */
  129. aiReturn aiSetTriangleSplitLimit(unsigned int pLimit);
  130. #ifdef __cplusplus
  131. } // end of extern "C"
  132. #endif
  133. #endif // AI_POSTPROCESS_H_INC