public class

Mesh

extends BaseObj
java.lang.Object
   ↳ android.renderscript.BaseObj
     ↳ android.renderscript.Mesh

Class Overview

This class is a container for geometric data displayed with Renderscript. Internally, a mesh is a collection of allocations that represent vertex data (positions, normals, texture coordinates) and index data such as triangles and lines.

Vertex data could either be interleaved within one allocation that is provided separately, as multiple allocation objects, or done as a combination of both. When a vertex channel name matches an input in the vertex program, Renderscript automatically connects the two together.

Parts of the mesh can be rendered with either explicit index sets or primitive types.

Summary

Nested Classes
class Mesh.AllocationBuilder Mesh builder object. 
class Mesh.Builder Mesh builder object. 
enum Mesh.Primitive Describes the way mesh vertex data is interpreted when rendering  
class Mesh.TriangleMeshBuilder Builder that allows creation of a mesh object point by point and triangle by triangle  
Public Methods
Allocation getIndexSetAllocation(int slot)
Mesh.Primitive getPrimitive(int slot)
int getPrimitiveCount()
Allocation getVertexAllocation(int slot)
int getVertexAllocationCount()
[Expand]
Inherited Methods
From class android.renderscript.BaseObj
From class java.lang.Object

Public Methods

public Allocation getIndexSetAllocation (int slot)

Since: API Level 11

Parameters
slot locaton within the list of index set allocation
Returns
  • allocation containing primtive index data or null if the index data is not specified explicitly

public Mesh.Primitive getPrimitive (int slot)

Since: API Level 11

Parameters
slot locaiton within the list of index set primitives
Returns
  • index set primitive type

public int getPrimitiveCount ()

Since: API Level 11

Returns
  • number of primitives or index sets in the mesh

public Allocation getVertexAllocation (int slot)

Since: API Level 11

Parameters
slot index in the list of allocations to return
Returns
  • vertex data allocation at the given index

public int getVertexAllocationCount ()

Since: API Level 11

Returns
  • number of allocations containing vertex data