jme.math
Class Line

java.lang.Object
  extended byjme.math.Line

public class Line
extends java.lang.Object

Line defines a line represented as L(t) = origin + t * direction for any real-valued t, and direction is not necessarily unit length. This can further be thought of as a ray, infinite line or a line segment.

Version:
$Id: Line.java,v 1.2 2003/08/22 02:26:48 mojomonkey Exp $
Author:
Mark Powell

Constructor Summary
Line()
          Default constructor instantiates a new Line that is defined by an origin and a direction.
Line(Vector origin, Vector direction)
          Constructor instantiates a new Line that is supplied an origin and direction.
 
Method Summary
 Vector getDirection()
          getDirection returns the direction of the line.
 Vector getOrigin()
          getOrigin retrieves the direction of the line.
 void setDirection(Vector direction)
          setDirection sets the direction of the line.
 void setOrigin(Vector origin)
          setOrigin sets the new origin of the line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line()
Default constructor instantiates a new Line that is defined by an origin and a direction.


Line

public Line(Vector origin,
            Vector direction)
Constructor instantiates a new Line that is supplied an origin and direction.

Parameters:
origin - the origin of the line.
direction - the direction of the line.
Method Detail

getDirection

public Vector getDirection()
getDirection returns the direction of the line.

Returns:
the direction of the line.

setDirection

public void setDirection(Vector direction)
setDirection sets the direction of the line.

Parameters:
direction - the new direction of the line.

getOrigin

public Vector getOrigin()
getOrigin retrieves the direction of the line.

Returns:
the direction of the line.

setOrigin

public void setOrigin(Vector origin)
setOrigin sets the new origin of the line.

Parameters:
origin - the new origin of the line.