Table of Contents

Struct Plane

Namespace
Microsoft.Xna.Framework
Assembly
MonoGame.Framework.dll

A plane in 3d space, represented by its normal away from the origin and its distance from the origin, D.

[DataContract]
public struct Plane : IEquatable<Plane>
Implements
Inherited Members

Constructors

Plane(Vector3, Vector3)

Create a Plane that contains the specified point and has the specified Normal vector.

public Plane(Vector3 pointOnPlane, Vector3 normal)

Parameters

pointOnPlane Vector3

A point the created Plane should contain.

normal Vector3

The normal of the plane.

Plane(Vector3, Vector3, Vector3)

Create the Plane that contains the three specified points.

public Plane(Vector3 a, Vector3 b, Vector3 c)

Parameters

a Vector3

A point the created Plane should contain.

b Vector3

A point the created Plane should contain.

c Vector3

A point the created Plane should contain.

Plane(Vector3, float)

Create a Plane with the specified normal and distance to the origin.

public Plane(Vector3 normal, float d)

Parameters

normal Vector3

The normal of the plane.

d float

The distance to the origin.

Plane(Vector4)

Create a Plane with the first three components of the specified Vector4 as the normal and the last component as the distance to the origin.

public Plane(Vector4 value)

Parameters

value Vector4

A vector holding the normal and distance to origin.

Plane(float, float, float, float)

Create a Plane with the first three values as the X, Y and Z components of the normal and the last value as the distance to the origin.

public Plane(float a, float b, float c, float d)

Parameters

a float

The X component of the normal.

b float

The Y component of the normal.

c float

The Z component of the normal.

d float

The distance to the origin.

Fields

D

The distance of the Plane to the origin.

[DataMember]
public float D

Field Value

float

Normal

The normal of the Plane.

[DataMember]
public Vector3 Normal

Field Value

Vector3

Methods

Deconstruct(out Vector3, out float)

Deconstruction method for Plane.

public void Deconstruct(out Vector3 normal, out float d)

Parameters

normal Vector3
d float

Dot(Vector4)

Get the dot product of a Vector4 with this Plane.

public float Dot(Vector4 value)

Parameters

value Vector4

The Vector4 to calculate the dot product with.

Returns

float

The dot product of the specified Vector4 and this Plane.

Dot(ref Vector4, out float)

Get the dot product of a Vector4 with this Plane.

public void Dot(ref Vector4 value, out float result)

Parameters

value Vector4

The Vector4 to calculate the dot product with.

result float

The dot product of the specified Vector4 and this Plane.

DotCoordinate(Vector3)

Get the dot product of a Vector3 with the Normal vector of this Plane plus the D value of this Plane.

public float DotCoordinate(Vector3 value)

Parameters

value Vector3

The Vector3 to calculate the dot product with.

Returns

float

The dot product of the specified Vector3 and the normal of this Plane plus the D value of this Plane.

DotCoordinate(ref Vector3, out float)

Get the dot product of a Vector3 with the Normal vector of this Plane plus the D value of this Plane.

public void DotCoordinate(ref Vector3 value, out float result)

Parameters

value Vector3

The Vector3 to calculate the dot product with.

result float

The dot product of the specified Vector3 and the normal of this Plane plus the D value of this Plane.

DotNormal(Vector3)

Get the dot product of a Vector3 with the Normal vector of this Plane.

public float DotNormal(Vector3 value)

Parameters

value Vector3

The Vector3 to calculate the dot product with.

Returns

float

The dot product of the specified Vector3 and the normal of this Plane.

DotNormal(ref Vector3, out float)

Get the dot product of a Vector3 with the Normal vector of this Plane.

public void DotNormal(ref Vector3 value, out float result)

Parameters

value Vector3

The Vector3 to calculate the dot product with.

result float

The dot product of the specified Vector3 and the normal of this Plane.

Equals(Plane)

Check if this Plane is equal to another Plane.

public bool Equals(Plane other)

Parameters

other Plane

A Plane to check for equality with this Plane.

Returns

bool
true
if the specified Plane is equal to this one,
false
if it is not.

Equals(object)

Check if this Plane is equal to another Plane.

public override bool Equals(object other)

Parameters

other object

An object to check for equality with this Plane.

Returns

bool
true
if the specified object is equal to this Plane,
false
if it is not.

GetHashCode()

Get a hash code for this Plane.

public override int GetHashCode()

Returns

int

A hash code for this Plane.

Intersects(BoundingBox)

Check if this Plane intersects a BoundingBox.

public PlaneIntersectionType Intersects(BoundingBox box)

Parameters

box BoundingBox

The BoundingBox to test for intersection.

Returns

PlaneIntersectionType

The type of intersection of this Plane with the specified BoundingBox.

Intersects(ref BoundingBox, out PlaneIntersectionType)

Check if this Plane intersects a BoundingBox.

public void Intersects(ref BoundingBox box, out PlaneIntersectionType result)

Parameters

box BoundingBox

The BoundingBox to test for intersection.

result PlaneIntersectionType

The type of intersection of this Plane with the specified BoundingBox.

Intersects(BoundingFrustum)

Check if this Plane intersects a BoundingFrustum.

public PlaneIntersectionType Intersects(BoundingFrustum frustum)

Parameters

frustum BoundingFrustum

The BoundingFrustum to test for intersection.

Returns

PlaneIntersectionType

The type of intersection of this Plane with the specified BoundingFrustum.

Intersects(BoundingSphere)

Check if this Plane intersects a BoundingSphere.

public PlaneIntersectionType Intersects(BoundingSphere sphere)

Parameters

sphere BoundingSphere

The BoundingSphere to test for intersection.

Returns

PlaneIntersectionType

The type of intersection of this Plane with the specified BoundingSphere.

Intersects(ref BoundingSphere, out PlaneIntersectionType)

Check if this Plane intersects a BoundingSphere.

public void Intersects(ref BoundingSphere sphere, out PlaneIntersectionType result)

Parameters

sphere BoundingSphere

The BoundingSphere to test for intersection.

result PlaneIntersectionType

The type of intersection of this Plane with the specified BoundingSphere.

Normalize()

Normalize the normal vector of this plane.

public void Normalize()

Normalize(Plane)

Get a normalized version of the specified plane.

public static Plane Normalize(Plane value)

Parameters

value Plane

The Plane to normalize.

Returns

Plane

A normalized version of the specified Plane.

Normalize(ref Plane, out Plane)

Get a normalized version of the specified plane.

public static void Normalize(ref Plane value, out Plane result)

Parameters

value Plane

The Plane to normalize.

result Plane

A normalized version of the specified Plane.

ToNumerics()

Returns a Plane.

public Plane ToNumerics()

Returns

Plane

ToString()

Get a string representation of this Plane.

public override string ToString()

Returns

string

A string representation of this Plane.

Transform(Plane, Matrix)

Transforms a normalized plane by a matrix.

public static Plane Transform(Plane plane, Matrix matrix)

Parameters

plane Plane

The normalized plane to transform.

matrix Matrix

The transformation matrix.

Returns

Plane

The transformed plane.

Transform(Plane, Quaternion)

Transforms a normalized plane by a quaternion rotation.

public static Plane Transform(Plane plane, Quaternion rotation)

Parameters

plane Plane

The normalized plane to transform.

rotation Quaternion

The quaternion rotation.

Returns

Plane

The transformed plane.

Transform(ref Plane, ref Matrix, out Plane)

Transforms a normalized plane by a matrix.

public static void Transform(ref Plane plane, ref Matrix matrix, out Plane result)

Parameters

plane Plane

The normalized plane to transform.

matrix Matrix

The transformation matrix.

result Plane

The transformed plane.

Transform(ref Plane, ref Quaternion, out Plane)

Transforms a normalized plane by a quaternion rotation.

public static void Transform(ref Plane plane, ref Quaternion rotation, out Plane result)

Parameters

plane Plane

The normalized plane to transform.

rotation Quaternion

The quaternion rotation.

result Plane

The transformed plane.

Operators

operator ==(Plane, Plane)

Check if two planes are equal.

public static bool operator ==(Plane plane1, Plane plane2)

Parameters

plane1 Plane

A Plane to check for equality.

plane2 Plane

A Plane to check for equality.

Returns

bool
  true
if the two planes are equal,
false
if they are not.

implicit operator Plane(Plane)

Converts a Plane to a Plane.

public static implicit operator Plane(Plane value)

Parameters

value Plane

The converted value.

Returns

Plane

operator !=(Plane, Plane)

Check if two planes are not equal.

public static bool operator !=(Plane plane1, Plane plane2)

Parameters

plane1 Plane

A Plane to check for inequality.

plane2 Plane

A Plane to check for inequality.

Returns

bool
  true
if the two planes are not equal,
false
if they are.