summaryrefslogtreecommitdiff
path: root/modules/csg/doc_classes/CSGShape3D.xml
blob: f5031064d67687284486084cd0b364aee21d218e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CSGShape3D" inherits="GeometryInstance3D" version="4.0">
	<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.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="get_collision_layer_value" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="layer_number" type="int" />
			<description>
				Returns whether or not the specified layer of the [member collision_layer] is enabled, given a [code]layer_number[/code] between 1 and 32.
			</description>
		</method>
		<method name="get_collision_mask_value" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="layer_number" type="int" />
			<description>
				Returns whether or not the specified layer of the [member collision_mask] is enabled, given a [code]layer_number[/code] 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.
			</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" />
			<argument index="0" name="layer_number" type="int" />
			<argument index="1" name="value" type="bool" />
			<description>
				Based on [code]value[/code], enables or disables the specified layer in the [member collision_layer], given a [code]layer_number[/code] between 1 and 32.
			</description>
		</method>
		<method name="set_collision_mask_value">
			<return type="void" />
			<argument index="0" name="layer_number" type="int" />
			<argument index="1" name="value" type="bool" />
			<description>
				Based on [code]value[/code], enables or disables the specified layer in the [member collision_mask], given a [code]layer_number[/code] 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 maps. This is only applied on the root shape, this setting is ignored on any child.
		</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. 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="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" default="0.001">
			Snap makes the mesh snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust.
		</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.
		</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>