class_mesh.rst 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the Mesh.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_Mesh:
  5. Mesh
  6. ====
  7. **Inherits:** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Inherited By:** :ref:`ArrayMesh<class_arraymesh>`, :ref:`PrimitiveMesh<class_primitivemesh>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A :ref:`Resource<class_resource>` that contains vertex-array based geometry.
  13. Member Functions
  14. ----------------
  15. +--------------------------------------------------+-----------------------------------------------------------------------------------------------------+
  16. | :ref:`Shape<class_shape>` | :ref:`create_convex_shape<class_Mesh_create_convex_shape>` **(** **)** const |
  17. +--------------------------------------------------+-----------------------------------------------------------------------------------------------------+
  18. | :ref:`Mesh<class_mesh>` | :ref:`create_outline<class_Mesh_create_outline>` **(** :ref:`float<class_float>` margin **)** const |
  19. +--------------------------------------------------+-----------------------------------------------------------------------------------------------------+
  20. | :ref:`Shape<class_shape>` | :ref:`create_trimesh_shape<class_Mesh_create_trimesh_shape>` **(** **)** const |
  21. +--------------------------------------------------+-----------------------------------------------------------------------------------------------------+
  22. | :ref:`TriangleMesh<class_trianglemesh>` | :ref:`generate_triangle_mesh<class_Mesh_generate_triangle_mesh>` **(** **)** const |
  23. +--------------------------------------------------+-----------------------------------------------------------------------------------------------------+
  24. | :ref:`PoolVector3Array<class_poolvector3array>` | :ref:`get_faces<class_Mesh_get_faces>` **(** **)** const |
  25. +--------------------------------------------------+-----------------------------------------------------------------------------------------------------+
  26. Member Variables
  27. ----------------
  28. .. _class_Mesh_lightmap_size_hint:
  29. - :ref:`Vector2<class_vector2>` **lightmap_size_hint**
  30. Enums
  31. -----
  32. .. _enum_Mesh_BlendShapeMode:
  33. enum **BlendShapeMode**
  34. - **BLEND_SHAPE_MODE_NORMALIZED** = **0**
  35. - **BLEND_SHAPE_MODE_RELATIVE** = **1**
  36. .. _enum_Mesh_ArrayType:
  37. enum **ArrayType**
  38. - **ARRAY_VERTEX** = **0**
  39. - **ARRAY_NORMAL** = **1**
  40. - **ARRAY_TANGENT** = **2**
  41. - **ARRAY_COLOR** = **3**
  42. - **ARRAY_TEX_UV** = **4**
  43. - **ARRAY_TEX_UV2** = **5**
  44. - **ARRAY_BONES** = **6**
  45. - **ARRAY_WEIGHTS** = **7**
  46. - **ARRAY_INDEX** = **8**
  47. - **ARRAY_MAX** = **9**
  48. .. _enum_Mesh_ArrayFormat:
  49. enum **ArrayFormat**
  50. - **ARRAY_FORMAT_VERTEX** = **1**
  51. - **ARRAY_FORMAT_NORMAL** = **2**
  52. - **ARRAY_FORMAT_TANGENT** = **4**
  53. - **ARRAY_FORMAT_COLOR** = **8**
  54. - **ARRAY_FORMAT_TEX_UV** = **16**
  55. - **ARRAY_FORMAT_TEX_UV2** = **32**
  56. - **ARRAY_FORMAT_BONES** = **64**
  57. - **ARRAY_FORMAT_WEIGHTS** = **128**
  58. - **ARRAY_FORMAT_INDEX** = **256**
  59. - **ARRAY_COMPRESS_BASE** = **9**
  60. - **ARRAY_COMPRESS_VERTEX** = **512**
  61. - **ARRAY_COMPRESS_NORMAL** = **1024**
  62. - **ARRAY_COMPRESS_TANGENT** = **2048**
  63. - **ARRAY_COMPRESS_COLOR** = **4096**
  64. - **ARRAY_COMPRESS_TEX_UV** = **8192**
  65. - **ARRAY_COMPRESS_TEX_UV2** = **16384**
  66. - **ARRAY_COMPRESS_BONES** = **32768**
  67. - **ARRAY_COMPRESS_WEIGHTS** = **65536**
  68. - **ARRAY_COMPRESS_INDEX** = **131072**
  69. - **ARRAY_FLAG_USE_2D_VERTICES** = **262144**
  70. - **ARRAY_FLAG_USE_16_BIT_BONES** = **524288**
  71. - **ARRAY_COMPRESS_DEFAULT** = **97792**
  72. .. _enum_Mesh_PrimitiveType:
  73. enum **PrimitiveType**
  74. - **PRIMITIVE_POINTS** = **0** --- Render array as points (one vertex equals one point).
  75. - **PRIMITIVE_LINES** = **1** --- Render array as lines (every two vertices a line is created).
  76. - **PRIMITIVE_LINE_STRIP** = **2** --- Render array as line strip.
  77. - **PRIMITIVE_LINE_LOOP** = **3** --- Render array as line loop (like line strip, but closed).
  78. - **PRIMITIVE_TRIANGLES** = **4** --- Render array as triangles (every three vertices a triangle is created).
  79. - **PRIMITIVE_TRIANGLE_STRIP** = **5** --- Render array as triangle strips.
  80. - **PRIMITIVE_TRIANGLE_FAN** = **6** --- Render array as triangle fans.
  81. Description
  82. -----------
  83. Mesh is a type of :ref:`Resource<class_resource>` that contains vertex-array based geometry, divided in *surfaces*. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
  84. Member Function Description
  85. ---------------------------
  86. .. _class_Mesh_create_convex_shape:
  87. - :ref:`Shape<class_shape>` **create_convex_shape** **(** **)** const
  88. Calculate a :ref:`ConvexPolygonShape<class_convexpolygonshape>` from the mesh.
  89. .. _class_Mesh_create_outline:
  90. - :ref:`Mesh<class_mesh>` **create_outline** **(** :ref:`float<class_float>` margin **)** const
  91. Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise).
  92. .. _class_Mesh_create_trimesh_shape:
  93. - :ref:`Shape<class_shape>` **create_trimesh_shape** **(** **)** const
  94. Calculate a :ref:`ConcavePolygonShape<class_concavepolygonshape>` from the mesh.
  95. .. _class_Mesh_generate_triangle_mesh:
  96. - :ref:`TriangleMesh<class_trianglemesh>` **generate_triangle_mesh** **(** **)** const
  97. Generate a :ref:`TriangleMesh<class_trianglemesh>` from the mesh.
  98. .. _class_Mesh_get_faces:
  99. - :ref:`PoolVector3Array<class_poolvector3array>` **get_faces** **(** **)** const
  100. Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.