public class Renderable
extends java.lang.Object
Mesh
to render
along with the offset into the mesh's indices and the number of indices to use plus the
primitive type to render the part of the mesh with. Finally, a renderable defines
a Material
to be applied to the mesh.
Renderables can be rendered via a ModelBatch
, either directly, or by passing a
RenderableProvider
like ModelInstance
to the RenderBatch.
A ModelInstance returns all Renderables via its ModelInstance.getRenderables(Array, Pool)
method.
When using a ModelBatch to render a renderable, The renderable and all its values must not be changed
in between the call to ModelBatch.begin(com.badlogic.gdx.graphics.Camera)
and ModelBatch.end()
.
When the shader
member of the Renderable is set, the ShaderProvider
of the ModelBatch
may try to use that shader instead of the default shader. Therefor, to assure the default shader is used, the
shader
member must be set to null.Modifier and Type | Field and Description |
---|---|
Matrix4[] |
bones
the bones transformations used for skinning, or null if not applicable
|
Environment |
environment
the
Environment to be used to render this Renderable, may be null |
Material |
material
the
Material to be applied to the mesh |
Mesh |
mesh
the
Mesh to render |
int |
meshPartOffset
the offset into the mesh's indices
|
int |
meshPartSize
the number of indices/vertices to use
|
int |
primitiveType
the primitive type, encoded as an OpenGL constant, like
GL20.GL_TRIANGLES |
Shader |
shader
the
Shader to be used to render this Renderable, may be null. |
java.lang.Object |
userData
user definable value.
|
Matrix4 |
worldTransform
the model transform
|
Constructor and Description |
---|
Renderable() |
public final Matrix4 worldTransform
public int meshPartOffset
public int meshPartSize
public int primitiveType
GL20.GL_TRIANGLES
public Matrix4[] bones
public Environment environment
Environment
to be used to render this Renderable, may be nullpublic Shader shader
Shader
to be used to render this Renderable, may be null.
It is not guaranteed that the shader will be used, the used ShaderProvider
is responsible
for actually choosing the correct shader to use.public java.lang.Object userData