Class Plane
Represents a plane in three dimensional space.
Inheritance
Implements
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public sealed class Plane : ValueType, IEquatable<Plane>, IFormattable
Constructors
Plane(Vector3, Vector3)
Initializes a new instance of the Plane class.
Declaration
public Plane(Vector3 point, Vector3 normal)
Parameters
Vector3
point
Any point that lies along the plane. |
Vector3
normal
The normal vector to the plane. |
Plane(Vector3, Vector3, Vector3)
Initializes a new instance of the Plane struct.
Declaration
public Plane(Vector3 point1, Vector3 point2, Vector3 point3)
Parameters
Vector3
point1
First point of a triangle defining the plane. |
Vector3
point2
Second point of a triangle defining the plane. |
Vector3
point3
Third point of a triangle defining the plane. |
Plane(Vector3, Single)
Initializes a new instance of the Plane struct.
Declaration
public Plane(Vector3 value, float d)
Parameters
Vector3
value
The normal of the plane. |
System.Single
d
The distance of the plane along its normal from the origin |
Plane(Single[])
Initializes a new instance of the Plane struct.
Declaration
public Plane(float[] values)
Parameters
System.Single[]
values
The values to assign to the A, B, C, and D components of the plane. This must be an array with four elements. |
Exceptions
System.ArgumentNullException
Thrown when |
System.ArgumentOutOfRangeException
Thrown when |
Fields
D
The distance of the plane along its normal from the origin.
Declaration
public float D
Field Value
System.Single
|
Normal
Properties
Default
Item[Int32]
Gets or sets the component at the specified index.
Declaration
public float this[int index] { get; set; }
Parameters
System.Int32
index
The index of the component to access. Use 0 for the A component, 1 for the B component, 2 for the C component, and 3 for the D component. |
Property Value
System.Single
The value of the A, B, C, or D component, depending on the index. |
Exceptions
System.ArgumentOutOfRangeException
Thrown when the |
Methods
Dot(Plane, Vector4)
Calculates the dot product of the specified vector and plane.
Declaration
public static float Dot(Plane left, Vector4 right)
Parameters
Plane
left
The source plane. |
Vector4
right
The source vector. |
Returns
System.Single
The dot product of the specified plane and vector. |
Dot(ref Plane, ref Vector4, out Single)
Calculates the dot product of the specified vector and plane.
Declaration
public static void Dot(ref Plane left, ref Vector4 right, out float result)
Parameters
Plane
left
The source plane. |
Vector4
right
The source vector. |
System.Single
result
When the method completes, contains the dot product of the specified plane and vector. |
DotCoordinate(Plane, Vector3)
Calculates the dot product of a specified vector and the normal of the plane plus the distance value of the plane.
Declaration
public static float DotCoordinate(Plane left, Vector3 right)
Parameters
Plane
left
The source plane. |
Vector3
right
The source vector. |
Returns
System.Single
The dot product of a specified vector and the normal of the Plane plus the distance value of the plane. |
DotCoordinate(ref Plane, ref Vector3, out Single)
Calculates the dot product of a specified vector and the normal of the plane plus the distance value of the plane.
Declaration
public static void DotCoordinate(ref Plane left, ref Vector3 right, out float result)
Parameters
Plane
left
The source plane. |
Vector3
right
The source vector. |
System.Single
result
When the method completes, contains the dot product of a specified vector and the normal of the Plane plus the distance value of the plane. |
DotNormal(Plane, Vector3)
Calculates the dot product of the specified vector and the normal of the plane.
Declaration
public static float DotNormal(Plane left, Vector3 right)
Parameters
Plane
left
The source plane. |
Vector3
right
The source vector. |
Returns
System.Single
The dot product of the specified vector and the normal of the plane. |
DotNormal(ref Plane, ref Vector3, out Single)
Calculates the dot product of the specified vector and the normal of the plane.
Declaration
public static void DotNormal(ref Plane left, ref Vector3 right, out float result)
Parameters
Plane
left
The source plane. |
Vector3
right
The source vector. |
System.Single
result
When the method completes, contains the dot product of the specified vector and the normal of the plane. |
Equals(Plane)
Determines whether the specified Vector4 is equal to this instance.
Declaration
public bool Equals(Plane value)
Parameters
Plane
value
The Vector4 to compare with this instance. |
Returns
System.Boolean
|
Equals(ref Plane)
Determines whether the specified Vector4 is equal to this instance.
Declaration
public bool Equals(ref Plane value)
Parameters
Plane
value
The Vector4 to compare with this instance. |
Returns
System.Boolean
|
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object value)
Parameters
System.Object
value
The System.Object to compare with this instance. |
Returns
System.Boolean
|
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Intersects(ref BoundingBox)
Determines if there is an intersection between the current object and a BoundingBox.
Declaration
public PlaneIntersectionType Intersects(ref BoundingBox box)
Parameters
BoundingBox
box
The box to test. |
Returns
PlaneIntersectionType
Whether the two objects intersected. |
Intersects(ref BoundingSphere)
Determines if there is an intersection between the current object and a BoundingSphere.
Declaration
public PlaneIntersectionType Intersects(ref BoundingSphere sphere)
Parameters
BoundingSphere
sphere
The sphere to test. |
Returns
PlaneIntersectionType
Whether the two objects intersected. |
Intersects(ref Plane)
Determines if there is an intersection between the current object and a Plane.
Declaration
public bool Intersects(ref Plane plane)
Parameters
Plane
plane
The plane to test. |
Returns
System.Boolean
Whether the two objects intersected. |
Intersects(ref Plane, out Ray)
Determines if there is an intersection between the current object and a Plane.
Declaration
public bool Intersects(ref Plane plane, out Ray line)
Parameters
Plane
plane
The plane to test. |
Ray
line
When the method completes, contains the line of intersection as a Ray, or a zero ray if there was no intersection. |
Returns
System.Boolean
Whether the two objects intersected. |
Intersects(ref Ray)
Determines if there is an intersection between the current object and a Ray.
Declaration
public bool Intersects(ref Ray ray)
Parameters
Ray
ray
The ray to test. |
Returns
System.Boolean
Whether the two objects intersected. |
Intersects(ref Ray, out Vector3)
Determines if there is an intersection between the current object and a Ray.
Declaration
public bool Intersects(ref Ray ray, out Vector3 point)
Parameters
Ray
ray
The ray to test. |
Vector3
point
When the method completes, contains the point of intersection, or Zero if there was no intersection. |
Returns
System.Boolean
Whether the two objects intersected. |
Intersects(ref Ray, out Single)
Determines if there is an intersection between the current object and a Ray.
Declaration
public bool Intersects(ref Ray ray, out float distance)
Parameters
Ray
ray
The ray to test. |
System.Single
distance
When the method completes, contains the distance of the intersection, or 0 if there was no intersection. |
Returns
System.Boolean
Whether the two objects intersected. |
Intersects(ref Vector3)
Determines if there is an intersection between the current object and a point.
Declaration
public PlaneIntersectionType Intersects(ref Vector3 point)
Parameters
Vector3
point
The point to test. |
Returns
PlaneIntersectionType
Whether the two objects intersected. |
Intersects(ref Vector3, ref Vector3, ref Vector3)
Determines if there is an intersection between the current object and a triangle.
Declaration
public PlaneIntersectionType Intersects(ref Vector3 vertex1, ref Vector3 vertex2, ref Vector3 vertex3)
Parameters
Vector3
vertex1
The first vertex of the triangle to test. |
Vector3
vertex2
The second vertex of the triangle to test. |
Vector3
vertex3
The third vertex of the triangle to test. |
Returns
PlaneIntersectionType
Whether the two objects intersected. |
Multiply(Plane, Single)
Scales the plane by the given scaling factor.
Declaration
public static Plane Multiply(Plane value, float scale)
Parameters
Plane
value
The plane to scale. |
System.Single
scale
The amount by which to scale the plane. |
Returns
Plane
The scaled plane. |
Multiply(ref Plane, Single, out Plane)
Scales the plane by the given scaling factor.
Declaration
public static void Multiply(ref Plane value, float scale, out Plane result)
Parameters
Plane
value
The plane to scale. |
System.Single
scale
The amount by which to scale the plane. |
Plane
result
When the method completes, contains the scaled plane. |
Normalize()
Changes the coefficients of the normal vector of the plane to make it of unit length.
Declaration
public void Normalize()
Normalize(Plane)
Changes the coefficients of the normal vector of the plane to make it of unit length.
Declaration
public static Plane Normalize(Plane plane)
Parameters
Plane
plane
The source plane. |
Returns
Plane
The normalized plane. |
Normalize(ref Plane, out Plane)
Changes the coefficients of the normal vector of the plane to make it of unit length.
Declaration
public static void Normalize(ref Plane plane, out Plane result)
Parameters
Plane
plane
The source plane. |
Plane
result
When the method completes, contains the normalized plane. |
ToArray()
Creates an array containing the elements of the plane.
Declaration
public float[] ToArray()
Returns
System.Single[]
A four-element array containing the components of the plane. |
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
System.String
A System.String that represents this instance. |
ToString(IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(IFormatProvider formatProvider)
Parameters
System.IFormatProvider
formatProvider
The format provider. |
Returns
System.String
A System.String that represents this instance. |
ToString(String)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format)
Parameters
System.String
format
The format. |
Returns
System.String
A System.String that represents this instance. |
ToString(String, IFormatProvider)
Returns a System.String that represents this instance.
Declaration
public string ToString(string format, IFormatProvider formatProvider)
Parameters
System.String
format
The format. |
System.IFormatProvider
formatProvider
The format provider. |
Returns
System.String
A System.String that represents this instance. |
Transform(Plane, Matrix)
Transforms a normalized plane by a matrix.
Declaration
public static Plane Transform(Plane plane, Matrix transformation)
Parameters
Plane
plane
The normalized source plane. |
Matrix
transformation
The transformation matrix. |
Returns
Plane
When the method completes, contains the transformed plane. |
Transform(Plane, Quaternion)
Transforms a normalized plane by a quaternion rotation.
Declaration
public static Plane Transform(Plane plane, Quaternion rotation)
Parameters
Plane
plane
The normalized source plane. |
Quaternion
rotation
The quaternion rotation. |
Returns
Plane
The transformed plane. |
Transform(ref Plane, ref Matrix, out Plane)
Transforms a normalized plane by a matrix.
Declaration
public static void Transform(ref Plane plane, ref Matrix transformation, out Plane result)
Parameters
Plane
plane
The normalized source plane. |
Matrix
transformation
The transformation matrix. |
Plane
result
When the method completes, contains the transformed plane. |
Transform(ref Plane, ref Quaternion, out Plane)
Transforms a normalized plane by a quaternion rotation.
Declaration
public static void Transform(ref Plane plane, ref Quaternion rotation, out Plane result)
Parameters
Plane
plane
The normalized source plane. |
Quaternion
rotation
The quaternion rotation. |
Plane
result
When the method completes, contains the transformed plane. |
Operators
Equality(Plane, Plane)
Tests for equality between two objects.
Declaration
public static bool operator ==(Plane left, Plane right)
Parameters
Plane
left
The first value to compare. |
Plane
right
The second value to compare. |
Returns
System.Boolean
|
Inequality(Plane, Plane)
Tests for inequality between two objects.
Declaration
public static bool operator !=(Plane left, Plane right)
Parameters
Plane
left
The first value to compare. |
Plane
right
The second value to compare. |
Returns
System.Boolean
|
Multiply(Plane, Single)
Scales a plane by the given value.
Declaration
public static Plane operator *(Plane plane, float scale)
Parameters
Plane
plane
The plane to scale. |
System.Single
scale
The amount by which to scale the plane. |
Returns
Plane
The scaled plane. |
Multiply(Single, Plane)
Scales a plane by the given value.
Declaration
public static Plane operator *(float scale, Plane plane)
Parameters
System.Single
scale
The amount by which to scale the plane. |
Plane
plane
The plane to scale. |
Returns
Plane
The scaled plane. |