com.badlogic.gdx.graphics.g3d
Class Renderable

java.lang.Object
  extended by com.badlogic.gdx.graphics.g3d.Renderable

public class Renderable
extends Object

A renderable defines a world transform, the 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.

Author:
badlogic, xoppa

Field Summary
 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.
 Object userData
          user definable value.
 Matrix4 worldTransform
          the model transform
 
Constructor Summary
Renderable()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

worldTransform

public final Matrix4 worldTransform
the model transform


mesh

public Mesh mesh
the Mesh to render


meshPartOffset

public int meshPartOffset
the offset into the mesh's indices


meshPartSize

public int meshPartSize
the number of indices/vertices to use


primitiveType

public int primitiveType
the primitive type, encoded as an OpenGL constant, like GL20.GL_TRIANGLES


material

public Material material
the Material to be applied to the mesh


bones

public Matrix4[] bones
the bones transformations used for skinning, or null if not applicable


environment

public Environment environment
the Environment to be used to render this Renderable, may be null


shader

public Shader shader
the 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.


userData

public Object userData
user definable value.

Constructor Detail

Renderable

public Renderable()


Copyright © 2013. All Rights Reserved.