diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml
index fbe8afa8d16..e52d4bea3da 100644
--- a/doc/classes/Plane.xml
+++ b/doc/classes/Plane.xml
@@ -38,6 +38,7 @@
Creates a plane from the normal vector. The plane will intersect the origin.
+ The [param normal] of the plane must be a unit vector.
@@ -46,6 +47,7 @@
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.
@@ -54,6 +56,7 @@
Creates a plane from the normal vector and a point on the plane.
+ The [param normal] of the plane must be a unit vector.
@@ -152,7 +155,7 @@
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.
- The normal of the plane, which must be normalized.
+ The normal of the plane, which must be a unit vector.
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.
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs
index 9e5f7c4f9e0..8a125e3c735 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs
@@ -15,7 +15,7 @@ namespace Godot
private Vector3 _normal;
///
- /// The normal of the plane, which must be normalized.
+ /// The normal of the plane, which must be a unit vector.
/// In the scalar equation of the plane ax + by + cz = d, this is
/// the vector (a, b, c), where d is the property.
///
@@ -84,23 +84,6 @@ namespace Godot
/// The plane's distance from the origin.
public real_t D { get; set; }
- ///
- /// The center of the plane, the point where the normal line intersects the plane.
- ///
- /// Equivalent to multiplied by .
- public Vector3 Center
- {
- readonly get
- {
- return _normal * D;
- }
- set
- {
- _normal = value.Normalized();
- D = value.Length();
- }
- }
-
///
/// Returns the shortest distance from this plane to the position .
///
@@ -111,6 +94,16 @@ namespace Godot
return _normal.Dot(point) - D;
}
+ ///
+ /// Returns the center of the plane, the point on the plane closest to the origin.
+ /// The point where the normal line going through the origin intersects the plane.
+ ///
+ /// Equivalent to multiplied by .
+ public readonly Vector3 GetCenter()
+ {
+ return _normal * D;
+ }
+
///
/// Returns if point is inside the plane.
/// Comparison uses a custom minimum tolerance threshold.
@@ -155,7 +148,7 @@ namespace Godot
/// The start of the ray.
/// The direction of the ray, normalized.
/// The intersection, or if none is found.
- public readonly Vector3? IntersectRay(Vector3 from, Vector3 dir)
+ public readonly Vector3? IntersectsRay(Vector3 from, Vector3 dir)
{
real_t den = _normal.Dot(dir);
@@ -183,7 +176,7 @@ namespace Godot
/// The start of the line segment.
/// The end of the line segment.
/// The intersection, or if none is found.
- public readonly Vector3? IntersectSegment(Vector3 begin, Vector3 end)
+ public readonly Vector3? IntersectsSegment(Vector3 begin, Vector3 end)
{
Vector3 segment = begin - end;
real_t den = _normal.Dot(segment);
@@ -289,11 +282,22 @@ namespace Godot
D = d;
}
+ ///
+ /// Constructs a from a vector.
+ /// The plane will intersect the origin.
+ ///
+ /// The normal of the plane, must be a unit vector.
+ public Plane(Vector3 normal)
+ {
+ _normal = normal;
+ D = 0;
+ }
+
///
/// Constructs a from a vector and
/// the plane's distance to the origin .
///
- /// The normal of the plane, must be normalized.
+ /// The normal of the plane, must be a unit vector.
/// The plane's distance from the origin. This value is typically non-negative.
public Plane(Vector3 normal, real_t d)
{
@@ -305,7 +309,7 @@ namespace Godot
/// Constructs a from a vector and
/// a on the plane.
///
- /// The normal of the plane, must be normalized.
+ /// The normal of the plane, must be a unit vector.
/// The point on the plane.
public Plane(Vector3 normal, Vector3 point)
{