to top
Android APIs
Added in API level 11
Deprecated since API level 16
public static class

Mesh.TriangleMeshBuilder

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

This class was deprecated in API level 16.
in API 16 Builder that allows creation of a mesh object point by point and triangle by triangle

Summary

Constants
int COLOR This constant was deprecated in API level 16. in API 16
int NORMAL This constant was deprecated in API level 16. in API 16
int TEXTURE_0 This constant was deprecated in API level 16. in API 16
Public Constructors
Mesh.TriangleMeshBuilder(RenderScript rs, int vtxSize, int flags)
This constructor was deprecated in API level 16. in API 16
Public Methods
Mesh.TriangleMeshBuilder addTriangle(int idx1, int idx2, int idx3)
This method was deprecated in API level 16. in API 16 Adds a new triangle to the mesh builder
Mesh.TriangleMeshBuilder addVertex(float x, float y, float z)
This method was deprecated in API level 16. in API 16 Adds a float3 vertex to the mesh
Mesh.TriangleMeshBuilder addVertex(float x, float y)
This method was deprecated in API level 16. in API 16 Adds a float2 vertex to the mesh
Mesh create(boolean uploadToBufferObject)
This method was deprecated in API level 16. in API 16 Creates the mesh object from the current state of the builder
Mesh.TriangleMeshBuilder setColor(float r, float g, float b, float a)
This method was deprecated in API level 16. in API 16 Sets the color for the vertices that are added after this method call.
Mesh.TriangleMeshBuilder setNormal(float x, float y, float z)
This method was deprecated in API level 16. in API 16 Sets the normal vector for the vertices that are added after this method call.
Mesh.TriangleMeshBuilder setTexture(float s, float t)
This method was deprecated in API level 16. in API 16 Sets the texture coordinate for the vertices that are added after this method call.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int COLOR

Added in API level 11

This constant was deprecated in API level 16.
in API 16

Constant Value: 1 (0x00000001)

public static final int NORMAL

Added in API level 11

This constant was deprecated in API level 16.
in API 16

Constant Value: 2 (0x00000002)

public static final int TEXTURE_0

Added in API level 11

This constant was deprecated in API level 16.
in API 16

Constant Value: 256 (0x00000100)

Public Constructors

public Mesh.TriangleMeshBuilder (RenderScript rs, int vtxSize, int flags)

Added in API level 11

This constructor was deprecated in API level 16.
in API 16

Parameters
rs Context to which the mesh will belong.
vtxSize specifies whether the vertex is a float2 or float3
flags bitfield that is a combination of COLOR, NORMAL, and TEXTURE_0 that specifies what vertex data channels are present in the mesh

Public Methods

public Mesh.TriangleMeshBuilder addTriangle (int idx1, int idx2, int idx3)

Added in API level 11

This method was deprecated in API level 16.
in API 16 Adds a new triangle to the mesh builder

Parameters
idx1 index of the first vertex in the triangle
idx2 index of the second vertex in the triangle
idx3 index of the third vertex in the triangle
Returns
  • this

public Mesh.TriangleMeshBuilder addVertex (float x, float y, float z)

Added in API level 11

This method was deprecated in API level 16.
in API 16 Adds a float3 vertex to the mesh

Parameters
x position x
y position y
z position z
Returns
  • this

public Mesh.TriangleMeshBuilder addVertex (float x, float y)

Added in API level 11

This method was deprecated in API level 16.
in API 16 Adds a float2 vertex to the mesh

Parameters
x position x
y position y
Returns
  • this

public Mesh create (boolean uploadToBufferObject)

Added in API level 11

This method was deprecated in API level 16.
in API 16 Creates the mesh object from the current state of the builder

Parameters
uploadToBufferObject specifies whether the vertex data is to be uploaded into the buffer object indicating that it's likely not going to be modified and rendered many times. Alternatively, it indicates the mesh data will be updated frequently and remain in script accessible memory

public Mesh.TriangleMeshBuilder setColor (float r, float g, float b, float a)

Added in API level 11

This method was deprecated in API level 16.
in API 16 Sets the color for the vertices that are added after this method call.

Parameters
r red component
g green component
b blue component
a alpha component
Returns
  • this

public Mesh.TriangleMeshBuilder setNormal (float x, float y, float z)

Added in API level 11

This method was deprecated in API level 16.
in API 16 Sets the normal vector for the vertices that are added after this method call.

Parameters
x normal vector x
y normal vector y
z normal vector z
Returns
  • this

public Mesh.TriangleMeshBuilder setTexture (float s, float t)

Added in API level 11

This method was deprecated in API level 16.
in API 16 Sets the texture coordinate for the vertices that are added after this method call.

Parameters
s texture coordinate s
t texture coordinate t
Returns
  • this