|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.geometry.model.md3.Md3Model
Md3Model
handles loading and rendering a Quake 3 MD3 format
model. Animation is fully supported, where setTorsoAnimation
and setLegsAnimation
determine the animation used for the
two major parts of the model. These animations are defined as:
BOTH_DEATH1
BOTH_DEAD1
BOTH_DEATH2
BOTH_DEAD2
BOTH_DEATH3
BOTH_DEAD3
TORSO_GESTURE
TORSO_ATTACK
TORSO_ATTACK2
TORSO_DROP
TORSO_RAISE
TORSO_STAND
TORSO_STAND2
LEGS_WALKCR
LEGS_WALK
LEGS_RUN
LEGS_BACK
LEGS_SWIM
LEGS_JUMP
LEGS_LAND
LEGS_JUMPB
LEGS_LANDB
LEGS_IDLECR
LEGS_IDLE
LEGS_TURN
Field Summary | |
static int |
HEAD
HEAD defines the head section of the model. |
static int |
LOWER
LOWER defines the legs section of the model. |
static int |
UPPER
UPPER defines the torso section of the model. |
static int |
WEAPON
WEAPON defines the weapon of the model. |
Constructor Summary | |
Md3Model(java.lang.String path,
java.lang.String model,
java.lang.String weapon)
Constructor instantiates a new Md3Model object. |
Method Summary | |
jme.geometry.model.md3.Md3Model.Model3D |
getModel(int part)
getModel returns a Model3D object of the
specified model part. |
Vector[] |
getPoints()
getPoints returns all the points of the MD3 model. |
void |
initialize()
initialize loads the model and weapon then sets up the
bounding volumes for the model. |
boolean |
loadModel()
loadModel loads the currently defined model file and
sets the appropriate data structures for rendering and animating. |
boolean |
loadWeapon()
loadWeapon loads the currently defined weapon file and
sets the appropriate data structures for rendering and animating. |
void |
render()
render handles rendering the model to the screen. |
void |
setColor(float r,
float g,
float b,
float a)
setColor sets the overall shade of the model. |
void |
setLegsAnimation(java.lang.String animationName)
setLegsAnimation sets the current animation of the
lower model. |
void |
setModelString(java.lang.String model)
setModelString sets the new model to be used. |
void |
setPath(java.lang.String path)
setPath sets the path to the model. |
void |
setScale(Vector scale)
setScale sets the scale factor for the model. |
void |
setTexture(java.lang.String texture)
setTexture is not used as the MD3 Model's texture is
defined in the skin data of the model. |
void |
setTorsoAnimation(java.lang.String animationName)
setTorsoAnimation sets the current animation of the
upper model. |
void |
setWeaponString(java.lang.String weapon)
setWeaponString sets the new model to be used for the weapon. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LOWER
public static final int UPPER
public static final int HEAD
public static final int WEAPON
Constructor Detail |
public Md3Model(java.lang.String path, java.lang.String model, java.lang.String weapon)
Md3Model
object. During
creation, the model is loaded and initialized.
path
- the path to the base level of the model directory.model
- the model file.weapon
- the current weapon file. May be null.
MonkeyGLException
- if the OpenGL context has not been created.
MonkeyRuntimeException
- if path or model is null.Method Detail |
public void setModelString(java.lang.String model)
setModelString
sets the new model to be used. This should
be followed by a call to loadModel
to complete the change
of the model data.
model
- the new model to use.public void setWeaponString(java.lang.String weapon)
setWeaponString
sets the new model to be used for the weapon.
This should be followed by a call to loadWeapon
to complete
te change of the model data.
weapon
- the new weapon model to use.public void setPath(java.lang.String path)
setPath
sets the path to the model.
path
- the new path to the models.public jme.geometry.model.md3.Md3Model.Model3D getModel(int part)
getModel
returns a Model3D
object of the
specified model part. Either LOWER, UPPER, HEAD or WEAPON.
part
- the part requested.
public void initialize()
initialize
loads the model and weapon then sets up the
bounding volumes for the model.
initialize
in interface Geometry
public void render()
render
handles rendering the model to the screen. This
occurs recursively starting with the legs, then torso and lastly
the head. Due to the make up of the MD3 vertices, culling is turned to
front.
render
in interface Geometry
public void setTorsoAnimation(java.lang.String animationName)
setTorsoAnimation
sets the current animation of the
upper model. The string that denotes the animation is defined and
denoted at the top of this javadoc.
animationName
- the animation to set for the torso.public void setLegsAnimation(java.lang.String animationName)
setLegsAnimation
sets the current animation of the
lower model. The string that denotes the animation is defined and
denoted at the top of this javadoc.
animationName
- the animation to set for the legs.public void setTexture(java.lang.String texture)
setTexture
is not used as the MD3 Model's texture is
defined in the skin data of the model. It is here to provide
continuity with the Geometry
interface.
setTexture
in interface Geometry
texture
- not used.public void setColor(float r, float g, float b, float a)
setColor
sets the overall shade of the model.
setColor
in interface Geometry
r
- the red component of the color.g
- the green component of the color.b
- the blue component of the color.a
- the alpha component of the color.public void setScale(Vector scale)
setScale
sets the scale factor for the model.
scale
- the scale of the model.public Vector[] getPoints()
getPoints
returns all the points of the MD3 model.
getPoints
in interface Geometry
public boolean loadModel()
loadModel
loads the currently defined model file and
sets the appropriate data structures for rendering and animating.
public boolean loadWeapon()
loadWeapon
loads the currently defined weapon file and
sets the appropriate data structures for rendering and animating.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |