Material and transformation Matrix4
within the world. Use ModelBatch to render the `ShapeCache`. Must be disposed when no longer needed to release native
resources.
How to use it :
// Create cache ShapeCache cache = new ShapeCache(); // Build the cache, for dynamic shapes, this would be in the render method. MeshPartBuilder builder = cache.begin(); FrustumShapeBuilder.build(builder, camera); BoxShapeBuilder.build(builder, box); cache.end() // Render modelBatch.render(cache); // After using it cache.dispose();
| Modifier and Type | Field and Description |
|---|---|
| private final MeshBuilder | builder
Builder used to update the mesh |
| private boolean | |
| private final String | |
| private final Mesh | mesh
Mesh being rendered |
| private final Renderable |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ShapeCache(int
max vertices in mesh maxVertices, int max indices in mesh maxIndices, VertexAttributes vertex attributes attributes, int primitiveType)Create a ShapeCache with parameters |
| Modifier and Type | Method and Description |
|---|---|
| public MeshPartBuilder | |
| public MeshPartBuilder | |
| public void | dispose()
Implements com. Releases all resources of this object. |
| public void | |
| public Material | |
| public void | getRenderables(Array<Renderable> renderables, Pool<Renderable> pool)
Implements com. Returns |
| public Matrix4 |
| builder | back to summary |
|---|---|
| private final MeshBuilder builder Builder used to update the mesh | |
| building | back to summary |
|---|---|
| private boolean building | |
| id | back to summary |
|---|---|
| private final String id | |
| mesh | back to summary |
|---|---|
| private final Mesh mesh Mesh being rendered | |
| renderable | back to summary |
|---|---|
| private final Renderable renderable | |
| ShapeCache | back to summary |
|---|---|
| public ShapeCache() Create a ShapeCache with default values | |
| ShapeCache | back to summary |
|---|---|
| public ShapeCache(int maxVertices, int maxIndices, VertexAttributes attributes, int primitiveType) Create a ShapeCache with parameters
| |
| begin | back to summary |
|---|---|
| public MeshPartBuilder begin() Initialize ShapeCache for mesh generation with GL_LINES primitive type | |
| begin | back to summary |
|---|---|
| public MeshPartBuilder begin(int primitiveType) Initialize ShapeCache for mesh generation
| |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com. Doc from com. Releases all resources of this object.
| |
| end | back to summary |
|---|---|
| public void end() Generate mesh and renderable | |
| getMaterial | back to summary |
|---|---|
| public Material getMaterial() Allows to customize the material.
| |
| getRenderables | back to summary |
|---|---|
| public void getRenderables(Array<Renderable> renderables, Pool<Renderable> pool) Implements com. Doc from com. Returns
| |
| getWorldTransform | back to summary |
|---|---|
| public Matrix4 getWorldTransform() Allows to customize the world transform matrix.
| |