com.threerings.math
Class Ray3D

java.lang.Object
  extended by com.threerings.math.Ray3D

public final class Ray3D
extends Object

A ray consisting of an origin point and a unit direction vector.


Constructor Summary
Ray3D()
          Creates an empty (invalid) ray.
Ray3D(Ray3D other)
          Copy constructor.
Ray3D(Vector3f origin, Vector3f direction)
          Creates a ray with the values contained in the supplied origin point and unit direction vector.
 
Method Summary
 Vector3f getDirection()
          Returns a reference to the ray's unit direction vector.
 Vector3f getOrigin()
          Returns a reference to the ray's point of origin.
 Ray3D set(Ray3D other)
          Copies the parameters of another ray.
 Ray3D set(Vector3f origin, Vector3f direction)
          Sets the ray parameters to the values contained in the supplied vectors.
 String toString()
           
 Ray3D transform(Transform3D transform)
          Transforms this ray.
 Ray3D transform(Transform3D transform, Ray3D result)
          Transforms this ray, placing the result in the object provided.
 Ray3D transformLocal(Transform3D transform)
          Transforms this ray in-place.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Ray3D

public Ray3D(Vector3f origin,
             Vector3f direction)
Creates a ray with the values contained in the supplied origin point and unit direction vector.


Ray3D

public Ray3D(Ray3D other)
Copy constructor.


Ray3D

public Ray3D()
Creates an empty (invalid) ray.

Method Detail

getOrigin

public Vector3f getOrigin()
Returns a reference to the ray's point of origin.


getDirection

public Vector3f getDirection()
Returns a reference to the ray's unit direction vector.


transformLocal

public Ray3D transformLocal(Transform3D transform)
Transforms this ray in-place.

Returns:
a reference to this ray, for chaining.

transform

public Ray3D transform(Transform3D transform)
Transforms this ray.

Returns:
a new ray containing the result.

transform

public Ray3D transform(Transform3D transform,
                       Ray3D result)
Transforms this ray, placing the result in the object provided.

Returns:
a reference to the result ray, for chaining.

set

public Ray3D set(Ray3D other)
Copies the parameters of another ray.

Returns:
a reference to this ray, for chaining.

set

public Ray3D set(Vector3f origin,
                 Vector3f direction)
Sets the ray parameters to the values contained in the supplied vectors.

Returns:
a reference to this ray, for chaining.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.