| java.lang.Object com.sun.j3d.loaders.lw3d.TextfileParser com.sun.j3d.loaders.lw3d.LwsMotion
LwsMotion | class LwsMotion extends TextfileParser (Code) | | 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.
|
Inner Class :class FrameHolder | |
firstFrame | int firstFrame(Code) | | |
numChannels | int numChannels(Code) | | |
totalFrames | int totalFrames(Code) | | |
totalTime | float totalTime(Code) | | |
createJava3dBehaviors | void createJava3dBehaviors(TransformGroup target)(Code) | | Create j3d behaviors for the data stored in this animation. This is
done by creating a RotPosScalePathInterpolator object that contains
all of the position, orientation, scale data for each keyframe.
|
createJava3dBehaviorsForFramesSubset | void createJava3dBehaviorsForFramesSubset(TransformGroup target)(Code) | | Normally, we just create j3d behaviors from the frames. But if the
animation's first frame is after frame number one, then we have to
shuffle things around to account for playing/looping on this subset
of the total frames of the animation
|
fixFrames | void fixFrames()(Code) | | The previous version of this method looked for sucessive frames with
the same rotation value (mod 2PI). If it found such frames, it would
divide that interval into 4 separate frames.
This fix is not sufficient for various rotation cases, though. For
instance, if the rotation difference between two frames is more than
2PI, the rotation will not case a flag to be fixed and the resulting
rotation will only be between the delta of the two rotations, mod 2PI.
The real fix should behave as follows:
- Iterate through all sucessive frames
- For any two frames that have rotation components that differ by more
than PI/2 (one quarter rotation - no reason for this, but let's pick a
small value to give our resulting path interpolations a better chance
of behaving correctly), figure out how many frames we need to create to
get increments of <= PI/2 between each frame.
- Create these new frames
- Set the odl frames pointer to the new frames structures.
|
getBehaviors | Behavior getBehaviors()(Code) | | Returns the Behavior object created for this animation
|
getFirstFrame | LwsFrame getFirstFrame()(Code) | | Returns the first LwsFrame object (which contains the initial
setup for a given object)
|
intMod | int intMod(int divisee, int divisor)(Code) | | Utility for getting integer mod value
|
playWithFrameTimes | void playWithFrameTimes(Vector framesVector)(Code) | | This method was added to account for animations that start after
the first frame (e.g., Juggler.lws starts at frame 30). We need
to alter some of the information for the frames in this "frame subset"
|
printVals | void printVals()(Code) | | Utility function for printing values
|
Methods inherited from com.sun.j3d.loaders.lw3d.TextfileParser | void checkString(StreamTokenizer st, String theString) throws ParsingErrorException(Code)(Java Doc) void checkType(StreamTokenizer st, int theType) throws ParsingErrorException(Code)(Java Doc) protected void debugOutput(int outputType, String theOutput)(Code)(Java Doc) protected void debugOutputLn(int outputType, String theOutput)(Code)(Java Doc) void getAndCheckString(StreamTokenizer st, String expectedValue) throws ParsingErrorException(Code)(Java Doc) String getName(StreamTokenizer st) throws ParsingErrorException(Code)(Java Doc) double getNumber(StreamTokenizer st) throws ParsingErrorException, NumberFormatException(Code)(Java Doc) String getString(StreamTokenizer st) throws ParsingErrorException(Code)(Java Doc) boolean isCurrentToken(StreamTokenizer st, String tokenString)(Code)(Java Doc) void skip(StreamTokenizer st, String tokenString, int skipVals) throws ParsingErrorException(Code)(Java Doc) void skipUntilString(StreamTokenizer st, String theString) throws ParsingErrorException(Code)(Java Doc)
|
|
|