PrimitiveMesh.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="PrimitiveMesh" inherits="Mesh" version="3.4">
  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 [CapsuleMesh], [CubeMesh], [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. </return>
  15. <description>
  16. 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:
  17. [codeblock]
  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. [/codeblock]
  22. </description>
  23. </method>
  24. </methods>
  25. <members>
  26. <member name="custom_aabb" type="AABB" setter="set_custom_aabb" getter="get_custom_aabb" default="AABB( 0, 0, 0, 0, 0, 0 )">
  27. 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.
  28. </member>
  29. <member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false">
  30. If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn.
  31. This gives the same result as using [constant SpatialMaterial.CULL_BACK] in [member SpatialMaterial.params_cull_mode].
  32. </member>
  33. <member name="material" type="Material" setter="set_material" getter="get_material">
  34. The current [Material] of the primitive mesh.
  35. </member>
  36. </members>
  37. <constants>
  38. </constants>
  39. </class>