Class Ray3d

java.lang.Object
  extended by Ray3d

public class Ray3d
extends java.lang.Object

A class for manipulating 3-dimensional rays. A Ray3d is specified by an origin point and a direction vector.


Constructor Summary
Ray3d()
          Constructs a new Ray3d with an origin of (0, 0, 0) and a direction of (0, 0, 0).
Ray3d(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction)
          Constructs a new ray initialized to the specified origin and direction.
 
Method Summary
 javax.vecmath.Vector3d getDirection()
          Returns the direction of the ray.
 javax.vecmath.Point3d getOrigin()
          Returns the origin of the ray.
 javax.vecmath.Point3d interpolate(double time)
          Returns the point along the ray that is at the specified time from the origin.
 void set(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction)
          Sets the origin and direction of the ray.
 void setDirection(javax.vecmath.Vector3d direction)
          Sets the direction of the ray.
 void setNormalized(javax.vecmath.Point3d origin, javax.vecmath.Vector3d direction)
          Sets the origin and direction of the ray, after normalizing the direction.
 void setOrigin(javax.vecmath.Point3d origin)
          Sets the origin of the ray.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ray3d

public Ray3d()
Constructs a new Ray3d with an origin of (0, 0, 0) and a direction of (0, 0, 0).


Ray3d

public Ray3d(javax.vecmath.Point3d origin,
             javax.vecmath.Vector3d direction)
Constructs a new ray initialized to the specified origin and direction. The direction is normalized.

Parameters:
origin - The ray's origin.
direction - The ray's direction.
Method Detail

set

public void set(javax.vecmath.Point3d origin,
                javax.vecmath.Vector3d direction)
Sets the origin and direction of the ray.

Parameters:
origin - The ray's origin.
direction - The ray's direction.

setNormalized

public void setNormalized(javax.vecmath.Point3d origin,
                          javax.vecmath.Vector3d direction)
Sets the origin and direction of the ray, after normalizing the direction.

Parameters:
origin - The ray's origin.
direction - The ray's direction.

interpolate

public javax.vecmath.Point3d interpolate(double time)
Returns the point along the ray that is at the specified time from the origin.

Parameters:
time - The time from the ray's origin.
Returns:
The point on the ray at time.

setOrigin

public void setOrigin(javax.vecmath.Point3d origin)
Sets the origin of the ray.

Parameters:
origin - The ray's origin.

getOrigin

public javax.vecmath.Point3d getOrigin()
Returns the origin of the ray.

Returns:
The ray's origin.

setDirection

public void setDirection(javax.vecmath.Vector3d direction)
Sets the direction of the ray.

Parameters:
direction - The ray's direction.

getDirection

public javax.vecmath.Vector3d getDirection()
Returns the direction of the ray.

Returns:
The ray's direction.