public static class

Mesh.Builder

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

Class Overview

Mesh builder object. It starts empty and requires you to add the types necessary to create vertex and index allocations.

Summary

Public Constructors
Mesh.Builder(RenderScript rs, int usage)
Creates builder object
Public Methods
Mesh.Builder addIndexSetType(Mesh.Primitive p)
Adds an index set primitive type to the builder object
Mesh.Builder addIndexSetType(Element e, int size, Mesh.Primitive p)
Adds an index set data type to the builder object
Mesh.Builder addIndexSetType(Type t, Mesh.Primitive p)
Adds an index set data type to the builder object
Mesh.Builder addVertexType(Element e, int size)
Adds a vertex data type to the builder object
Mesh.Builder addVertexType(Type t)
Adds a vertex data type to the builder object
Mesh create()
Create a Mesh object from the current state of the builder
int getCurrentIndexSetIndex()
int getCurrentVertexTypeIndex()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Mesh.Builder (RenderScript rs, int usage)

Since: API Level 11

Creates builder object

Parameters
rs Context to which the mesh will belong.
usage specifies how the mesh allocations are to be handled, whether they need to be uploaded to a buffer on the gpu, maintain a cpu copy, etc

Public Methods

public Mesh.Builder addIndexSetType (Mesh.Primitive p)

Since: API Level 11

Adds an index set primitive type to the builder object

Parameters
p primitive type
Returns
  • this

public Mesh.Builder addIndexSetType (Element e, int size, Mesh.Primitive p)

Since: API Level 11

Adds an index set data type to the builder object

Parameters
e element describing the index set data layout
size number of elements in the buffer
p primitive type
Returns
  • this

public Mesh.Builder addIndexSetType (Type t, Mesh.Primitive p)

Since: API Level 11

Adds an index set data type to the builder object

Parameters
t type of the index set data, could be null
p primitive type
Returns
  • this

public Mesh.Builder addVertexType (Element e, int size)

Since: API Level 11

Adds a vertex data type to the builder object

Parameters
e element describing the vertex data layout
size number of elements in the buffer
Returns
  • this

public Mesh.Builder addVertexType (Type t)

Since: API Level 11

Adds a vertex data type to the builder object

Parameters
t type of the vertex data allocation to be created
Returns
  • this

public Mesh create ()

Since: API Level 11

Create a Mesh object from the current state of the builder

public int getCurrentIndexSetIndex ()

Since: API Level 11

Returns
  • internal index of the last index set added to the builder

public int getCurrentVertexTypeIndex ()

Since: API Level 11

Returns
  • internal index of the last vertex buffer type added to builder