public class KeyframedModel extends java.lang.Object implements AnimatedModel, Disposable
| Modifier and Type | Field and Description |
|---|---|
protected KeyframedAnimation[] |
animations |
KeyframedSubMesh[] |
subMeshes |
| Constructor and Description |
|---|
KeyframedModel(KeyframedSubMesh[] subMeshes) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
This function releases memory once you are done with the Model.
|
KeyframedAnimation |
getAnimation(java.lang.String name)
Get a specific named animation out of the model.
|
KeyframedAnimation[] |
getAnimations()
Get an array containing all of the animations in this model.
|
void |
getBoundingBox(BoundingBox bbox)
Generates the bounding box for the Model.
For every finite 3D object there exists a box that can enclose the object. |
KeyframedSubMesh |
getSubMesh(java.lang.String name) |
SubMesh[] |
getSubMeshes() |
Model |
getSubModel(java.lang.String... subMeshNames)
Returns a
Model that is made up of the sub-meshes with the provided names. |
void |
render()
Renders the model using the
GL10 pipeline.Important: This model must have materials set before you can use this render function. |
void |
render(ShaderProgram program)
Renders this model using the
GL20 shader pipeline.IMPORTANT: This model must have materials set before you can use this render function. |
void |
setAnimation(java.lang.String animation,
float time,
boolean loop)
Start playing the given animation at the given time in the animation and specify wether or not the animation will loop.
|
void |
setMaterial(Material material)
|
void |
setMaterials(Material... materials)
|
public final KeyframedSubMesh[] subMeshes
protected final KeyframedAnimation[] animations
public KeyframedModel(KeyframedSubMesh[] subMeshes)
public void render()
ModelGL10 pipeline.Model.setMaterials(Material...).public void render(ShaderProgram program)
ModelGL20 shader pipeline.Model.setMaterials(Material...).public void setMaterials(Material... materials)
ModelsetMaterials in interface Modelmaterials - A list of the materials to set the submeshes to for this model. (The length of the list of materials must
be the same as the number of SubMeshes in this Model. Failure to do so will result in an
UnsupportedOperationException)public void setMaterial(Material material)
ModelsetMaterial in interface Modelmaterial - The Material that you wish the whole object to be rendered with.public KeyframedSubMesh getSubMesh(java.lang.String name)
getSubMesh in interface Modelname - The name of the SubMesh to be acquired.SubMesh that matches that name; or null, if one does not exist.public SubMesh[] getSubMeshes()
getSubMeshes in interface ModelSubMesh that makes up this model.public void setAnimation(java.lang.String animation,
float time,
boolean loop)
AnimatedModelsetAnimation in interface AnimatedModelanimation - The name of the animation in this Model that you should play.time - The time, in seconds, of the section to start the animation.loop - Whether or not the animation will loop if the time is after the end of the animation. (TODO what happens when
you reach the end of the animation and this is not set?)public KeyframedAnimation getAnimation(java.lang.String name)
AnimatedModelgetAnimation in interface AnimatedModelname - The name of the animation that you wish to get.public KeyframedAnimation[] getAnimations()
AnimatedModelgetAnimations in interface AnimatedModelpublic Model getSubModel(java.lang.String... subMeshNames)
ModelModel that is made up of the sub-meshes with the provided names.getSubModel in interface ModelsubMeshNames - A list of names of each SubMesh that is to be extracted from this model.Model that is only made up of the parts you requested.public void getBoundingBox(BoundingBox bbox)
ModelBoundingBox
to be one such enclosing box.getBoundingBox in interface Modelbbox - The provided BoundingBox will have its internal values correctly set. (To allow Java Object reuse)public void dispose()
Modeldispose in interface Modeldispose in interface Disposable