|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.util.interpolator.Interpolator org.j3d.util.interpolator.RotationInterpolator
public class RotationInterpolator
An interpolator that works with positional coordinates.
Two different interpolation schemes are provided - a simple linear system and quaternion based. The interpolator may take arbitrarily spaced keyframes and compute correct values.
The simple interpolation routine is just a linear interpolation between each component of each of the points.
For quaternion based interpolation, the code uses the algorithm presented by Graphics Gems III, Page 96.
Field Summary | |
---|---|
static int |
QUATERNION
Flag to nominate that the interpolation routine should be quaternions |
Fields inherited from class org.j3d.util.interpolator.Interpolator |
---|
allocatedSize, ARRAY_INCREMENT, currentSize, DEFAULT_SIZE, interpolationType, keys, LINEAR, STEP |
Constructor Summary | |
---|---|
RotationInterpolator()
Create a new linear interpolator instance with the default size for the number of key values. |
|
RotationInterpolator(int size)
Create an linear interpolator with the given basic size. |
|
RotationInterpolator(int size,
int type)
Create a interpolator with the given basic size using the interpolation type. |
Method Summary | |
---|---|
void |
addKeyFrame(float key,
float x,
float y,
float z,
float w)
Add a key frame set of values at the given key point. |
void |
addKeyFrame(float key,
javax.vecmath.Quat4f pt)
Add a key frame set of values at the given key point. |
float[] |
floatValue(float key)
Get the interpolated value of the point at the given key value. |
javax.vecmath.Quat4f |
pointValue(float key)
Get the interpolated value of the point at the given key value. |
java.lang.String |
toString()
Create a string representation of this interpolator's values |
Methods inherited from class org.j3d.util.interpolator.Interpolator |
---|
clear, findKeyIndex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int QUATERNION
Constructor Detail |
---|
public RotationInterpolator()
public RotationInterpolator(int size)
size
- The starting number of items in interpolatorpublic RotationInterpolator(int size, int type)
size
- The starting number of items in interpolatortype
- The type of interpolation scheme to useMethod Detail |
---|
public void addKeyFrame(float key, float x, float y, float z, float w)
key
- The value of the key to usex
- The x coordinate of the orientation at this keyy
- The y coordinate of the orientation at this keyz
- The z coordinate of the orientation at this keyw
- The w coordinate (angle) of the orientation at this keypublic void addKeyFrame(float key, javax.vecmath.Quat4f pt)
key
- The value of the key to usept
- The point data to take information frompublic javax.vecmath.Quat4f pointValue(float key)
key
- The key value to get the position for
public float[] floatValue(float key)
key
- The key value to get the position for
public java.lang.String toString()
toString
in class java.lang.Object
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |