physics3d
Class Plane

java.lang.Object
  extended by physics3d.Plane

public class Plane
extends Object


Constructor Summary
Plane(Vect3 normal, Vect3 pointOnPlane)
           
 
Method Summary
 boolean containsPoint(Vect3 v)
           
 Vect3 getNormal()
           
 Vect3 getPointOnPlane()
           
static Plane MakePlaneFromThreePoints(Vect3 p1, Vect3 p2, Vect3 p3)
           
 double perpDistanceFromPlaneToPoint(Vect3 pointOffPlane)
           
 Vect3 perpVectorFromPlaneToPoint(Vect3 pointOffPlane)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plane

public Plane(Vect3 normal,
             Vect3 pointOnPlane)
Requires:
normal is not null, pointOnPlane is not null, normal.rho() != 0,
Effects:
constructs a plane
Method Detail

MakePlaneFromThreePoints

public static Plane MakePlaneFromThreePoints(Vect3 p1,
                                             Vect3 p2,
                                             Vect3 p3)
Returns:
the plane that contains these three points
Requires:
p1, p2, p3 != null p1, p2, p3 are distinct and not collinear

perpVectorFromPlaneToPoint

public Vect3 perpVectorFromPlaneToPoint(Vect3 pointOffPlane)
Returns:
the point p such that p is on this and p.minus(pointOffPlane).cross(normal) = Vect3.Zero
Requires:
pointOffPlane != null

perpDistanceFromPlaneToPoint

public double perpDistanceFromPlaneToPoint(Vect3 pointOffPlane)
Returns:
the perpendicular distance from pointOffPlane to this
Requires:
pointOffPlane != null

getNormal

public Vect3 getNormal()
Returns:
a unit vector perpendicular to this

getPointOnPlane

public Vect3 getPointOnPlane()
Returns:
a point on the plane

containsPoint

public boolean containsPoint(Vect3 v)
Returns:
true if the distance from v to this is less than GameConstants.TOLERANCE
Requires:
v != null