Java Doc for LwsMotion.java in  » 6.0-JDK-Modules » java-3d » com » sun » j3d » loaders » lw3d » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » com.sun.j3d.loaders.lw3d 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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

Field Summary
 Behaviorbehaviors
    
 intfirstFrame
    
 LwsFrameframes
    
 booleanloop
    
 StringmotionName
    
 intnumChannels
    
 intnumFrames
    
 inttotalFrames
    
 floattotalTime
    

Constructor Summary
 LwsMotion(StreamTokenizer st, int frames, float time)
    
 LwsMotion(StreamTokenizer st, int firstFrame, int frames, float time, int debugVals)
    

Method Summary
 voidcreateJava3dBehaviors(TransformGroup target)
     Create j3d behaviors for the data stored in this animation.
 voidcreateJava3dBehaviorsForFramesSubset(TransformGroup target)
     Normally, we just create j3d behaviors from the frames.
 voidfixFrames()
     The previous version of this method looked for sucessive frames with the same rotation value (mod 2PI).
 BehaviorgetBehaviors()
    
 LwsFramegetFirstFrame()
    
 voidgetMotion(StreamTokenizer st)
     This method parses the tokenizer and creates the data structures that hold the data from that file.
 intintMod(int divisee, int divisor)
    
 voidplayWithFrameTimes(Vector framesVector)
     This method was added to account for animations that start after the first frame (e.g., Juggler.lws starts at frame 30).
 voidprintVals()
    

Field Detail
behaviors
Behavior behaviors(Code)



firstFrame
int firstFrame(Code)



frames
LwsFrame frames(Code)



loop
boolean loop(Code)



motionName
String motionName(Code)



numChannels
int numChannels(Code)



numFrames
int numFrames(Code)



totalFrames
int totalFrames(Code)



totalTime
float totalTime(Code)




Constructor Detail
LwsMotion
LwsMotion(StreamTokenizer st, int frames, float time)(Code)
Constructor



LwsMotion
LwsMotion(StreamTokenizer st, int firstFrame, int frames, float time, int debugVals) throws ParsingErrorException, IncorrectFormatException(Code)
Constructor: takes tokenizer, 1st frame of this animation, total number of frames, total time of animation, and the debug settings




Method Detail
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)



getMotion
void getMotion(StreamTokenizer st) throws ParsingErrorException, IncorrectFormatException(Code)
This method parses the tokenizer and creates the data structures that hold the data from that file. For each separate keyframe, this method calls LwsFrame to parse and interpret that data.



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



Fields inherited from com.sun.j3d.loaders.lw3d.TextfileParser
final static int MISCLINE_TRACE(Code)(Java Doc)
final static int NONEEXCEPTION(Code)(Java Doc)
static int NUMBER(Code)(Java Doc)
final static int TIME(Code)(Java Doc)
final static int TRACEVALUES(Code)(Java Doc)
static int WORD(Code)(Java Doc)
int currentLevel(Code)(Java Doc)
protected DebugOutput debugPrinter(Code)(Java Doc)
char lineSeparatorChar(Code)(Java Doc)

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)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.