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

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

public class KBCubicSplineCurve
extends java.lang.Object

KBCubicSplineCurve is a container class that holds a number of KBCubicSplineSegments

Since:
Java3D 1.2

Field Summary
private  KBCubicSplineSegment[] cubicSplineSegment
           
 int numSegments
           
private  float totalCurveLength
           
 
Constructor Summary
KBCubicSplineCurve()
           
KBCubicSplineCurve(KBCubicSplineSegment[] s)
          This method takes a list of spline segments creates the KBCubicSplineCurve.
KBCubicSplineCurve(KBKeyFrame[] keys)
          This method takes a list of key frames and creates spline segments from it.
 
Method Summary
private  void computeTotalCurveLength()
           
 KBCubicSplineSegment getSegment(int index)
          This method returns the KBCubicSplineSegments pointed to by index
 float getTotalCurveLength()
          This method returns the total length of the entire KBCubicSplineCurve motion path.
 void setSegments(KBCubicSplineSegment[] s)
          This method takes a list of spline segments to replace the existing set of KBCubicSplineSegments that comprise the current KBCubicSplineCurve 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 KBCubicSplineSegment[] cubicSplineSegment

numSegments

public int numSegments
Constructor Detail

KBCubicSplineCurve

KBCubicSplineCurve()

KBCubicSplineCurve

KBCubicSplineCurve(KBKeyFrame[] 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 KBCubicSplineSegments.

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

KBCubicSplineCurve

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

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

setSegments

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

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

getSegment

public KBCubicSplineSegment getSegment(int index)
This method returns the KBCubicSplineSegments pointed to by index

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

computeTotalCurveLength

private void computeTotalCurveLength()

getTotalCurveLength

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

Returns:
the length of the KBCubicSplineCurve motion path


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