initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
21
modules/csg/doc_classes/CSGBox3D.xml
Normal file
21
modules/csg/doc_classes/CSGBox3D.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGBox3D" inherits="CSGPrimitive3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A CSG Box shape.
|
||||
</brief_description>
|
||||
<description>
|
||||
This node allows you to create a box for use with the CSG system.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="material" type="Material" setter="set_material" getter="get_material">
|
||||
The material used to render the box.
|
||||
</member>
|
||||
<member name="size" type="Vector3" setter="set_size" getter="get_size" default="Vector3(1, 1, 1)">
|
||||
The box's width, height and depth.
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
13
modules/csg/doc_classes/CSGCombiner3D.xml
Normal file
13
modules/csg/doc_classes/CSGCombiner3D.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGCombiner3D" inherits="CSGShape3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A CSG node that allows you to combine other CSG modifiers.
|
||||
</brief_description>
|
||||
<description>
|
||||
For complex arrangements of shapes, it is sometimes needed to add structure to your CSG nodes. The CSGCombiner3D node allows you to create this structure. The node encapsulates the result of the CSG operations of its children. In this way, it is possible to do operations on one set of shapes that are children of one CSGCombiner3D node, and a set of separate operations on a second set of shapes that are children of a second CSGCombiner3D node, and then do an operation that takes the two end results as its input to create the final shape.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
</class>
|
33
modules/csg/doc_classes/CSGCylinder3D.xml
Normal file
33
modules/csg/doc_classes/CSGCylinder3D.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGCylinder3D" inherits="CSGPrimitive3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A CSG Cylinder shape.
|
||||
</brief_description>
|
||||
<description>
|
||||
This node allows you to create a cylinder (or cone) for use with the CSG system.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="cone" type="bool" setter="set_cone" getter="is_cone" default="false">
|
||||
If [code]true[/code] a cone is created, the [member radius] will only apply to one side.
|
||||
</member>
|
||||
<member name="height" type="float" setter="set_height" getter="get_height" default="2.0">
|
||||
The height of the cylinder.
|
||||
</member>
|
||||
<member name="material" type="Material" setter="set_material" getter="get_material">
|
||||
The material used to render the cylinder.
|
||||
</member>
|
||||
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.5">
|
||||
The radius of the cylinder.
|
||||
</member>
|
||||
<member name="sides" type="int" setter="set_sides" getter="get_sides" default="8">
|
||||
The number of sides of the cylinder, the higher this number the more detail there will be in the cylinder.
|
||||
</member>
|
||||
<member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces" default="true">
|
||||
If [code]true[/code] the normals of the cylinder are set to give a smooth effect making the cylinder seem rounded. If [code]false[/code] the cylinder will have a flat shaded look.
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
24
modules/csg/doc_classes/CSGMesh3D.xml
Normal file
24
modules/csg/doc_classes/CSGMesh3D.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGMesh3D" inherits="CSGPrimitive3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A CSG Mesh shape that uses a mesh resource.
|
||||
</brief_description>
|
||||
<description>
|
||||
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.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="material" type="Material" setter="set_material" getter="get_material">
|
||||
The [Material] used in drawing the CSG shape.
|
||||
</member>
|
||||
<member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh">
|
||||
The [Mesh] resource to use as a CSG shape.
|
||||
[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.
|
||||
[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.
|
||||
[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.
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
95
modules/csg/doc_classes/CSGPolygon3D.xml
Normal file
95
modules/csg/doc_classes/CSGPolygon3D.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGPolygon3D" inherits="CSGPrimitive3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Extrudes a 2D polygon shape to create a 3D mesh.
|
||||
</brief_description>
|
||||
<description>
|
||||
An array of 2D points is extruded to quickly and easily create a variety of 3D meshes. See also [CSGMesh3D] for using 3D meshes as CSG nodes.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="depth" type="float" setter="set_depth" getter="get_depth" default="1.0">
|
||||
When [member mode] is [constant MODE_DEPTH], the depth of the extrusion.
|
||||
</member>
|
||||
<member name="material" type="Material" setter="set_material" getter="get_material">
|
||||
Material to use for the resulting mesh. The UV maps the top half of the material to the extruded shape (U along the length of the extrusions and V around the outline of the [member polygon]), the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face.
|
||||
</member>
|
||||
<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="CSGPolygon3D.Mode" default="0">
|
||||
The [member mode] used to extrude the [member polygon].
|
||||
</member>
|
||||
<member name="path_continuous_u" type="bool" setter="set_path_continuous_u" getter="is_path_continuous_u">
|
||||
When [member mode] is [constant MODE_PATH], by default, the top half of the [member material] is stretched along the entire length of the extruded shape. If [code]false[/code] the top half of the material is repeated every step of the extrusion.
|
||||
</member>
|
||||
<member name="path_interval" type="float" setter="set_path_interval" getter="get_path_interval">
|
||||
When [member mode] is [constant MODE_PATH], the path interval or ratio of path points to extrusions.
|
||||
</member>
|
||||
<member name="path_interval_type" type="int" setter="set_path_interval_type" getter="get_path_interval_type" enum="CSGPolygon3D.PathIntervalType">
|
||||
When [member mode] is [constant MODE_PATH], this will determine if the interval should be by distance ([constant PATH_INTERVAL_DISTANCE]) or subdivision fractions ([constant PATH_INTERVAL_SUBDIVIDE]).
|
||||
</member>
|
||||
<member name="path_joined" type="bool" setter="set_path_joined" getter="is_path_joined">
|
||||
When [member mode] is [constant MODE_PATH], if [code]true[/code] the ends of the path are joined, by adding an extrusion between the last and first points of the path.
|
||||
</member>
|
||||
<member name="path_local" type="bool" setter="set_path_local" getter="is_path_local">
|
||||
When [member mode] is [constant MODE_PATH], if [code]true[/code] the [Transform3D] of the [CSGPolygon3D] is used as the starting point for the extrusions, not the [Transform3D] of the [member path_node].
|
||||
</member>
|
||||
<member name="path_node" type="NodePath" setter="set_path_node" getter="get_path_node">
|
||||
When [member mode] is [constant MODE_PATH], the location of the [Path3D] object used to extrude the [member polygon].
|
||||
</member>
|
||||
<member name="path_rotation" type="int" setter="set_path_rotation" getter="get_path_rotation" enum="CSGPolygon3D.PathRotation">
|
||||
When [member mode] is [constant MODE_PATH], the path rotation method used to rotate the [member polygon] as it is extruded.
|
||||
</member>
|
||||
<member name="path_rotation_accurate" type="bool" setter="set_path_rotation_accurate" getter="get_path_rotation_accurate">
|
||||
When [member mode] is [constant MODE_PATH], if [code]true[/code] the polygon will be rotated according to the proper tangent of the path at the sampled points. If [code]false[/code] an approximation is used, which decreases in accuracy as the number of subdivisions decreases.
|
||||
</member>
|
||||
<member name="path_simplify_angle" type="float" setter="set_path_simplify_angle" getter="get_path_simplify_angle">
|
||||
When [member mode] is [constant MODE_PATH], extrusions that are less than this angle, will be merged together to reduce polygon count.
|
||||
</member>
|
||||
<member name="path_u_distance" type="float" setter="set_path_u_distance" getter="get_path_u_distance">
|
||||
When [member mode] is [constant MODE_PATH], this is the distance along the path, in meters, the texture coordinates will tile. When set to 0, texture coordinates will match geometry exactly with no tiling.
|
||||
</member>
|
||||
<member name="polygon" type="PackedVector2Array" setter="set_polygon" getter="get_polygon" default="PackedVector2Array(0, 0, 0, 1, 1, 1, 1, 0)">
|
||||
The point array that defines the 2D polygon that is extruded. This can be a convex or concave polygon with 3 or more points. The polygon must [i]not[/i] have any intersecting edges. Otherwise, triangulation will fail and no mesh will be generated.
|
||||
[b]Note:[/b] If only 1 or 2 points are defined in [member polygon], no mesh will be generated.
|
||||
</member>
|
||||
<member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces" default="false">
|
||||
If [code]true[/code], applies smooth shading to the extrusions.
|
||||
</member>
|
||||
<member name="spin_degrees" type="float" setter="set_spin_degrees" getter="get_spin_degrees">
|
||||
When [member mode] is [constant MODE_SPIN], the total number of degrees the [member polygon] is rotated when extruding.
|
||||
</member>
|
||||
<member name="spin_sides" type="int" setter="set_spin_sides" getter="get_spin_sides">
|
||||
When [member mode] is [constant MODE_SPIN], the number of extrusions made.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="MODE_DEPTH" value="0" enum="Mode">
|
||||
The [member polygon] shape is extruded along the negative Z axis.
|
||||
</constant>
|
||||
<constant name="MODE_SPIN" value="1" enum="Mode">
|
||||
The [member polygon] shape is extruded by rotating it around the Y axis.
|
||||
</constant>
|
||||
<constant name="MODE_PATH" value="2" enum="Mode">
|
||||
The [member polygon] shape is extruded along the [Path3D] specified in [member path_node].
|
||||
</constant>
|
||||
<constant name="PATH_ROTATION_POLYGON" value="0" enum="PathRotation">
|
||||
The [member polygon] shape is not rotated.
|
||||
[b]Note:[/b] Requires the path Z coordinates to continually decrease to ensure viable shapes.
|
||||
</constant>
|
||||
<constant name="PATH_ROTATION_PATH" value="1" enum="PathRotation">
|
||||
The [member polygon] shape is rotated along the path, but it is not rotated around the path axis.
|
||||
[b]Note:[/b] Requires the path Z coordinates to continually decrease to ensure viable shapes.
|
||||
</constant>
|
||||
<constant name="PATH_ROTATION_PATH_FOLLOW" value="2" enum="PathRotation">
|
||||
The [member polygon] shape follows the path and its rotations around the path axis.
|
||||
</constant>
|
||||
<constant name="PATH_INTERVAL_DISTANCE" value="0" enum="PathIntervalType">
|
||||
When [member mode] is set to [constant MODE_PATH], [member path_interval] will determine the distance, in meters, each interval of the path will extrude.
|
||||
</constant>
|
||||
<constant name="PATH_INTERVAL_SUBDIVIDE" value="1" enum="PathIntervalType">
|
||||
When [member mode] is set to [constant MODE_PATH], [member path_interval] will subdivide the polygons along the path.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
18
modules/csg/doc_classes/CSGPrimitive3D.xml
Normal file
18
modules/csg/doc_classes/CSGPrimitive3D.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGPrimitive3D" inherits="CSGShape3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Base class for CSG primitives.
|
||||
</brief_description>
|
||||
<description>
|
||||
Parent class for various CSG primitives. It contains code and functionality that is common between them. It cannot be used directly. Instead use one of the various classes that inherit from it.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="flip_faces" type="bool" setter="set_flip_faces" getter="get_flip_faces" default="false">
|
||||
If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn.
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
112
modules/csg/doc_classes/CSGShape3D.xml
Normal file
112
modules/csg/doc_classes/CSGShape3D.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGShape3D" inherits="GeometryInstance3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
The CSG base class.
|
||||
</brief_description>
|
||||
<description>
|
||||
This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot.
|
||||
[b]Performance:[/b] CSG nodes are only intended for prototyping as they have a significant CPU performance cost. Consider baking final CSG operation results into static geometry that replaces the CSG nodes.
|
||||
Individual CSG root node results can be baked to nodes with static resources with the editor menu that appears when a CSG root node is selected.
|
||||
Individual CSG root nodes can also be baked to static resources with scripts by calling [method bake_static_mesh] for the visual mesh or [method bake_collision_shape] for the physics collision.
|
||||
Entire scenes of CSG nodes can be baked to static geometry and exported with the editor glTF scene exporter: [b]Scene > Export As... > glTF 2.0 Scene...[/b]
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<methods>
|
||||
<method name="bake_collision_shape">
|
||||
<return type="ConcavePolygonShape3D" />
|
||||
<description>
|
||||
Returns a baked physics [ConcavePolygonShape3D] of this node's CSG operation result. Returns an empty shape if the node is not a CSG root node or has no valid geometry.
|
||||
[b]Performance:[/b] If the CSG operation results in a very detailed geometry with many faces physics performance will be very slow. Concave shapes should in general only be used for static level geometry and not with dynamic objects that are moving.
|
||||
[b]Note:[/b] CSG mesh data updates are deferred, which means they are updated with a delay of one rendered frame. To avoid getting an empty shape or outdated mesh data, make sure to call [code]await get_tree().process_frame[/code] before using [method bake_collision_shape] in [method Node._ready] or after changing properties on the [CSGShape3D].
|
||||
</description>
|
||||
</method>
|
||||
<method name="bake_static_mesh">
|
||||
<return type="ArrayMesh" />
|
||||
<description>
|
||||
Returns a baked static [ArrayMesh] of this node's CSG operation result. Materials from involved CSG nodes are added as extra mesh surfaces. Returns an empty mesh if the node is not a CSG root node or has no valid geometry.
|
||||
[b]Note:[/b] CSG mesh data updates are deferred, which means they are updated with a delay of one rendered frame. To avoid getting an empty mesh or outdated mesh data, make sure to call [code]await get_tree().process_frame[/code] before using [method bake_static_mesh] in [method Node._ready] or after changing properties on the [CSGShape3D].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_collision_layer_value" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="layer_number" type="int" />
|
||||
<description>
|
||||
Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [param layer_number] between 1 and 32.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_collision_mask_value" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="layer_number" type="int" />
|
||||
<description>
|
||||
Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [param layer_number] between 1 and 32.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_meshes" qualifiers="const">
|
||||
<return type="Array" />
|
||||
<description>
|
||||
Returns an [Array] with two elements, the first is the [Transform3D] of this node and the second is the root [Mesh] of this node. Only works when this node is the root shape.
|
||||
[b]Note:[/b] CSG mesh data updates are deferred, which means they are updated with a delay of one rendered frame. To avoid getting an empty shape or outdated mesh data, make sure to call [code]await get_tree().process_frame[/code] before using [method get_meshes] in [method Node._ready] or after changing properties on the [CSGShape3D].
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_root_shape" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if this is a root shape and is thus the object that is rendered.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_collision_layer_value">
|
||||
<return type="void" />
|
||||
<param index="0" name="layer_number" type="int" />
|
||||
<param index="1" name="value" type="bool" />
|
||||
<description>
|
||||
Based on [param value], enables or disables the specified layer in the [member collision_layer], given a [param layer_number] between 1 and 32.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_collision_mask_value">
|
||||
<return type="void" />
|
||||
<param index="0" name="layer_number" type="int" />
|
||||
<param index="1" name="value" type="bool" />
|
||||
<description>
|
||||
Based on [param value], enables or disables the specified layer in the [member collision_mask], given a [param layer_number] between 1 and 32.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="calculate_tangents" type="bool" setter="set_calculate_tangents" getter="is_calculating_tangents" default="true">
|
||||
Calculate tangents for the CSG shape which allows the use of normal and height maps. This is only applied on the root shape, this setting is ignored on any child. Setting this to [code]false[/code] can speed up shape generation slightly.
|
||||
</member>
|
||||
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
|
||||
The physics layers this area is in.
|
||||
Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
|
||||
A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
|
||||
</member>
|
||||
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
|
||||
The physics layers this CSG shape scans for collisions. Only effective if [member use_collision] is [code]true[/code]. See [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
|
||||
</member>
|
||||
<member name="collision_priority" type="float" setter="set_collision_priority" getter="get_collision_priority" default="1.0">
|
||||
The priority used to solve colliding when occurring penetration. Only effective if [member use_collision] is [code]true[/code]. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level.
|
||||
</member>
|
||||
<member name="operation" type="int" setter="set_operation" getter="get_operation" enum="CSGShape3D.Operation" default="0">
|
||||
The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent.
|
||||
</member>
|
||||
<member name="snap" type="float" setter="set_snap" getter="get_snap" deprecated="The CSG library no longer uses snapping.">
|
||||
This property does nothing.
|
||||
</member>
|
||||
<member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision" default="false">
|
||||
Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. See also [member collision_mask] and [member collision_priority].
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="OPERATION_UNION" value="0" enum="Operation">
|
||||
Geometry of both primitives is merged, intersecting geometry is removed.
|
||||
</constant>
|
||||
<constant name="OPERATION_INTERSECTION" value="1" enum="Operation">
|
||||
Only intersecting geometry remains, the rest is removed.
|
||||
</constant>
|
||||
<constant name="OPERATION_SUBTRACTION" value="2" enum="Operation">
|
||||
The second shape is subtracted from the first, leaving a dent with its shape.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
30
modules/csg/doc_classes/CSGSphere3D.xml
Normal file
30
modules/csg/doc_classes/CSGSphere3D.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGSphere3D" inherits="CSGPrimitive3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A CSG Sphere shape.
|
||||
</brief_description>
|
||||
<description>
|
||||
This node allows you to create a sphere for use with the CSG system.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="material" type="Material" setter="set_material" getter="get_material">
|
||||
The material used to render the sphere.
|
||||
</member>
|
||||
<member name="radial_segments" type="int" setter="set_radial_segments" getter="get_radial_segments" default="12">
|
||||
Number of vertical slices for the sphere.
|
||||
</member>
|
||||
<member name="radius" type="float" setter="set_radius" getter="get_radius" default="0.5">
|
||||
Radius of the sphere.
|
||||
</member>
|
||||
<member name="rings" type="int" setter="set_rings" getter="get_rings" default="6">
|
||||
Number of horizontal slices for the sphere.
|
||||
</member>
|
||||
<member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces" default="true">
|
||||
If [code]true[/code] the normals of the sphere are set to give a smooth effect making the sphere seem rounded. If [code]false[/code] the sphere will have a flat shaded look.
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
33
modules/csg/doc_classes/CSGTorus3D.xml
Normal file
33
modules/csg/doc_classes/CSGTorus3D.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="CSGTorus3D" inherits="CSGPrimitive3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A CSG Torus shape.
|
||||
</brief_description>
|
||||
<description>
|
||||
This node allows you to create a torus for use with the CSG system.
|
||||
[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.
|
||||
</description>
|
||||
<tutorials>
|
||||
<link title="Prototyping levels with CSG">$DOCS_URL/tutorials/3d/csg_tools.html</link>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="inner_radius" type="float" setter="set_inner_radius" getter="get_inner_radius" default="0.5">
|
||||
The inner radius of the torus.
|
||||
</member>
|
||||
<member name="material" type="Material" setter="set_material" getter="get_material">
|
||||
The material used to render the torus.
|
||||
</member>
|
||||
<member name="outer_radius" type="float" setter="set_outer_radius" getter="get_outer_radius" default="1.0">
|
||||
The outer radius of the torus.
|
||||
</member>
|
||||
<member name="ring_sides" type="int" setter="set_ring_sides" getter="get_ring_sides" default="6">
|
||||
The number of edges each ring of the torus is constructed of.
|
||||
</member>
|
||||
<member name="sides" type="int" setter="set_sides" getter="get_sides" default="8">
|
||||
The number of slices the torus is constructed of.
|
||||
</member>
|
||||
<member name="smooth_faces" type="bool" setter="set_smooth_faces" getter="get_smooth_faces" default="true">
|
||||
If [code]true[/code] the normals of the torus are set to give a smooth effect making the torus seem rounded. If [code]false[/code] the torus will have a flat shaded look.
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
Reference in New Issue
Block a user