physics3d
Class Line
java.lang.Object
physics3d.Line
public class Line
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Line
public Line(Vect3 direction,
Vect3 pointOnLine)
- Requires:
direction
is not null, pointOnLine
is not null,
- Effects:
- constructs a Line
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