toxi.geom
Class Ray3D

java.lang.Object
  extended by toxi.geom.Vec3D
      extended by toxi.geom.Ray3D
All Implemented Interfaces:
java.lang.Comparable<Vec3D>

public class Ray3D
extends Vec3D

A simple 3D ray datatype


Nested Class Summary
 
Nested classes/interfaces inherited from class toxi.geom.Vec3D
Vec3D.Axis
 
Field Summary
 
Fields inherited from class toxi.geom.Vec3D
MAX_VALUE, MIN_VALUE, x, X_AXIS, y, Y_AXIS, z, Z_AXIS, ZERO
 
Constructor Summary
Ray3D()
           
Ray3D(float x, float y, float z, Vec3D d)
           
Ray3D(Vec3D o, Vec3D d)
           
 
Method Summary
 Vec3D getDirection()
          Returns a copy of the ray's direction vector.
 Vec3D getPointAtDistance(float dist)
          Returns the point at the given distance on the ray.
 Ray3D setDirection(Vec3D d)
          Uses a normalized copy of the given vector as the ray direction.
 Line3D toLine3DWithPointAtDistance(float dist)
          Converts the ray into a 3D Line segment with its start point coinciding with the ray origin and its other end point at the given distance along the ray.
 java.lang.String toString()
           
 
Methods inherited from class toxi.geom.Vec3D
abs, add, add, addSelf, addSelf, angleBetween, angleBetween, clear, closestPointOnLine, compareTo, constrain, constrain, copy, cross, crossInto, crossSelf, distanceTo, distanceToSquared, dot, equals, equalsWithTolerance, floor, frac, fromXYTheta, fromXZTheta, fromYZTheta, getAbs, getComponent, getConstrained, getFloored, getFrac, getInverted, getLimited, getNormalized, getNormalizedTo, getReciprocal, getRotatedAroundAxis, getRotatedX, getRotatedY, getRotatedZ, getSignum, hashCode, headingXY, headingXZ, headingYZ, interpolateTo, interpolateTo, interpolateToSelf, interpolateToSelf, invert, isInAABB, isInAABB, isZeroVector, jitter, jitter, jitter, limit, magnitude, magSquared, max, maxSelf, min, minSelf, modSelf, modSelf, normalize, normalizeTo, randomVector, randomVector, reciprocal, rotateAroundAxis, rotateX, rotateY, rotateZ, scale, scale, scale, scaleSelf, scaleSelf, scaleSelf, set, set, setComponent, setXY, signum, sub, sub, subSelf, subSelf, to2DXY, to2DXZ, to2DYZ, toArray, toCartesian, toSpherical
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Ray3D

public Ray3D()

Ray3D

public Ray3D(float x,
             float y,
             float z,
             Vec3D d)

Ray3D

public Ray3D(Vec3D o,
             Vec3D d)
Method Detail

getDirection

public Vec3D getDirection()
Returns a copy of the ray's direction vector.

Returns:
vector

getPointAtDistance

public Vec3D getPointAtDistance(float dist)
Returns the point at the given distance on the ray. The distance can be any real number.

Parameters:
dist -
Returns:
vector

setDirection

public Ray3D setDirection(Vec3D d)
Uses a normalized copy of the given vector as the ray direction.

Parameters:
d - new direction
Returns:
itself

toLine3DWithPointAtDistance

public Line3D toLine3DWithPointAtDistance(float dist)
Converts the ray into a 3D Line segment with its start point coinciding with the ray origin and its other end point at the given distance along the ray.

Parameters:
dist - end point distance
Returns:
line segment

toString

public java.lang.String toString()
Overrides:
toString in class Vec3D