0.2.0-dev Download ZIP
24 lines ·2.2 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="CSGMesh3D" inherits="CSGPrimitive3D" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> |
| 3 | <brief_description> |
| 4 | A CSG Mesh shape that uses a mesh resource. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | This CSG node allows you to use any mesh resource as a CSG shape, provided it is [i]manifold[/i]. A manifold shape is closed, does not self-intersect, does not contain internal faces and has no edges that connect to more than two faces. See also [CSGPolygon3D] for drawing 2D extruded polygons to be used as CSG nodes. |
| 8 | [b]Note:[/b] CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. |
| 9 | </description> |
| 10 | <tutorials> |
| 11 | <link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link> |
| 12 | </tutorials> |
| 13 | <members> |
| 14 | <member name="material" type="Material" setter="set_material" getter="get_material"> |
| 15 | The [Material] used in drawing the CSG shape. |
| 16 | </member> |
| 17 | <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> |
| 18 | The [Mesh] resource to use as a CSG shape. |
| 19 | [b]Note:[/b] Some [Mesh] types such as [PlaneMesh], [PointMesh], [QuadMesh], and [RibbonTrailMesh] are excluded from the type hint for this property, as these primitives are non-[i]manifold[/i] and thus not compatible with the CSG algorithm. |
| 20 | [b]Note:[/b] When using an [ArrayMesh], all vertex attributes except [constant Mesh.ARRAY_VERTEX], [constant Mesh.ARRAY_NORMAL] and [constant Mesh.ARRAY_TEX_UV] are left unused. Only [constant Mesh.ARRAY_VERTEX] and [constant Mesh.ARRAY_TEX_UV] will be passed to the GPU. |
| 21 | [constant Mesh.ARRAY_NORMAL] is only used to determine which faces require the use of flat shading. By default, CSGMesh will ignore the mesh's vertex normals, recalculate them for each vertex and use a smooth shader. If a flat shader is required for a face, ensure that all vertex normals of the face are approximately equal. |
| 22 | </member> |
| 23 | </members> |
| 24 | </class> |