Debian Codegraph @

doc/classes/Plane.xml

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <class name="Plane" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A plane in Hessian normal form.
5 </brief_description>
6 <description>
7 Represents a normalized plane equation. [member normal] is the normal of the plane (a, b, c normalized), and [member 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.
8 </description>
9 <tutorials>
10 <link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link>
11 </tutorials>
12 <constructors>
13 <constructor name="Plane">
14 <return type="Plane" />
15 <description>
16 Constructs a default-initialized [Plane] with all components set to [code]0[/code].
17 </description>
18 </constructor>
19 <constructor name="Plane">
20 <return type="Plane" />
21 <param index="0" name="from" type="Plane" />
22 <description>
23 Constructs a [Plane] as a copy of the given [Plane].
24 </description>
25 </constructor>
26 <constructor name="Plane">
27 <return type="Plane" />
28 <param index="0" name="a" type="float" />
29 <param index="1" name="b" type="float" />
30 <param index="2" name="c" type="float" />
31 <param index="3" name="d" type="float" />
32 <description>
33 Creates a plane from the four parameters. The three components of the resulting plane's [member normal] are [param a], [param b] and [param c], and the plane has a distance of [param d] from the origin.
34 </description>
35 </constructor>
36 <constructor name="Plane">
37 <return type="Plane" />
38 <param index="0" name="normal" type="Vector3" />
39 <description>
40 Creates a plane from the normal vector. The plane will intersect the origin.
41 The [param normal] of the plane must be a unit vector.
42 </description>
43 </constructor>
44 <constructor name="Plane">
45 <return type="Plane" />
46 <param index="0" name="normal" type="Vector3" />
47 <param index="1" name="d" type="float" />
48 <description>
49 Creates a plane from the normal vector and the plane's distance from the origin.
50 The [param normal] of the plane must be a unit vector.
51 </description>
52 </constructor>
53 <constructor name="Plane">
54 <return type="Plane" />
55 <param index="0" name="normal" type="Vector3" />
56 <param index="1" name="point" type="Vector3" />
57 <description>
58 Creates a plane from the normal vector and a point on the plane.
59 The [param normal] of the plane must be a unit vector.
60 </description>
61 </constructor>
62 <constructor name="Plane">
63 <return type="Plane" />
64 <param index="0" name="point1" type="Vector3" />
65 <param index="1" name="point2" type="Vector3" />
66 <param index="2" name="point3" type="Vector3" />
67 <description>
68 Creates a plane from the three points, given in clockwise order.
69 </description>
70 </constructor>
71 </constructors>
72 <methods>
73 <method name="distance_to" qualifiers="const">
74 <return type="float" />
75 <param index="0" name="point" type="Vector3" />
76 <description>
77 Returns the shortest distance from the plane to the position [param point]. If the point is above the plane, the distance will be positive. If below, the distance will be negative.
78 </description>
79 </method>
80 <method name="get_center" qualifiers="const">
81 <return type="Vector3" />
82 <description>
83 Returns the center of the plane.
84 </description>
85 </method>
86 <method name="has_point" qualifiers="const">
87 <return type="bool" />
88 <param index="0" name="point" type="Vector3" />
89 <param index="1" name="tolerance" type="float" default="1e-05" />
90 <description>
91 Returns [code]true[/code] if [param point] is inside the plane. Comparison uses a custom minimum [param tolerance] threshold.
92 </description>
93 </method>
94 <method name="intersect_3" qualifiers="const">
95 <return type="Variant" />
96 <param index="0" name="b" type="Plane" />
97 <param index="1" name="c" type="Plane" />
98 <description>
99 Returns the intersection point of the three planes [param b], [param c] and this plane. If no intersection is found, [code]null[/code] is returned.
100 </description>
101 </method>
102 <method name="intersects_ray" qualifiers="const">
103 <return type="Variant" />
104 <param index="0" name="from" type="Vector3" />
105 <param index="1" name="dir" type="Vector3" />
106 <description>
107 Returns the intersection point of a ray consisting of the position [param from] and the direction normal [param dir] with this plane. If no intersection is found, [code]null[/code] is returned.
108 </description>
109 </method>
110 <method name="intersects_segment" qualifiers="const">
111 <return type="Variant" />
112 <param index="0" name="from" type="Vector3" />
113 <param index="1" name="to" type="Vector3" />
114 <description>
115 Returns the intersection point of a segment from position [param from] to position [param to] with this plane. If no intersection is found, [code]null[/code] is returned.
116 </description>
117 </method>
118 <method name="is_equal_approx" qualifiers="const">
119 <return type="bool" />
120 <param index="0" name="to_plane" type="Plane" />
121 <description>
122 Returns [code]true[/code] if this plane and [param to_plane] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
123 </description>
124 </method>
125 <method name="is_finite" qualifiers="const">
126 <return type="bool" />
127 <description>
128 Returns [code]true[/code] if this plane is finite, by calling [method @GlobalScope.is_finite] on each component.
129 </description>
130 </method>
131 <method name="is_point_over" qualifiers="const">
132 <return type="bool" />
133 <param index="0" name="point" type="Vector3" />
134 <description>
135 Returns [code]true[/code] if [param point] is located above the plane.
136 </description>
137 </method>
138 <method name="normalized" qualifiers="const">
139 <return type="Plane" />
140 <description>
141 Returns a copy of the plane, with normalized [member normal] (so it's a unit vector). Returns [code]Plane(0, 0, 0, 0)[/code] if [member normal] can't be normalized (it has zero length).
142 </description>
143 </method>
144 <method name="project" qualifiers="const">
145 <return type="Vector3" />
146 <param index="0" name="point" type="Vector3" />
147 <description>
148 Returns the orthogonal projection of [param point] into a point in the plane.
149 </description>
150 </method>
151 </methods>
152 <members>
153 <member name="d" type="float" setter="" getter="" default="0.0">
154 The distance from the origin to the plane, expressed in terms of [member normal] (according to its direction and magnitude). Actual absolute distance from the origin to the plane can be calculated as [code]abs(d) / normal.length()[/code] (if [member normal] has zero length then this [Plane] does not represent a valid plane).
155 In the scalar equation of the plane [code]ax + by + cz = d[/code], this is [code skip-lint]d[/code], while the [code](a, b, c)[/code] coordinates are represented by the [member normal] property.
156 </member>
157 <member name="normal" type="Vector3" setter="" getter="" default="Vector3(0, 0, 0)">
158 The normal of the plane, typically a unit vector. Shouldn't be a zero vector as [Plane] with such [member normal] does not represent a valid plane.
159 In the scalar equation of the plane [code]ax + by + cz = d[/code], this is the vector [code](a, b, c)[/code], where [code skip-lint]d[/code] is the [member d] property.
160 </member>
161 <member name="x" type="float" setter="" getter="" default="0.0">
162 The X component of the plane's [member normal] vector.
163 </member>
164 <member name="y" type="float" setter="" getter="" default="0.0">
165 The Y component of the plane's [member normal] vector.
166 </member>
167 <member name="z" type="float" setter="" getter="" default="0.0">
168 The Z component of the plane's [member normal] vector.
169 </member>
170 </members>
171 <constants>
172 <constant name="PLANE_YZ" value="Plane(1, 0, 0, 0)">
173 A plane that extends in the Y and Z axes (normal vector points +X).
174 </constant>
175 <constant name="PLANE_XZ" value="Plane(0, 1, 0, 0)">
176 A plane that extends in the X and Z axes (normal vector points +Y).
177 </constant>
178 <constant name="PLANE_XY" value="Plane(0, 0, 1, 0)">
179 A plane that extends in the X and Y axes (normal vector points +Z).
180 </constant>
181 </constants>
182 <operators>
183 <operator name="operator !=">
184 <return type="bool" />
185 <param index="0" name="right" type="Plane" />
186 <description>
187 Returns [code]true[/code] if the planes are not equal.
188 [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
189 </description>
190 </operator>
191 <operator name="operator *">
192 <return type="Plane" />
193 <param index="0" name="right" type="Transform3D" />
194 <description>
195 Inversely transforms (multiplies) the [Plane] by the given [Transform3D] transformation matrix.
196 [code]plane * transform[/code] is equivalent to [code]transform.affine_inverse() * plane[/code]. See [method Transform3D.affine_inverse].
197 </description>
198 </operator>
199 <operator name="operator ==">
200 <return type="bool" />
201 <param index="0" name="right" type="Plane" />
202 <description>
203 Returns [code]true[/code] if the planes are exactly equal.
204 [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
205 </description>
206 </operator>
207 <operator name="operator unary+">
208 <return type="Plane" />
209 <description>
210 Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable.
211 </description>
212 </operator>
213 <operator name="operator unary-">
214 <return type="Plane" />
215 <description>
216 Returns the negative value of the [Plane]. This is the same as writing [code]Plane(-p.normal, -p.d)[/code]. This operation flips the direction of the normal vector and also flips the distance value, resulting in a Plane that is in the same place, but facing the opposite direction.
217 </description>
218 </operator>
219 </operators>
220 </class>