physics3d
Class Line

java.lang.Object
  extended by physics3d.Line

public class Line
extends Object


Constructor Summary
Line(Vect3 direction, Vect3 pointOnLine)
           
 
Method Summary
 boolean containsPoint(Vect3 v)
           
 Vect3 getDirection()
           
 Vect3 getPointOnLine()
           
 Vect3 getPointOnLineClosestToP(Vect3 p)
           
static Line MakeLineFromTwoPoints(Vect3 p1, Vect3 p2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line(Vect3 direction,
            Vect3 pointOnLine)
Requires:
direction is not null, pointOnLine is not null,
Effects:
constructs a Line
Method Detail

MakeLineFromTwoPoints

public static Line MakeLineFromTwoPoints(Vect3 p1,
                                         Vect3 p2)
Returns:
the line that contains these two points
Requires:
p1, p2 != null !p1.equals(p2)

getDirection

public Vect3 getDirection()
Returns:
the direction of this

getPointOnLine

public Vect3 getPointOnLine()
Returns:
a point on this

containsPoint

public boolean containsPoint(Vect3 v)
Returns:
true if v is within GameConstants.TOLERANCE of this
Requires:
v != null

getPointOnLineClosestToP

public Vect3 getPointOnLineClosestToP(Vect3 p)
Returns:
the point on this such that v.minus(p).cross(direction) = Vect3.ZERO
Requires:
v != null