com.sun.j3d.utils.behaviors.interpolators
Class CubicSplineCurve

java.lang.Object
  extended by com.sun.j3d.utils.behaviors.interpolators.CubicSplineCurve

public class CubicSplineCurve
extends java.lang.Object

CubicSplineCurve is a container class that holds a number of cubicSplineSegments

Since:
Java3D 1.1

Field Summary
private  CubicSplineSegment[] cubicSplineSegment
           
 int numSegments
           
private  float totalCurveLength
           
 
Constructor Summary
CubicSplineCurve()
          Default constructor
CubicSplineCurve(CubicSplineSegment[] s)
          This method takes a list of spline segments creates the CubicSplineCurve.
CubicSplineCurve(TCBKeyFrame[] keys)
          This method takes a list of key frames and creates spline segments from it.
 
Method Summary
private  void computeTotalCurveLength()
           
 CubicSplineSegment getSegment(int index)
          This method returns the CubicSplineSegments pointed to by index
 float getTotalCurveLength()
          This method returns the total length of the entire CubicSplineCurve motion path.
 void setSegments(CubicSplineSegment[] s)
          This method takes a list of spline segments to replace the existing set of CubicSplineSegments that comprise the current CubicSplineCurve motion path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

totalCurveLength

private float totalCurveLength

cubicSplineSegment

private CubicSplineSegment[] cubicSplineSegment

numSegments

public int numSegments
Constructor Detail

CubicSplineCurve

CubicSplineCurve()
Default constructor


CubicSplineCurve

CubicSplineCurve(TCBKeyFrame[] keys)
This method takes a list of key frames and creates spline segments from it. It requires at least four key frames to be passed to it. Given n key frames, it creates n-3 CubicSplineSegments.

Parameters:
keys - the list of key frames that specify the motion path

CubicSplineCurve

CubicSplineCurve(CubicSplineSegment[] s)
This method takes a list of spline segments creates the CubicSplineCurve.

Parameters:
the - list of segments that comprise the complete motion path
Method Detail

setSegments

public void setSegments(CubicSplineSegment[] s)
This method takes a list of spline segments to replace the existing set of CubicSplineSegments that comprise the current CubicSplineCurve motion path.

Parameters:
s - the list of segments that comprise the complete motion path

getSegment

public CubicSplineSegment getSegment(int index)
This method returns the CubicSplineSegments pointed to by index

Parameters:
index - the index of the CubicSplineSegment required
Returns:
index the CubicSplineSegment pointed to by index

computeTotalCurveLength

private void computeTotalCurveLength()

getTotalCurveLength

public float getTotalCurveLength()
This method returns the total length of the entire CubicSplineCurve motion path.

Returns:
the length of the CubicSplineCurve motion path


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.