All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----acg.stuttgart.rich.spline.Spline3D | +----acg.stuttgart.rich.spline.CatmullRomSpline3D | +----acg.stuttgart.rich.spline.CatmullRomSplineLoop3D
Summary |
public class CatmullRomSplineLoop3D extends acg.stuttgart.rich.spline.CatmullRomSpline3D { // Constructors 2 public CatmullRomSplineLoop3D(); public CatmullRomSplineLoop3D(float); // Methods 6 protected void calculateTangents(); public Vector3D evaluate(float) throws SplineException; public void evaluate(float, Vector3D) throws SplineException; protected void updateHermiteTree(); public void updateKnots(Vector3D[]) throws SplineException; public void updateKnots(Vector3D[], int) throws SplineException; }
The CatmullRomSplineLoop3D class is an interpolating 3D spline loop with Catmull-Rom continuity at the knots. To create the loop, the first knot is duplicated to close the spline, and tangents at the beginning and end of the spline are calculated as though the spline were a closed loop.
Constructors |
· CatmullRomSplineLoop3D | Summary | Top |
public CatmullRomSplineLoop3D(float smoothness)
The constructor takes a "smoothness" parameter, which if not specified defaults to 0.33.
· CatmullRomSplineLoop3D | Summary | Top |
public CatmullRomSplineLoop3D()
Methods |
· updateKnots | Summary | Top |
public void updateKnots(Vector3D[] newKnots) throws SplineException
The updateKnots method replaces the current spline knots with an array of new knots. The length of the array must be the same as the number of knots.
- Overrides:
- updateKnots in class CatmullRomSpline3D
· updateKnots | Summary | Top |
public void updateKnots(Vector3D[] newKnots, int offset) throws SplineException
The updateKnots method replaces the current spline knots with an array of new knots. This version takes as a prameter an offset into an array. If the offset plus the current number of knots is greater than the length of the array, an exception is signaled.
- Overrides:
- updateKnots in class CatmullRomSpline3D
· evaluate | Summary | Top |
public Vector3D evaluate(float s) throws SplineException
For loop splines, we want the evaluation parameter to "wrap around" the interval from zero to one. This version of evaluate "wraps"
s
before calling evaluate in the parent class.
- Overrides:
- evaluate in class CatmullRomSpline3D
· evaluate | Summary | Top |
public void evaluate(float s, Vector3D val) throws SplineException
Wrap and evaluate in-place.
- Overrides:
- evaluate in class CatmullRomSpline3D
· updateHermiteTree | Summary | Top |
protected void updateHermiteTree()
This method constructs a tree of hermite spline nodes, allowing rapid evaluation of the spline (log(n) comparisons).
- Overrides:
- updateHermiteTree in class CatmullRomSpline3D
· calculateTangents | Summary | Top |
protected void calculateTangents()
The calculateTangents method calculates tangents and spline length for updateHermiteTree and updateKnots. This version adds a knot to close the spline loop and calculates the beginning and ending tangents accordingly.
- Overrides:
- calculateTangents in class CatmullRomSpline3D
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7