Microsoft.Xna.Framework
Class Plane

java.lang.Object
  extended by System.ValueType
      extended by Microsoft.Xna.Framework.Plane
All Implemented Interfaces:
IEquatable<Plane>

public final class Plane
extends ValueType
implements IEquatable<Plane>

Defines a plane.

Author:
Halofreak1990

Field Summary
 float D
          The distance of the Plane along its normal from the origin.
 Vector3 Normal
          The normal vector of the Plane.
 
Constructor Summary
Plane()
          Creates a new instance of Plane.
Plane(float a, float b, float c, float d)
          Creates a new instance of Plane.
Plane(Vector3 normal, float d)
          Creates a new instance of Plane.
Plane(Vector3 point1, Vector3 point2, Vector3 point3)
          Creates a new instance of Plane.
Plane(Vector4 value)
          Creates a new instance of Plane.
 
Method Summary
 float Dot(Vector4 value)
          Calculates the dot product of a specified Vector4 and this Plane.
 void Dot(Vector4 value, float result)
          Calculates the dot product of a specified Vector4 and this Plane.
 float DotCoordinate(Vector3 value)
          Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.
 void DotCoordinate(Vector3 value, float result)
          Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.
 float DotNormal(Vector3 value)
          Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
 void DotNormal(Vector3 value, float result)
          Returns the dot product of a specified Vector3 and the Normal vector of this Plane.
 boolean equals(java.lang.Object obj)
          Determines whether the specified Object is equal to the Plane.
 boolean Equals(Plane other)
          Determines whether the specified Plane is equal to the Plane.
 int hashCode()
          Gets the hash code for this object.
 PlaneIntersectionType Intersects(BoundingBox box)
          Checks whether the current Plane intersects a specified BoundingBox.
 void Intersects(BoundingBox box, PlaneIntersectionType result)
          Checks whether the current Plane intersects a BoundingBox.
 PlaneIntersectionType Intersects(BoundingSphere sphere)
          Checks whether the current Plane intersects a specified BoundingSphere.
 void Intersects(BoundingSphere sphere, PlaneIntersectionType result)
          Checks whether the current Plane intersects a BoundingSphere.
 void Normalize()
          Changes the coefficients of the Normal vector of this Plane to make it of unit length.
static Plane Normalize(Plane value)
          Changes the coefficients of the Normal vector of a Plane to make it of unit length.
static void Normalize(Plane value, Plane result)
          Changes the coefficients of the Normal vector of a Plane to make it of unit length.
 java.lang.String ToString()
          Returns a String that represents the current Plane.
static Plane Transform(Plane plane, Matrix matrix)
          Transforms a normalized Plane by a Matrix.
static void Transform(Plane plane, Matrix matrix, Plane result)
          Transforms a normalized Plane by a Matrix.
static Plane Transform(Plane plane, Quaternion rotation)
          Transforms a normalized Plane by a Quaternion rotation.
static void Transform(Plane plane, Quaternion rotation, Plane result)
          Transforms a normalized Plane by a Quaternion rotation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Normal

public Vector3 Normal
The normal vector of the Plane.


D

public float D
The distance of the Plane along its normal from the origin.

Constructor Detail

Plane

public Plane(float a,
             float b,
             float c,
             float d)
Creates a new instance of Plane.

Parameters:
a - X component of the normal defining the Plane.
b - Y component of the normal defining the Plane.
c - Z component of the normal defining the Plane.
d - Distance of the Plane along its normal from the origin.

Plane

public Plane(Vector3 normal,
             float d)
Creates a new instance of Plane.

Parameters:
normal - The normal vector to the Plane.
d - The Plane's distance along its normal from the origin.

Plane

public Plane(Vector4 value)
Creates a new instance of Plane.

Parameters:
value - Vector4 with X, Y, and Z components defining the normal of the Plane. The W component defines the distance of the Plane along the normal from the origin.

Plane

public Plane(Vector3 point1,
             Vector3 point2,
             Vector3 point3)
Creates a new instance of Plane.

Parameters:
point1 - One point of a triangle defining the Plane.
point2 - One point of a triangle defining the Plane.
point3 - One point of a triangle defining the Plane.

Plane

public Plane()
Creates a new instance of Plane.

Method Detail

Dot

public float Dot(Vector4 value)
Calculates the dot product of a specified Vector4 and this Plane.

Parameters:
value - The Vector4 to multiply this Plane by.

Dot

public void Dot(Vector4 value,
                float result)
Calculates the dot product of a specified Vector4 and this Plane.

Parameters:
value - The Vector4 to multiply this Plane by.
result - [OutAttribute] The dot product of the specified Vector4 and this Plane.

DotCoordinate

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

Parameters:
value - The Vector3 to multiply by.

DotCoordinate

public void DotCoordinate(Vector3 value,
                          float result)
Returns the dot product of a specified Vector3 and the Normal vector of this Plane plus the distance (D) value of the Plane.

Parameters:
value - The Vector3 to multiply by.
result - [OutAttribute] The resulting value.

DotNormal

public float DotNormal(Vector3 value)
Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Parameters:
value - The Vector3 to multiply by.

DotNormal

public void DotNormal(Vector3 value,
                      float result)
Returns the dot product of a specified Vector3 and the Normal vector of this Plane.

Parameters:
value - The Vector3 to multiply by.
result - [OutAttribute] The resulting dot product.

equals

public boolean equals(java.lang.Object obj)
Determines whether the specified Object is equal to the Plane.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The Object to compare with the current Plane.

Equals

public boolean Equals(Plane other)
Determines whether the specified Plane is equal to the Plane.

Specified by:
Equals in interface IEquatable<Plane>
Parameters:
other - The Plane to compare with the current Plane.
Returns:
true if the current object is equal to the other parameter; otherwise, false.

hashCode

public int hashCode()
Gets the hash code for this object.

Overrides:
hashCode in class java.lang.Object

Intersects

public PlaneIntersectionType Intersects(BoundingBox box)
Checks whether the current Plane intersects a specified BoundingBox.

Parameters:
box - The BoundingBox to test for intersection with.

Intersects

public PlaneIntersectionType Intersects(BoundingSphere sphere)
Checks whether the current Plane intersects a specified BoundingSphere.

Parameters:
sphere - The BoundingSphere to check for intersection with.

Intersects

public void Intersects(BoundingBox box,
                       PlaneIntersectionType result)
Checks whether the current Plane intersects a BoundingBox.

Parameters:
box - The BoundingBox to check for intersection with.
result - [OutAttribute] An enumeration indicating whether the Plane intersects the BoundingBox.

Intersects

public void Intersects(BoundingSphere sphere,
                       PlaneIntersectionType result)
Checks whether the current Plane intersects a BoundingSphere.

Parameters:
sphere - The BoundingSphere to check for intersection with.
result - [OutAttribute] An enumeration indicating whether the Plane intersects the BoundingSphere.

Normalize

public void Normalize()
Changes the coefficients of the Normal vector of this Plane to make it of unit length.


Normalize

public static Plane Normalize(Plane value)
Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Parameters:
value - The Plane to normalize.

Normalize

public static void Normalize(Plane value,
                             Plane result)
Changes the coefficients of the Normal vector of a Plane to make it of unit length.

Parameters:
value - The Plane to normalize.
result - [OutAttribute] An existing plane Plane filled in with a normalized version of the specified plane.

ToString

public java.lang.String ToString()
Returns a String that represents the current Plane.


Transform

public static Plane Transform(Plane plane,
                              Matrix matrix)
Transforms a normalized Plane by a Matrix.

Parameters:
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 - The transform Matrix to apply to the Plane.

Transform

public static Plane Transform(Plane plane,
                              Quaternion rotation)
Transforms a normalized Plane by a Quaternion rotation.

Parameters:
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.
rotation - The Quaternion rotation to apply to the Plane.

Transform

public static void Transform(Plane plane,
                             Matrix matrix,
                             Plane result)
Transforms a normalized Plane by a Matrix.

Parameters:
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 - The transform Matrix to apply to the Plane.
result - [OutAttribute] An existing Plane filled in with the results of applying the transform.

Transform

public static void Transform(Plane plane,
                             Quaternion rotation,
                             Plane result)
Transforms a normalized Plane by a Quaternion rotation.

Parameters:
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.
rotation - The Quaternion rotation to apply to the Plane.
result - [OutAttribute] An existing Plane filled in with the results of applying the rotation.