toxi.geom
Class Line3D

java.lang.Object
  extended by toxi.geom.Line3D

public class Line3D
extends java.lang.Object


Field Summary
 Vec3D a
           
 Vec3D b
           
 
Constructor Summary
Line3D(Vec3D a, Vec3D b)
           
 
Method Summary
 Line3D copy()
           
 Vec3D getDirection()
           
 float getLength()
           
 Vec3D getMidPoint()
           
 Vec3D getNormal()
           
 java.util.ArrayList<Vec3D> splitIntoSegments(java.util.ArrayList<Vec3D> segments, float stepLength, boolean addFirst)
           
static java.util.ArrayList<Vec3D> splitIntoSegments(Vec3D a, Vec3D b, float stepLength, java.util.ArrayList<Vec3D> segments, boolean addFirst)
          Splits the line between A and B into segments of the given length, starting at point A.
 Ray3D toRay3D()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

a

public Vec3D a

b

public Vec3D b
Constructor Detail

Line3D

public Line3D(Vec3D a,
              Vec3D b)
Method Detail

splitIntoSegments

public static final java.util.ArrayList<Vec3D> splitIntoSegments(Vec3D a,
                                                                 Vec3D b,
                                                                 float stepLength,
                                                                 java.util.ArrayList<Vec3D> segments,
                                                                 boolean addFirst)
Splits the line between A and B into segments of the given length, starting at point A. The tweened points are added to the given result list. The last point added is B itself and hence it is likely that the last segment has a shorter length than the step length requested. The first point (A) can be omitted and not be added to the list if so desired.

Parameters:
a - start point
b - end point (always added to results)
stepLength - desired distance between points
segments - existing array list for results (or a new list, if null)
addFirst - false, if A is NOT to be added to results
Returns:
list of result vectors

copy

public Line3D copy()

getDirection

public Vec3D getDirection()

getLength

public float getLength()

getMidPoint

public Vec3D getMidPoint()

getNormal

public Vec3D getNormal()

splitIntoSegments

public java.util.ArrayList<Vec3D> splitIntoSegments(java.util.ArrayList<Vec3D> segments,
                                                    float stepLength,
                                                    boolean addFirst)

toRay3D

public Ray3D toRay3D()

toString

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