2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 09:03:48 +08:00
<class name= "Plane" version= "4.0" >
2017-09-13 04:42:36 +08:00
<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 >
2021-11-15 17:43:07 +08:00
<link title= "Math documentation index" > $DOCS_URL/tutorials/math/index.html</link>
2017-09-13 04:42:36 +08:00
</tutorials>
2021-09-21 10:49:02 +08:00
<constructors >
<constructor name= "Plane" >
2021-07-30 21:28:05 +08:00
<return type= "Plane" />
2020-11-10 00:46:03 +08:00
<description >
Constructs a default-initialized [Plane] with all components set to [code]0[/code].
</description>
2021-09-21 10:49:02 +08:00
</constructor>
<constructor name= "Plane" >
2021-07-30 21:28:05 +08:00
<return type= "Plane" />
<argument index= "0" name= "from" type= "Plane" />
2020-11-10 00:46:03 +08:00
<description >
Constructs a [Plane] as a copy of the given [Plane].
</description>
2021-09-21 10:49:02 +08:00
</constructor>
<constructor name= "Plane" >
2021-07-30 21:28:05 +08:00
<return type= "Plane" />
<argument index= "0" name= "a" type= "float" />
<argument index= "1" name= "b" type= "float" />
<argument index= "2" name= "c" type= "float" />
<argument index= "3" name= "d" type= "float" />
2017-09-13 04:42:36 +08:00
<description >
2020-05-10 22:47:11 +08:00
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.
2017-09-13 04:42:36 +08:00
</description>
2021-09-21 10:49:02 +08:00
</constructor>
<constructor name= "Plane" >
2021-04-08 22:26:14 +08:00
<return type= "Plane" />
<argument index= "0" name= "normal" type= "Vector3" />
<description >
2021-09-21 10:49:02 +08:00
Creates a plane from the normal vector. The plane will intersect the origin.
2021-04-08 22:26:14 +08:00
</description>
2021-09-21 10:49:02 +08:00
</constructor>
<constructor name= "Plane" >
2021-07-30 21:28:05 +08:00
<return type= "Plane" />
<argument index= "0" name= "normal" type= "Vector3" />
<argument index= "1" name= "d" type= "float" />
2020-11-10 00:46:03 +08:00
<description >
2021-09-21 10:49:02 +08:00
Creates a plane from the normal vector and the plane's distance from the origin.
2020-11-10 00:46:03 +08:00
</description>
2021-09-21 10:49:02 +08:00
</constructor>
<constructor name= "Plane" >
2021-07-30 21:28:05 +08:00
<return type= "Plane" />
2021-04-08 22:26:14 +08:00
<argument index= "0" name= "normal" type= "Vector3" />
2021-09-21 10:49:02 +08:00
<argument index= "1" name= "point" type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
2021-09-21 10:49:02 +08:00
Creates a plane from the normal vector and a point on the plane.
2017-09-13 04:42:36 +08:00
</description>
2021-09-21 10:49:02 +08:00
</constructor>
<constructor name= "Plane" >
2021-07-30 21:28:05 +08:00
<return type= "Plane" />
<argument index= "0" name= "point1" type= "Vector3" />
<argument index= "1" name= "point2" type= "Vector3" />
<argument index= "2" name= "point3" type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
2020-11-10 00:46:03 +08:00
Creates a plane from the three points, given in clockwise order.
2017-09-13 04:42:36 +08:00
</description>
2021-09-21 10:49:02 +08:00
</constructor>
</constructors>
<methods >
2021-03-18 21:44:42 +08:00
<method name= "center" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
Returns the center of the plane.
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "distance_to" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "float" />
<argument index= "0" name= "point" type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
Returns the shortest distance from the plane to the position [code]point[/code].
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "has_point" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "bool" />
<argument index= "0" name= "point" type= "Vector3" />
<argument index= "1" name= "epsilon" type= "float" default= "1e-05" />
2017-09-13 04:42:36 +08:00
<description >
2020-07-22 02:07:00 +08:00
Returns [code]true[/code] if [code]point[/code] is inside the plane. Comparison uses a custom minimum [code]epsilon[/code] threshold.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "intersect_3" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Variant" />
<argument index= "0" name= "b" type= "Plane" />
<argument index= "1" name= "c" type= "Plane" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
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.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "intersects_ray" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Variant" />
<argument index= "0" name= "from" type= "Vector3" />
<argument index= "1" name= "dir" type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
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.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "intersects_segment" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Variant" />
<argument index= "0" name= "from" type= "Vector3" />
<argument index= "1" name= "to" type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
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.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "is_equal_approx" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "bool" />
<argument index= "0" name= "to_plane" type= "Plane" />
2019-11-08 15:33:48 +08:00
<description >
2021-01-04 21:33:44 +08:00
Returns [code]true[/code] if this plane and [code]plane[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
2019-11-08 15:33:48 +08:00
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "is_point_over" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "bool" />
<argument index= "0" name= "plane" type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
2019-06-22 07:04:47 +08:00
Returns [code]true[/code] if [code]point[/code] is located above the plane.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "normalized" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Plane" />
2017-09-13 04:42:36 +08:00
<description >
Returns a copy of the plane, normalized.
</description>
</method>
2021-03-18 21:44:42 +08:00
<method name= "project" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Vector3" />
<argument index= "0" name= "point" type= "Vector3" />
2017-09-13 04:42:36 +08:00
<description >
2020-07-22 02:07:00 +08:00
Returns the orthogonal projection of [code]point[/code] into a point in the plane.
2017-09-13 04:42:36 +08:00
</description>
</method>
</methods>
<members >
2019-06-29 18:38:01 +08:00
<member name= "d" type= "float" setter= "" getter= "" default= "0.0" >
2020-07-22 02:07:00 +08:00
The distance from the origin to the plane, in the direction of [member normal]. This value is typically non-negative.
In the scalar equation of the plane [code]ax + by + cz = d[/code], this is [code]d[/code], while the [code](a, b, c)[/code] coordinates are represented by the [member normal] property.
2017-09-13 04:42:36 +08:00
</member>
2019-09-25 01:45:03 +08:00
<member name= "normal" type= "Vector3" setter= "" getter= "" default= "Vector3(0, 0, 0)" >
2020-07-22 02:07:00 +08:00
The normal of the plane, which must be normalized.
In the scalar equation of the plane [code]ax + by + cz = d[/code], this is the vector [code](a, b, c)[/code], where [code]d[/code] is the [member d] property.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "x" type= "float" setter= "" getter= "" default= "0.0" >
2020-07-22 02:07:00 +08:00
The X component of the plane's [member normal] vector.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "y" type= "float" setter= "" getter= "" default= "0.0" >
2020-07-22 02:07:00 +08:00
The Y component of the plane's [member normal] vector.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "z" type= "float" setter= "" getter= "" default= "0.0" >
2020-07-22 02:07:00 +08:00
The Z component of the plane's [member normal] vector.
2017-09-13 04:42:36 +08:00
</member>
</members>
<constants >
2019-09-25 01:45:03 +08:00
<constant name= "PLANE_YZ" value= "Plane(1, 0, 0, 0)" >
2020-07-22 02:07:00 +08:00
A plane that extends in the Y and Z axes (normal vector points +X).
2018-08-21 06:35:30 +08:00
</constant>
2019-09-25 01:45:03 +08:00
<constant name= "PLANE_XZ" value= "Plane(0, 1, 0, 0)" >
2020-07-22 02:07:00 +08:00
A plane that extends in the X and Z axes (normal vector points +Y).
2018-08-21 06:35:30 +08:00
</constant>
2019-09-25 01:45:03 +08:00
<constant name= "PLANE_XY" value= "Plane(0, 0, 1, 0)" >
2020-07-22 02:07:00 +08:00
A plane that extends in the X and Y axes (normal vector points +Z).
2018-08-21 06:35:30 +08:00
</constant>
2017-09-13 04:42:36 +08:00
</constants>
2021-09-21 10:49:02 +08:00
<operators >
<operator name= "operator !=" >
<return type= "bool" />
<description >
</description>
</operator>
<operator name= "operator !=" >
<return type= "bool" />
<argument index= "0" name= "right" type= "Plane" />
<description >
2021-11-04 23:58:20 +08:00
Returns [code]true[/code] if the planes are not equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
2021-09-21 10:49:02 +08:00
</description>
</operator>
<operator name= "operator ==" >
<return type= "bool" />
<description >
</description>
</operator>
<operator name= "operator ==" >
<return type= "bool" />
<argument index= "0" name= "right" type= "Plane" />
<description >
2021-11-04 23:58:20 +08:00
Returns [code]true[/code] if the planes are exactly equal.
[b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable.
2021-09-21 10:49:02 +08:00
</description>
</operator>
<operator name= "operator unary+" >
<return type= "Plane" />
<description >
2021-11-04 23:58:20 +08:00
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.
2021-09-21 10:49:02 +08:00
</description>
</operator>
<operator name= "operator unary-" >
<return type= "Plane" />
<description >
2021-11-04 23:58:20 +08:00
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.
2021-09-21 10:49:02 +08:00
</description>
</operator>
</operators>
2017-09-13 04:42:36 +08:00
</class>