Quellcode durchsuchen

Merge pull request #67477 from Chaosus/plane_constructor

Yuri Rubinsky vor 2 Jahren
Ursprung
Commit
3a59c833f1
1 geänderte Dateien mit 12 neuen und 0 gelöschten Zeilen
  1. 12 0
      modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs

+ 12 - 0
modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs

@@ -291,6 +291,18 @@ namespace Godot
             D = d;
         }
 
+        /// <summary>
+        /// Constructs a <see cref="Plane"/> from a <paramref name="normal"/> vector and
+        /// a <paramref name="point"/> on the plane.
+        /// </summary>
+        /// <param name="normal">The normal of the plane, must be normalized.</param>
+        /// <param name="point">The point on the plane.</param>
+        public Plane(Vector3 normal, Vector3 point)
+        {
+            _normal = normal;
+            D = _normal.Dot(point);
+        }
+
         /// <summary>
         /// Constructs a <see cref="Plane"/> from the three points, given in clockwise order.
         /// </summary>