Class Overview
Builder that allows creation of a mesh object point by point
and triangle by triangle
Summary
Public Methods |
Mesh.TriangleMeshBuilder
|
addTriangle(int idx1, int idx2, int idx3)
Adds a new triangle to the mesh builder
|
Mesh.TriangleMeshBuilder
|
addVertex(float x, float y, float z)
Adds a float3 vertex to the mesh
|
Mesh.TriangleMeshBuilder
|
addVertex(float x, float y)
Adds a float2 vertex to the mesh
|
Mesh
|
create(boolean uploadToBufferObject)
Creates the mesh object from the current state of the builder
|
Mesh.TriangleMeshBuilder
|
setColor(float r, float g, float b, float a)
Sets the color for the last added vertex
|
Mesh.TriangleMeshBuilder
|
setNormal(float x, float y, float z)
Sets the normal vector for the last added vertex
|
Mesh.TriangleMeshBuilder
|
setTexture(float s, float t)
Sets the texture coordinate for the last added vertex
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Called before the object's memory is reclaimed by the VM.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Constants
public
static
final
int
COLOR
Constant Value:
1
(0x00000001)
public
static
final
int
NORMAL
Constant Value:
2
(0x00000002)
public
static
final
int
TEXTURE_0
Constant Value:
256
(0x00000100)
Public Constructors
public
Mesh.TriangleMeshBuilder
(RenderScript rs, int vtxSize, int flags)
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)
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 |
Adds a float3 vertex to the mesh
Parameters
x
| position x |
y
| position y |
z
| position z |
Adds a float2 vertex to the mesh
Parameters
x
| position x |
y
| position y |
public
Mesh
create
(boolean uploadToBufferObject)
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)
Sets the color for the last added vertex
Parameters
r
| red component |
g
| green component |
b
| blue component |
a
| alpha component |
Sets the normal vector for the last added vertex
Parameters
x
| normal vector x |
y
| normal vector y |
z
| normal vector z |
Sets the texture coordinate for the last added vertex
Parameters
s
| texture coordinate s |
t
| texture coordinate t |