com.jme.math
Class Line

java.lang.Object
  extended bycom.jme.math.Line

public class Line
extends java.lang.Object

Line defines a line. Where a line is defined as infinite along two points. The two points of the line are defined as the origin and direction.

Version:
$Id: Line.java,v 1.3 2004/04/22 22:26:39 renanse Exp $
Author:
Mark Powell

Constructor Summary
Line()
          Constructor instantiates a new Line object.
Line(Vector3f origin, Vector3f direction)
          Constructor instantiates a new Line object.
 
Method Summary
 Vector3f getDirection()
          getDirection returns the direction of the line.
 Vector3f getOrigin()
          getOrigin returns the origin of the line.
 Vector3f random()
          random determines a random point along the line.
 void setDirection(Vector3f direction)
          setDirection sets the direction of the line.
 void setOrigin(Vector3f origin)
          setOrigin sets the 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()
Constructor instantiates a new Line object. The origin and direction are set to defaults (0,0,0).


Line

public Line(Vector3f origin,
            Vector3f direction)
Constructor instantiates a new Line object. The origin and direction are set via the parameters.

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

getOrigin

public Vector3f getOrigin()
getOrigin returns the origin of the line.

Returns:
the origin of the line.

setOrigin

public void setOrigin(Vector3f origin)
setOrigin sets the origin of the line.

Parameters:
origin - the origin of the line.

getDirection

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

Returns:
the direction of the line.

setDirection

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

Parameters:
direction - the direction of the line.

random

public Vector3f random()
random determines a random point along the line.

Returns:
a random point on the line.