es.ucm.look.ar.math.geom
Class Plane

java.lang.Object
  extended by es.ucm.look.ar.math.geom.Plane

public class Plane
extends java.lang.Object

Represents a geometric plane


Constructor Summary
Plane(Point3 p1, Point3 p2, Point3 p3)
          Constructs a plane from three points
Plane(Point3 p, Vector3 n)
          Constructs a plane from a point and its normal
 
Method Summary
 Vector3 getNormal()
          Returns the plane's normal vector
static Plane getVolatilePlane(Point3 point, Vector3 normal)
          Returns a volatile plane from a point and its normal
 float intersects(Ray ray)
          Returns the t parameter for the intersection with the given ray.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plane

public Plane(Point3 p1,
             Point3 p2,
             Point3 p3)
Constructs a plane from three points

Parameters:
p1 - Point 1
p2 - Point 2
p3 - Point 3

Plane

public Plane(Point3 p,
             Vector3 n)
Constructs a plane from a point and its normal

Parameters:
p - Point contained by the plane
n - Normal vector for the plane
Method Detail

getNormal

public Vector3 getNormal()
Returns the plane's normal vector

Returns:
the plane's normal vector

getVolatilePlane

public static Plane getVolatilePlane(Point3 point,
                                     Vector3 normal)
Returns a volatile plane from a point and its normal

Parameters:
p - Point contained by the plane
n - Normal vector for the plane

intersects

public float intersects(Ray ray)
Returns the t parameter for the intersection with the given ray. If plane and ray has no intersection returns -1 representing infinite. Value returned must be used with Ray.getPoint(float)

Parameters:
ray - Ray to be checked
Returns:
the t parameter for the ray in the intersection point. If plane and ray has no intersection returns -1