summaryrefslogtreecommitdiff
path: root/doc/classes/Plane.xml
blob: fb48219f46d2b8c842cedf1fb5f2a29762dbe3ff (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Plane" category="Built-In Types" version="3.2">
	<brief_description>
		Plane in hessian form.
	</brief_description>
	<description>
		Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
	</description>
	<tutorials>
		<link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link>
	</tutorials>
	<methods>
		<method name="Plane">
			<return type="Plane">
			</return>
			<argument index="0" name="a" type="float">
			</argument>
			<argument index="1" name="b" type="float">
			</argument>
			<argument index="2" name="c" type="float">
			</argument>
			<argument index="3" name="d" type="float">
			</argument>
			<description>
				Creates a plane from the four parameters. The three components of the resulting plane's [member normal] are [code]a[/code], [code]b[/code] and [code]c[/code], and the plane has a distance of [code]d[/code] from the origin.
			</description>
		</method>
		<method name="Plane">
			<return type="Plane">
			</return>
			<argument index="0" name="v1" type="Vector3">
			</argument>
			<argument index="1" name="v2" type="Vector3">
			</argument>
			<argument index="2" name="v3" type="Vector3">
			</argument>
			<description>
				Creates a plane from the three points, given in clockwise order.
			</description>
		</method>
		<method name="Plane">
			<return type="Plane">
			</return>
			<argument index="0" name="normal" type="Vector3">
			</argument>
			<argument index="1" name="d" type="float">
			</argument>
			<description>
				Creates a plane from the normal and the plane's distance to the origin.
			</description>
		</method>
		<method name="center">
			<return type="Vector3">
			</return>
			<description>
				Returns the center of the plane.
			</description>
		</method>
		<method name="distance_to">
			<return type="float">
			</return>
			<argument index="0" name="point" type="Vector3">
			</argument>
			<description>
				Returns the shortest distance from the plane to the position [code]point[/code].
			</description>
		</method>
		<method name="get_any_point">
			<return type="Vector3">
			</return>
			<description>
				Returns a point on the plane.
			</description>
		</method>
		<method name="has_point">
			<return type="bool">
			</return>
			<argument index="0" name="point" type="Vector3">
			</argument>
			<argument index="1" name="epsilon" type="float" default="0.00001">
			</argument>
			<description>
				Returns [code]true[/code] if [code]point[/code] is inside the plane (by a very minimum [code]epsilon[/code] threshold).
			</description>
		</method>
		<method name="intersect_3">
			<return type="Vector3">
			</return>
			<argument index="0" name="b" type="Plane">
			</argument>
			<argument index="1" name="c" type="Plane">
			</argument>
			<description>
				Returns the intersection point of the three planes [code]b[/code], [code]c[/code] and this plane. If no intersection is found, [code]null[/code] is returned.
			</description>
		</method>
		<method name="intersects_ray">
			<return type="Vector3">
			</return>
			<argument index="0" name="from" type="Vector3">
			</argument>
			<argument index="1" name="dir" type="Vector3">
			</argument>
			<description>
				Returns the intersection point of a ray consisting of the position [code]from[/code] and the direction normal [code]dir[/code] with this plane. If no intersection is found, [code]null[/code] is returned.
			</description>
		</method>
		<method name="intersects_segment">
			<return type="Vector3">
			</return>
			<argument index="0" name="begin" type="Vector3">
			</argument>
			<argument index="1" name="end" type="Vector3">
			</argument>
			<description>
				Returns the intersection point of a segment from position [code]begin[/code] to position [code]end[/code] with this plane. If no intersection is found, [code]null[/code] is returned.
			</description>
		</method>
		<method name="is_equal_approx">
			<return type="bool">
			</return>
			<argument index="0" name="plane" type="Plane">
			</argument>
			<description>
				Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GDScript.is_equal_approx] on each component.
			</description>
		</method>
		<method name="is_point_over">
			<return type="bool">
			</return>
			<argument index="0" name="point" type="Vector3">
			</argument>
			<description>
				Returns [code]true[/code] if [code]point[/code] is located above the plane.
			</description>
		</method>
		<method name="normalized">
			<return type="Plane">
			</return>
			<description>
				Returns a copy of the plane, normalized.
			</description>
		</method>
		<method name="project">
			<return type="Vector3">
			</return>
			<argument index="0" name="point" type="Vector3">
			</argument>
			<description>
				Returns the orthogonal projection of point [code]p[/code] into a point in the plane.
			</description>
		</method>
	</methods>
	<members>
		<member name="d" type="float" setter="" getter="" default="0.0">
			Distance from the origin to the plane, in the direction of [member normal].
		</member>
		<member name="normal" type="Vector3" setter="" getter="" default="Vector3( 0, 0, 0 )">
			The normal of the plane. "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
		</member>
		<member name="x" type="float" setter="" getter="" default="0.0">
			The [member normal]'s X component.
		</member>
		<member name="y" type="float" setter="" getter="" default="0.0">
			The [member normal]'s Y component.
		</member>
		<member name="z" type="float" setter="" getter="" default="0.0">
			The [member normal]'s Z component.
		</member>
	</members>
	<constants>
		<constant name="PLANE_YZ" value="Plane( 1, 0, 0, 0 )">
			A plane that extends in the Y and Z axes.
		</constant>
		<constant name="PLANE_XZ" value="Plane( 0, 1, 0, 0 )">
			A plane that extends in the X and Z axes.
		</constant>
		<constant name="PLANE_XY" value="Plane( 0, 0, 1, 0 )">
			A plane that extends in the X and Y axes.
		</constant>
	</constants>
</class>