toxi.geom
Class Line3D
java.lang.Object
toxi.geom.Line3D
public class Line3D
- extends java.lang.Object
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
a
public Vec3D a
b
public Vec3D b
Line3D
public Line3D(Vec3D a,
Vec3D b)
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 pointb
- end point (always added to results)stepLength
- desired distance between pointssegments
- 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