|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.graphics.g3d.model.skeleton.SkeletonModel
public class SkeletonModel
Field Summary | |
---|---|
protected SkeletonAnimation[] |
animations
|
Skeleton |
skeleton
|
SkeletonSubMesh[] |
subMeshes
|
Constructor Summary | |
---|---|
SkeletonModel(Skeleton skeleton,
SubMesh[] subMeshes)
|
Method Summary | |
---|---|
void |
dispose()
This function releases memory once you are done with the Model. |
SkeletonAnimation |
getAnimation(java.lang.String name)
Get a specific named animation out of the model. |
SkeletonAnimation[] |
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. |
SubMesh |
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 |
setBindPose()
|
void |
setMaterial(Material material)
Sets the Material of every SubMesh in this Model to be the material provided. |
void |
setMaterials(Material... materials)
Sets every Material of every SubMesh in this Model to be the materials provided. |
void |
skin(SkeletonSubMesh subMesh,
Array<Matrix4> boneMatrices)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final Skeleton skeleton
public final SkeletonSubMesh[] subMeshes
protected SkeletonAnimation[] animations
Constructor Detail |
---|
public SkeletonModel(Skeleton skeleton, SubMesh[] subMeshes)
Method Detail |
---|
public void setBindPose()
public void setAnimation(java.lang.String animation, float time, boolean loop)
AnimatedModel
setAnimation
in interface AnimatedModel
animation
- 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 void skin(SkeletonSubMesh subMesh, Array<Matrix4> boneMatrices)
public void render()
Model
GL10
pipeline.Model.setMaterials(Material...)
.
render
in interface Model
public void render(ShaderProgram program)
Model
GL20
shader pipeline.Model.setMaterials(Material...)
.
render
in interface Model
program
- The shader program that you will use to draw this object to the screen. It must be non-null.public void setMaterials(Material... materials)
Model
Material
of every SubMesh
in this Model
to be the materials provided.
setMaterials
in interface Model
materials
- 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)
Model
Material
of every SubMesh
in this Model to be the material provided.
setMaterial
in interface Model
material
- The Material that you wish the whole object to be rendered with.public SubMesh getSubMesh(java.lang.String name)
getSubMesh
in interface Model
name
- 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 Model
SubMesh
that makes up this model.public SkeletonAnimation getAnimation(java.lang.String name)
AnimatedModel
getAnimation
in interface AnimatedModel
name
- The name of the animation that you wish to get.
public SkeletonAnimation[] getAnimations()
AnimatedModel
getAnimations
in interface AnimatedModel
public Model getSubModel(java.lang.String... subMeshNames)
Model
Model
that is made up of the sub-meshes with the provided names.
getSubModel
in interface Model
subMeshNames
- 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)
Model
BoundingBox
to be one such enclosing box.
getBoundingBox
in interface Model
bbox
- The provided BoundingBox
will have its internal values correctly set. (To allow Java Object reuse)public void dispose()
Model
dispose
in interface Model
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |