PrimitiveMesh.xml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PrimitiveMesh" inherits="Mesh" version="4.0">
  3. <brief_description>
  4. Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh.
  5. </brief_description>
  6. <description>
  7. Base class for all primitive meshes. Handles applying a [Material] to a primitive mesh. Examples include [BoxMesh], [CapsuleMesh], [CylinderMesh], [PlaneMesh], [PrismMesh], [QuadMesh], and [SphereMesh].
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="get_mesh_arrays" qualifiers="const">
  13. <return type="Array" />
  14. <description>
  15. Returns mesh arrays used to constitute surface of [Mesh]. The result can be passed to [method ArrayMesh.add_surface_from_arrays] to create a new surface. For example:
  16. [codeblocks]
  17. [gdscript]
  18. var c = CylinderMesh.new()
  19. var arr_mesh = ArrayMesh.new()
  20. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays())
  21. [/gdscript]
  22. [csharp]
  23. var c = new CylinderMesh();
  24. var arrMesh = new ArrayMesh();
  25. arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, c.GetMeshArrays());
  26. [/csharp]
  27. [/codeblocks]
  28. </description>
  29. </method>
  30. </methods>
  31. <members>
  32. <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB(0, 0, 0, 0, 0, 0)">
  33. Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
  34. </member>
  35. <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false">
  36. If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn.
  37. This gives the same result as using [constant BaseMaterial3D.CULL_BACK] in [member BaseMaterial3D.cull_mode].
  38. </member>
  39. <member name="material" type="Material" setter="set_material" getter="get_material">
  40. The current [Material] of the primitive mesh.
  41. </member>
  42. </members>
  43. </class>