Rings
Version 0.3

threeD.raytracer.engine
Class Ray

java.lang.Object
  extended bythreeD.raytracer.engine.Ray
All Implemented Interfaces:
java.lang.Cloneable

public class Ray
extends java.lang.Object
implements java.lang.Cloneable

A Ray object represents a 3d ray. It stores the origin and direction of a 3d ray, which are vector quantities, as Vector objects.


Constructor Summary
Ray()
          Constructs a Ray object with origin and direction at the origin.
Ray(Vector origin, Vector direction)
          Constructs a Ray object using the specified origin and direction vectors.
 
Method Summary
 java.lang.Object clone()
           
 Vector getDirection()
          Returns the direction of this Ray object as a Vector object.
 Vector getOrigin()
          Returns the origin of this Ray object as a Vector object.
 Vector pointAt(double t)
          Returns the point on the ray represented by this Ray object at distance t from the origin as a Vector object.
 void setDirection(Vector direction)
          Sets the direction of this Ray object to the specified direction vector.
 void setOrigin(Vector origin)
          Sets the origin of this Ray object to the specified origin vector.
 java.lang.String toString()
          Returns a String representation of this Ray object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Ray

public Ray()
Constructs a Ray object with origin and direction at the origin.


Ray

public Ray(Vector origin,
           Vector direction)
Constructs a Ray object using the specified origin and direction vectors.

Method Detail

setOrigin

public void setOrigin(Vector origin)
Sets the origin of this Ray object to the specified origin vector.


setDirection

public void setDirection(Vector direction)
Sets the direction of this Ray object to the specified direction vector.


getOrigin

public Vector getOrigin()
Returns the origin of this Ray object as a Vector object.


getDirection

public Vector getDirection()
Returns the direction of this Ray object as a Vector object.


pointAt

public Vector pointAt(double t)
Returns the point on the ray represented by this Ray object at distance t from the origin as a Vector object.


clone

public java.lang.Object clone()

toString

public java.lang.String toString()
Returns a String representation of this Ray object.


Rings
Version 0.3

Copyright 2003-05 Mike Murray