m3g05.mesh
Class MeshUtils

java.lang.Object
  extended by m3g05.mesh.MeshUtils

public class MeshUtils
extends java.lang.Object

Utility methods for meshes.

Author:
Claus Hoefele

Field Summary
private static int[] lastTriIndices
          Holds the triangle indices of the mesh generated last.
private static int[] lastTriLengths
          Holds the strip lengths of the mesh generated last.
 
Constructor Summary
private MeshUtils()
          Constructor has private access because class contains static methods exclusively.
 
Method Summary
static void addRandomColors(javax.microedition.m3g.Mesh mesh)
          Assigns a random color to each vertex of a mesh.
static void copyTexCoords(javax.microedition.m3g.Mesh mesh, int src, int dest)
          Duplicates texture coordinates from one unit to another.
static int[] getLastTriangleIndices()
          Access to the triangle indices of the mesh generated last.
static int[] getLastTriangleLengths()
          Access to the strip lengths of the mesh generated last.
static void setLastTriangleIndices(int[] lastTriIndices)
          Sets the triangle indices of the mesh generated last.
static void setLastTriangleLengths(int[] lastTriLengths)
          Sets the strip lengths of the mesh generated last.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastTriIndices

private static int[] lastTriIndices
Holds the triangle indices of the mesh generated last.


lastTriLengths

private static int[] lastTriLengths
Holds the strip lengths of the mesh generated last.

Constructor Detail

MeshUtils

private MeshUtils()
Constructor has private access because class contains static methods exclusively.

Method Detail

getLastTriangleIndices

public static int[] getLastTriangleIndices()
Access to the triangle indices of the mesh generated last. WireframeSample needs this information, but M3G 1.0 doesn't yet allow to read this data from a VertexBuffer.

Returns:
triangle indices

setLastTriangleIndices

public static void setLastTriangleIndices(int[] lastTriIndices)
Sets the triangle indices of the mesh generated last. WireframeSample needs this information, but M3G 1.0 doesn't yet allow to read this data from a VertexBuffer.

Parameters:
lastTriIndices - triangle indices.

getLastTriangleLengths

public static int[] getLastTriangleLengths()
Access to the strip lengths of the mesh generated last. WireframeSample needs this information, but M3G 1.0 doesn't yet allow to read this data from a VertexBuffer.

Returns:
strip lengths.

setLastTriangleLengths

public static void setLastTriangleLengths(int[] lastTriLengths)
Sets the strip lengths of the mesh generated last. WireframeSample needs this information, but M3G 1.0 doesn't yet allow to read this data from a VertexBuffer.

Parameters:
lastTriLengths - strip lengths.

addRandomColors

public static void addRandomColors(javax.microedition.m3g.Mesh mesh)
Assigns a random color to each vertex of a mesh.

Parameters:
mesh - mesh to add color to.

copyTexCoords

public static void copyTexCoords(javax.microedition.m3g.Mesh mesh,
                                 int src,
                                 int dest)
Duplicates texture coordinates from one unit to another.

Parameters:
mesh - mesh with texture coordinates.
src - source texture unit.
dest - destination texture unit.