Class PlaneD
Defines a PlaneD.
Inheritance
Namespace: VRageMath
Assembly: VRage.Math.dll
Syntax
public sealed class PlaneD : ValueType, IEquatable<PlaneD>
Constructors
PlaneD(Double, Double, Double, Double)
Creates a new instance of PlaneD.
Declaration
public PlaneD(double a, double b, double c, double d)
Parameters
Type | Name | Description |
---|---|---|
System.Double | a | X component of the normal defining the PlaneD. |
System.Double | b | Y component of the normal defining the PlaneD. |
System.Double | c | Z component of the normal defining the PlaneD. |
System.Double | d | Distance of the origin from the PlaneD along its normal. |
PlaneD(Vector3D, Double)
Creates a new instance of PlaneD.
Declaration
public PlaneD(Vector3D normal, double d)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | normal | The normal vector to the PlaneD. |
System.Double | d | The distance of the origin from the PlaneD along its normal. |
PlaneD(Vector3D, Vector3)
Creates a new instance of Plane.
Declaration
public PlaneD(Vector3D position, Vector3 normal)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | position | A point that lies on the Plane |
Vector3 | normal | The normal vector to the Plane. |
PlaneD(Vector3D, Vector3D)
Creates a new instance of Plane.
Declaration
public PlaneD(Vector3D position, Vector3D normal)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | position | A point that lies on the Plane |
Vector3D | normal | The normal vector to the Plane. |
PlaneD(Vector3D, Vector3D, Vector3D)
Creates a new instance of PlaneD.
Declaration
public PlaneD(Vector3D point1, Vector3D point2, Vector3D point3)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | point1 | One point of a triangle defining the PlaneD. |
Vector3D | point2 | One point of a triangle defining the PlaneD. |
Vector3D | point3 | One point of a triangle defining the PlaneD. |
PlaneD(Vector4)
Creates a new instance of PlaneD.
Declaration
public PlaneD(Vector4 value)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | value | Vector4 with X, Y, and Z components defining the normal of the PlaneD. The W component defines the distance of the origin from the PlaneD along its normal. |
Fields
D
The distance of the PlaneD 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 double D
Field Value
Type | Description |
---|---|
System.Double |
Normal
The normal vector of the PlaneD.
Declaration
public Vector3D Normal
Field Value
Type | Description |
---|---|
Vector3D |
Methods
DistanceToPoint(Vector3D)
Declaration
public double DistanceToPoint(Vector3D point)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | point |
Returns
Type | Description |
---|---|
System.Double |
DistanceToPoint(ref Vector3D)
Declaration
public double DistanceToPoint(ref Vector3D point)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | point |
Returns
Type | Description |
---|---|
System.Double |
Dot(Vector4)
Calculates the dot product of a specified Vector4 and this PlaneD.
Declaration
public double Dot(Vector4 value)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | value | The Vector4 to multiply this PlaneD by. |
Returns
Type | Description |
---|---|
System.Double |
Dot(ref Vector4, out Double)
Calculates the dot product of a specified Vector4 and this PlaneD.
Declaration
public void Dot(ref Vector4 value, out double result)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | value | The Vector4 to multiply this PlaneD by. |
System.Double | result | [OutAttribute] The dot product of the specified Vector4 and this PlaneD. |
DotCoordinate(Vector3D)
Returns the dot product of a specified Vector3D and the Normal vector of this PlaneD plus the distance (D) value of the PlaneD.
Declaration
public double DotCoordinate(Vector3D value)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | value | The Vector3D to multiply by. |
Returns
Type | Description |
---|---|
System.Double |
DotCoordinate(ref Vector3D, out Double)
Returns the dot product of a specified Vector3D and the Normal vector of this PlaneD plus the distance (D) value of the PlaneD.
Declaration
public void DotCoordinate(ref Vector3D value, out double result)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | value | The Vector3D to multiply by. |
System.Double | result | [OutAttribute] The resulting value. |
DotNormal(Vector3D)
Returns the dot product of a specified Vector3D and the Normal vector of this PlaneD.
Declaration
public double DotNormal(Vector3D value)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | value | The Vector3D to multiply by. |
Returns
Type | Description |
---|---|
System.Double |
DotNormal(ref Vector3D, out Double)
Returns the dot product of a specified Vector3D and the Normal vector of this PlaneD.
Declaration
public void DotNormal(ref Vector3D value, out double result)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | value | The Vector3D to multiply by. |
System.Double | result | [OutAttribute] The resulting dot product. |
Equals(Object)
Determines whether the specified Object is equal to the PlaneD.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The Object to compare with the current PlaneD. |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(PlaneD)
Determines whether the specified PlaneD is equal to the PlaneD.
Declaration
public bool Equals(PlaneD other)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | other | The PlaneD to compare with the current PlaneD. |
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(BoundingBoxD)
Checks whether the current PlaneD intersects a specified BoundingBox.
Declaration
public PlaneIntersectionType Intersects(BoundingBoxD box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBoxD | box | The BoundingBox to test for intersection with. |
Returns
Type | Description |
---|---|
PlaneIntersectionType |
Intersects(ref BoundingBoxD, out PlaneIntersectionType)
Checks whether the current PlaneD intersects a BoundingBox.
Declaration
public void Intersects(ref BoundingBoxD box, out PlaneIntersectionType result)
Parameters
Type | Name | Description |
---|---|---|
BoundingBoxD | box | The BoundingBox to check for intersection with. |
PlaneIntersectionType | result | [OutAttribute] An enumeration indicating whether the PlaneD intersects the BoundingBox. |
Intersects(BoundingFrustumD)
Checks whether the current PlaneD intersects a specified BoundingFrustum.
Declaration
public PlaneIntersectionType Intersects(BoundingFrustumD frustum)
Parameters
Type | Name | Description |
---|---|---|
BoundingFrustumD | frustum | The BoundingFrustum to check for intersection with. |
Returns
Type | Description |
---|---|
PlaneIntersectionType |
Intersects(ref BoundingSphere, out PlaneIntersectionType)
Checks whether the current PlaneD 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 PlaneD intersects the BoundingSphere. |
Intersects(BoundingSphereD)
Checks whether the current PlaneD intersects a specified BoundingSphere.
Declaration
public PlaneIntersectionType Intersects(BoundingSphereD sphere)
Parameters
Type | Name | Description |
---|---|---|
BoundingSphereD | sphere | The BoundingSphere to check for intersection with. |
Returns
Type | Description |
---|---|
PlaneIntersectionType |
Normalize()
Changes the coefficients of the Normal vector of this PlaneD to make it of unit length.
Declaration
public void Normalize()
Normalize(PlaneD)
Changes the coefficients of the Normal vector of a PlaneD to make it of unit length.
Declaration
public static PlaneD Normalize(PlaneD value)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | value | The PlaneD to normalize. |
Returns
Type | Description |
---|---|
PlaneD |
Normalize(ref PlaneD, out PlaneD)
Changes the coefficients of the Normal vector of a PlaneD to make it of unit length.
Declaration
public static void Normalize(ref PlaneD value, out PlaneD result)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | value | The PlaneD to normalize. |
PlaneD | result | [OutAttribute] An existing PlaneD PlaneD filled in with a normalized version of the specified PlaneD. |
ProjectPoint(ref Vector3D)
Declaration
public Vector3D ProjectPoint(ref Vector3D point)
Parameters
Type | Name | Description |
---|---|---|
Vector3D | point |
Returns
Type | Description |
---|---|
Vector3D |
RandomPoint()
Declaration
public Vector3D RandomPoint()
Returns
Type | Description |
---|---|
Vector3D |
ToString()
Returns a String that represents the current PlaneD.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Transform(PlaneD, MatrixD)
Transforms a normalized plane by a Matrix.
Declaration
public static PlaneD Transform(PlaneD plane, MatrixD matrix)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | 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. |
MatrixD | matrix | The transform Matrix to apply to the plane. |
Returns
Type | Description |
---|---|
PlaneD |
Transform(ref PlaneD, ref MatrixD, out PlaneD)
Transforms a normalized plane by a Matrix.
Declaration
public static void Transform(ref PlaneD plane, ref MatrixD matrix, out PlaneD result)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | 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. |
MatrixD | matrix | The transform Matrix to apply to the plane. |
PlaneD | result | [OutAttribute] An existing PlaneD filled in with the results of applying the transform. |
Operators
Equality(PlaneD, PlaneD)
Determines whether two instances of PlaneD are equal.
Declaration
public static bool operator ==(PlaneD lhs, PlaneD rhs)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | lhs | The object to the left of the equality operator. |
PlaneD | rhs | The object to the right of the equality operator. |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(PlaneD, PlaneD)
Determines whether two instances of PlaneD are not equal.
Declaration
public static bool operator !=(PlaneD lhs, PlaneD rhs)
Parameters
Type | Name | Description |
---|---|---|
PlaneD | lhs | The object to the left of the inequality operator. |
PlaneD | rhs | The object to the right of the inequality operator. |
Returns
Type | Description |
---|---|
System.Boolean |