Show / Hide Table of Contents

Class Plane

Defines a plane.

Inheritance
System.Object
Plane
Namespace: VRageMath
Assembly: VRage.Math.dll
Syntax
public sealed class Plane : ValueType, IEquatable<Plane>

Constructors

Plane(Single, Single, Single, Single)

Creates a new instance of Plane.

Declaration
public Plane(float a, float b, float c, float d)
Parameters
Type Name Description
System.Single a

X component of the normal defining the Plane.

System.Single b

Y component of the normal defining the Plane.

System.Single c

Z component of the normal defining the Plane.

System.Single d

Distance of the origin from the plane along its normal.

Plane(Vector3, Single)

Creates a new instance of Plane.

Declaration
public Plane(Vector3 normal, float d)
Parameters
Type Name Description
Vector3 normal

The normal vector to the Plane.

System.Single d

Distance of the origin from the plane along its normal.

Plane(Vector3, Vector3)

Creates a new instance of Plane.

Declaration
public Plane(Vector3 position, Vector3 normal)
Parameters
Type Name Description
Vector3 position

A point that lies on the Plane

Vector3 normal

The normal vector to the Plane.

Plane(Vector3, Vector3, Vector3)

Creates a new instance of Plane.

Declaration
public Plane(Vector3 point1, Vector3 point2, Vector3 point3)
Parameters
Type Name Description
Vector3 point1

One point of a triangle defining the Plane.

Vector3 point2

One point of a triangle defining the Plane.

Vector3 point3

One point of a triangle defining the Plane.

Plane(ref Vector3, ref Vector3, ref Vector3)

Declaration
public Plane(ref Vector3 point1, ref Vector3 point2, ref Vector3 point3)
Parameters
Type Name Description
Vector3 point1
Vector3 point2
Vector3 point3

Plane(Vector4)

Creates a new instance of Plane.

Declaration
public Plane(Vector4 value)
Parameters
Type Name Description
Vector4 value

Vector4 with X, Y, and Z components defining the normal of the Plane. The W component defines the distance of the origin from the plane along its normal.

Fields

D

The distance of the Plane along its normal from the origin. Note: Be careful! The distance is signed and is the opposite of what people usually expect. If you look closely at the plane equation: (n dot P) - D = 0, you'll realize that D = - (n dot P) (that is, negative instead of positive)

Declaration
public float D
Field Value
Type Description
System.Single

Normal

The normal vector of the Plane.

Declaration
public Vector3 Normal
Field Value
Type Description
Vector3

Methods

Dot(Vector4)

Calculates the dot product of a specified Vector4 and this Plane.

Declaration
public float Dot(Vector4 value)
Parameters
Type Name Description
Vector4 value

The Vector4 to multiply this Plane by.

Returns
Type Description
System.Single

Dot(ref Vector4, out Single)

Calculates the dot product of a specified Vector4 and this Plane.

Declaration
public void Dot(ref Vector4 value, out float result)
Parameters
Type Name Description
Vector4 value

The Vector4 to multiply this Plane by.

System.Single result

[OutAttribute] The dot product of the specified Vector4 and this Plane.

DotCoordinate(Vector3)

Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.

Declaration
public float DotCoordinate(Vector3 value)
Parameters
Type Name Description
Vector3 value

The Vector3 to multiply by.

Returns
Type Description
System.Single

DotCoordinate(ref Vector3, out Single)

Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.

Declaration
public void DotCoordinate(ref Vector3 value, out float result)
Parameters
Type Name Description
Vector3 value

The Vector3 to multiply by.

System.Single result

[OutAttribute] The resulting value.

DotNormal(ref Vector3, out Single)

Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Declaration
public void DotNormal(ref Vector3 value, out float result)
Parameters
Type Name Description
Vector3 value

The Vector3 to multiply by.

System.Single result

[OutAttribute] The resulting dot product.

DotNormal(Vector3D)

Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Declaration
public double DotNormal(Vector3D value)
Parameters
Type Name Description
Vector3D value

The Vector3 to multiply by.

Returns
Type Description
System.Double

Equals(Object)

Determines whether the specified Object is equal to the Plane.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The Object to compare with the current Plane.

Returns
Type Description
System.Boolean

Equals(Plane)

Determines whether the specified Plane is equal to the Plane.

Declaration
public bool Equals(Plane other)
Parameters
Type Name Description
Plane other

The Plane to compare with the current Plane.

Returns
Type Description
System.Boolean

GetHashCode()

Gets the hash code for this object.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

Intersection(ref Vector3D, ref Vector3D)

Gets intersection point in Plane.

Declaration
public Vector3D Intersection(ref Vector3D from, ref Vector3D direction)
Parameters
Type Name Description
Vector3D from

Starting point of a ray.

Vector3D direction

Ray direction.

Returns
Type Description
Vector3D

Point of intersection.

Intersects(BoundingBox)

Checks whether the current Plane intersects a specified BoundingBox.

Declaration
public PlaneIntersectionType Intersects(BoundingBox box)
Parameters
Type Name Description
BoundingBox box

The BoundingBox to test for intersection with.

Returns
Type Description
PlaneIntersectionType

Intersects(ref BoundingBox, out PlaneIntersectionType)

Checks whether the current Plane intersects a BoundingBox.

Declaration
public void Intersects(ref BoundingBox box, out PlaneIntersectionType result)
Parameters
Type Name Description
BoundingBox box

The BoundingBox to check for intersection with.

PlaneIntersectionType result

[OutAttribute] An enumeration indicating whether the Plane intersects the BoundingBox.

Intersects(BoundingFrustum)

Checks whether the current Plane intersects a specified BoundingFrustum.

Declaration
public PlaneIntersectionType Intersects(BoundingFrustum frustum)
Parameters
Type Name Description
BoundingFrustum frustum

The BoundingFrustum to check for intersection with.

Returns
Type Description
PlaneIntersectionType

Intersects(BoundingSphere)

Checks whether the current Plane intersects a specified BoundingSphere.

Declaration
public PlaneIntersectionType Intersects(BoundingSphere sphere)
Parameters
Type Name Description
BoundingSphere sphere

The BoundingSphere to check for intersection with.

Returns
Type Description
PlaneIntersectionType

Intersects(ref BoundingSphere, out PlaneIntersectionType)

Checks whether the current Plane intersects a BoundingSphere.

Declaration
public void Intersects(ref BoundingSphere sphere, out PlaneIntersectionType result)
Parameters
Type Name Description
BoundingSphere sphere

The BoundingSphere to check for intersection with.

PlaneIntersectionType result

[OutAttribute] An enumeration indicating whether the Plane intersects the BoundingSphere.

Normalize()

Changes the coefficients of the Normal vector of this Plane to make it of unit length.

Declaration
public void Normalize()

Normalize(Plane)

Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Declaration
public static Plane Normalize(Plane value)
Parameters
Type Name Description
Plane value

The Plane to normalize.

Returns
Type Description
Plane

Normalize(ref Plane, out Plane)

Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Declaration
public static void Normalize(ref Plane value, out Plane result)
Parameters
Type Name Description
Plane value

The Plane to normalize.

Plane result

[OutAttribute] An existing plane Plane filled in with a normalized version of the specified plane.

RandomPoint()

Declaration
public Vector3 RandomPoint()
Returns
Type Description
Vector3

ToString()

Returns a String that represents the current Plane.

Declaration
public override string ToString()
Returns
Type Description
System.String

Transform(Plane, Matrix)

Transforms a normalized Plane by a Matrix.

Declaration
public static Plane Transform(Plane plane, Matrix matrix)
Parameters
Type Name Description
Plane plane

The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called.

Matrix matrix

The transform Matrix to apply to the Plane.

Returns
Type Description
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 matrix, out Plane result)
Parameters
Type Name Description
Plane plane

The normalized Plane to transform. This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called.

Matrix matrix

The transform Matrix to apply to the Plane.

Plane result

[OutAttribute] An existing Plane filled in with the results of applying the transform.

Operators

Equality(Plane, Plane)

Determines whether two instances of Plane are equal.

Declaration
public static bool operator ==(Plane lhs, Plane rhs)
Parameters
Type Name Description
Plane lhs

The object to the left of the equality operator.

Plane rhs

The object to the right of the equality operator.

Returns
Type Description
System.Boolean

Inequality(Plane, Plane)

Determines whether two instances of Plane are not equal.

Declaration
public static bool operator !=(Plane lhs, Plane rhs)
Parameters
Type Name Description
Plane lhs

The object to the left of the inequality operator.

Plane rhs

The object to the right of the inequality operator.

Returns
Type Description
System.Boolean
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾