|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.geometry.model.ms.MilkshapeModel
A MilkshapeModel represents a Milkshape 3D model. Currently, it can only load the exported ascii text version of an MD3D model. In the future, the binary version may be supported, but there really is no need for it because it does not matter how long it takes to load the animation. Loading should take place at game startup. If speed becomes extremely important in the future, the binary loader may be an option, or serialized models is another option. Unless someone contributes a binary loader or add the nehe lwjgl port of the binary loader that actually loads multiple texture correctly :) The model can also draw itself, fully textured, to OpenGL through lwjgl. Bone animation is also supported. EDIT: Mark Powell 9/5/03 - heavily updated class to make calls to exisiting jme math (Matrix, Vector, etc). Altered update to take a time interval to allow for frame rate independant animation. SPECIAL THANKS: Animation method was ported by naj from a MSVC++ Model Viewer tutorial written by Mete Ciragan (creator of Milkshape).
Constructor Summary | |
MilkshapeModel(java.lang.String filename)
|
|
MilkshapeModel(java.lang.String filename,
boolean animated)
|
Method Summary | |
Vector[] |
getPoints()
getPoints returns an array of Vectors that represents
each point that makes up the piece of geometry. |
void |
initialize()
Loads an ascii text model exported from MS3D. |
boolean |
isAnimated()
Determine is the model is going to run animations, if it has them. |
void |
render()
Draws the model to OpenGL via lwjgl. |
void |
setAnimated(boolean animated)
Set the new animation mode. |
void |
setColor(float r,
float g,
float b,
float a)
setColor sets the color of the geometry. |
void |
setTexture(java.lang.String texture)
setTexture sets the associated texture of this
geometry to the passed texture file. |
void |
update(float time)
Set the final matrix of all of the joints to be part way between the previous keyframe and the next keyframe, depending on how much time has passed since the last keyframe. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MilkshapeModel(java.lang.String filename)
public MilkshapeModel(java.lang.String filename, boolean animated)
Method Detail |
public void render()
render
in interface Geometry
public void update(float time)
update
in interface Model
public void initialize()
initialize
in interface Geometry
public void setColor(float r, float g, float b, float a)
Geometry
setColor
sets the color of the geometry. This uses a
RGBA color. Where alpha of 1 is opaque and 0 is clear.
setColor
in interface Geometry
r
- the red color of the geometry.g
- the green color of the geometry;b
- the green color of the geometry.a
- the transparency of the geometry.public void setTexture(java.lang.String texture)
Geometry
setTexture
sets the associated texture of this
geometry to the passed texture file.
setTexture
in interface Geometry
texture
- the image file to use as the texture for this
geometry object.public Vector[] getPoints()
Geometry
getPoints
returns an array of Vectors that represents
each point that makes up the piece of geometry.
getPoints
in interface Geometry
public boolean isAnimated()
public void setAnimated(boolean animated)
animated
- the new animation mode.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |