|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.loaders.lw3d.TextfileParser
com.sun.j3d.loaders.lw3d.LwsMotion
class LwsMotion
This class is responsible for parsing the data in a Scene file related to an object's animation and constructing the appropriate Java3D Behavior objects. For each keyframe defined for the animation in the Lightwave file, this class creates a LwsFrame object to parse that keyframe data and create the appropriate data structures. Then for each of those LwsFrame objects created, LwsMotion creates a knot value for a PathInterpolator and fills in the appropriate field. Finally, the class creates a RotPosScalePathInterpolator with all of the data from the animation. There are also some utility functions in this class for dealing with special cases of animations, such as animations that begin after the first frame of the scene and animations that define frames in a way that Java3D cannot easily interpret.
Nested Class Summary | |
---|---|
(package private) class |
LwsMotion.FrameHolder
Class that associates a particular frame with its effective frame number (which accounts for animations that start after frame 1) |
Field Summary | |
---|---|
(package private) Behavior |
behaviors
|
(package private) int |
firstFrame
|
(package private) LwsFrame[] |
frames
|
(package private) boolean |
loop
|
(package private) java.lang.String |
motionName
|
(package private) int |
numChannels
|
(package private) int |
numFrames
|
(package private) int |
totalFrames
|
(package private) float |
totalTime
|
Fields inherited from class com.sun.j3d.loaders.lw3d.TextfileParser |
---|
currentLevel, debugPrinter, EXCEPTION, LINE_TRACE, lineSeparatorChar, MISC, NONE, NUMBER, TIME, TRACE, VALUES, WORD |
Constructor Summary | |
---|---|
LwsMotion(java.io.StreamTokenizer st,
int frames,
float time)
Constructor |
|
LwsMotion(java.io.StreamTokenizer st,
int firstFrame,
int frames,
float time,
int debugVals)
Constructor: takes tokenizer, 1st frame of this animation, total number of frames, total time of animation, and the debug settings |
Method Summary | |
---|---|
(package private) void |
createJava3dBehaviors(TransformGroup target)
Create j3d behaviors for the data stored in this animation. |
(package private) void |
createJava3dBehaviorsForFramesSubset(TransformGroup target)
Normally, we just create j3d behaviors from the frames. |
(package private) void |
fixFrames()
The previous version of this method looked for sucessive frames with the same rotation value (mod 2PI). |
(package private) Behavior |
getBehaviors()
Returns the Behavior object created for this animation |
(package private) LwsFrame |
getFirstFrame()
Returns the first LwsFrame object (which contains the initial setup for a given object) |
(package private) void |
getMotion(java.io.StreamTokenizer st)
This method parses the tokenizer and creates the data structures that hold the data from that file. |
(package private) int |
intMod(int divisee,
int divisor)
Utility for getting integer mod value |
(package private) void |
playWithFrameTimes(java.util.Vector framesVector)
This method was added to account for animations that start after the first frame (e.g., Juggler.lws starts at frame 30). |
(package private) void |
printVals()
Utility function for printing values |
Methods inherited from class com.sun.j3d.loaders.lw3d.TextfileParser |
---|
checkString, checkType, debugOutput, debugOutputLn, getAndCheckString, getName, getNumber, getString, isCurrentToken, skip, skipUntilString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.lang.String motionName
LwsFrame[] frames
int numFrames
int numChannels
boolean loop
float totalTime
int firstFrame
int totalFrames
Behavior behaviors
Constructor Detail |
---|
LwsMotion(java.io.StreamTokenizer st, int frames, float time)
LwsMotion(java.io.StreamTokenizer st, int firstFrame, int frames, float time, int debugVals) throws ParsingErrorException, IncorrectFormatException
ParsingErrorException
IncorrectFormatException
Method Detail |
---|
void getMotion(java.io.StreamTokenizer st) throws ParsingErrorException, IncorrectFormatException
ParsingErrorException
IncorrectFormatException
void fixFrames()
int intMod(int divisee, int divisor)
void playWithFrameTimes(java.util.Vector framesVector)
void createJava3dBehaviorsForFramesSubset(TransformGroup target)
void createJava3dBehaviors(TransformGroup target)
Behavior getBehaviors()
LwsFrame getFirstFrame()
void printVals()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |