A plane in Hessian normal form.
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.
$DOCS_URL/tutorials/math/index.html
Constructs a default-initialized [Plane] with all components set to [code]0[/code].
Constructs a [Plane] as a copy of the given [Plane].
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.
Creates a plane from the normal vector. The plane will intersect the origin. The [param normal] of the plane must be a unit vector.
Creates a plane from the normal vector and the plane's distance from the origin. The [param normal] of the plane must be a unit vector.
Creates a plane from the normal vector and a point on the plane. The [param normal] of the plane must be a unit vector.
Creates a plane from the three points, given in clockwise order.
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.
Returns the center of the plane.
Returns [code]true[/code] if [param point] is inside the plane. Comparison uses a custom minimum [param tolerance] threshold.
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.
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.
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.
Returns [code]true[/code] if this plane and [param to_plane] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
Returns [code]true[/code] if this plane is finite, by calling [method @GlobalScope.is_finite] on each component.
Returns [code]true[/code] if [param point] is located above the plane.
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).
Returns the orthogonal projection of [param point] into a point in the plane.
- 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). 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.
- 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. 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.
- The X component of the plane's [member normal] vector.
- The Y component of the plane's [member normal] vector.
- The Z component of the plane's [member normal] vector.
A plane that extends in the Y and Z axes (normal vector points +X).
A plane that extends in the X and Z axes (normal vector points +Y).
A plane that extends in the X and Y axes (normal vector points +Z).
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.
Inversely transforms (multiplies) the [Plane] by the given [Transform3D] transformation matrix. [code]plane * transform[/code] is equivalent to [code]transform.affine_inverse() * plane[/code]. See [method Transform3D.affine_inverse].
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.
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.
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.