Class XMPlane
The plane functions provided by DirectXMath.
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public static class XMPlane
Remarks
These functions use an XMVector 4-vector to represent the coefficients of the plane equation, Ax+By+Cz+D = 0
, where the X-component is A, the Y-component is B, the Z-component is C, and the W-component is D.
Methods
| Edit this page View SourceDot(XMVector, XMVector)
Calculates the dot product between an input plane and a 4D vector.
Declaration
public static XMVector Dot(XMVector p, XMVector v)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
XMVector | v | The 4D vector to use in the dot product. |
Returns
Type | Description |
---|---|
XMVector | Returns the dot product of P and V replicated into each of the four components of the returned XMVector. |
DotCoord(XMVector, XMVector)
Calculates the dot product between an input plane and a 3D vector.
Declaration
public static XMVector DotCoord(XMVector p, XMVector v)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
XMVector | v | 3D vector to use in the dot product. The w component of V is always treated as if is 1.0f. |
Returns
Type | Description |
---|---|
XMVector | Returns the dot product between P and V replicated into each of the four components of the returned XMVector. |
DotNormal(XMVector, XMVector)
Calculates the dot product between the normal vector of a plane and a 3D vector.
Declaration
public static XMVector DotNormal(XMVector p, XMVector v)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
XMVector | v | 3D vector to use in the dot product. The w component of V is always treated as if is 0.0f. |
Returns
Type | Description |
---|---|
XMVector | Returns the dot product between the normal vector of the plane and V replicated into each of the four components of the returned XMVector. |
Equal(XMVector, XMVector)
Determines if two planes are equal.
Declaration
public static bool Equal(XMVector p1, XMVector p2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p1 | The first plane. |
XMVector | p2 | The second plane. |
Returns
Type | Description |
---|---|
bool | Returns true if the two planes are equal and false otherwise. |
FromPointNormal(XMVector, XMVector)
Computes the equation of a plane constructed from a point in the plane and a normal vector.
Declaration
public static XMVector FromPointNormal(XMVector point, XMVector normal)
Parameters
Type | Name | Description |
---|---|---|
XMVector | point | A point in the plane. |
XMVector | normal | The normal to the plane. |
Returns
Type | Description |
---|---|
XMVector | Returns a vector whose components are the coefficients of the plane. |
FromPoints(XMVector, XMVector, XMVector)
Computes the equation of a plane constructed from three points in the plane.
Declaration
public static XMVector FromPoints(XMVector point1, XMVector point2, XMVector point3)
Parameters
Type | Name | Description |
---|---|---|
XMVector | point1 | A first point in the plane. |
XMVector | point2 | A second point in the plane. |
XMVector | point3 | A third point in the plane. |
Returns
Type | Description |
---|---|
XMVector | Returns a vector whose components are the coefficients of the plane. |
IntersectLine(XMVector, XMVector, XMVector)
Finds the intersection between a plane and a line.
Declaration
public static XMVector IntersectLine(XMVector p, XMVector linePoint1, XMVector linePoint2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane |
XMVector | linePoint1 | The first point on the line. |
XMVector | linePoint2 | The second point on the line. |
Returns
Type | Description |
---|---|
XMVector | Returns the intersection of the plane P and the line defined by LinePoint1 and LinePoint2. If the line is parallel to the plane, all components of the returned vector are equal to QNaN. |
IntersectPlane(out XMVector, out XMVector, XMVector, XMVector)
Finds the intersection of two planes.
Declaration
public static void IntersectPlane(out XMVector linePoint1, out XMVector linePoint2, XMVector p1, XMVector p2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | linePoint1 | One point on the line of intersection. |
XMVector | linePoint2 | A second point on the line of intersection. |
XMVector | p1 | The first plane. |
XMVector | p2 | The second plane. |
IsInfinite(XMVector)
Tests whether any of the coefficients of a plane is positive or negative infinity.
Declaration
public static bool IsInfinite(XMVector p)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
Returns
Type | Description |
---|---|
bool | Returns true if any of the coefficients of the plane is positive or negative infinity, and false otherwise. |
IsNaN(XMVector)
Tests whether any of the coefficients of a plane is a NaN.
Declaration
public static bool IsNaN(XMVector p)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
Returns
Type | Description |
---|---|
bool | Returns true if any of the coefficients of the plane is a NaN, and false otherwise. |
NearEqual(XMVector, XMVector, XMVector)
Determines whether two planes are nearly equal.
Declaration
public static bool NearEqual(XMVector p1, XMVector p2, XMVector epsilon)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p1 | The first plane. |
XMVector | p2 | The second plane. |
XMVector | epsilon | the component-wise tolerance to use. |
Returns
Type | Description |
---|---|
bool | Returns true if P1 is nearly equal to P2 and false otherwise. |
Normalize(XMVector)
Normalizes the coefficients of a plane so that coefficients of x, y, and z form a unit normal vector.
Declaration
public static XMVector Normalize(XMVector p)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
Returns
Type | Description |
---|---|
XMVector | Returns the normalized plane. |
NormalizeEst(XMVector)
Estimates the coefficients of a plane so that coefficients of x, y, and z form a unit normal vector.
Declaration
public static XMVector NormalizeEst(XMVector p)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
Returns
Type | Description |
---|---|
XMVector | Returns an estimation of the normalized plane. |
NotEqual(XMVector, XMVector)
Determines if two planes are unequal.
Declaration
public static bool NotEqual(XMVector p1, XMVector p2)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p1 | The first plane. |
XMVector | p2 | The second plane. |
Returns
Type | Description |
---|---|
bool | Returns true if the two planes are unequal and false otherwise. |
Transform(XMVector, XMMatrix)
Transforms a plane by a given matrix.
Declaration
public static XMVector Transform(XMVector p, XMMatrix m)
Parameters
Type | Name | Description |
---|---|---|
XMVector | p | The plane. |
XMMatrix | m | The transformation matrix. |
Returns
Type | Description |
---|---|
XMVector | Returns the transformed plane. |