jarp
Class Mesh

java.lang.Object
  extended by jarp.Mesh

public class Mesh
extends java.lang.Object

The surface mesh for a Java ARP avatar.


Field Summary
static int TRM_FACEPICKING
           
static int TRM_FLAT
           
static int TRM_MAP2D3D
           
static int TRM_POINTMESH
           
static int TRM_SKELETON
           
static int TRM_SMOOTH
           
static int TRM_TEXTURED
           
static int TRM_WEIGHTMAPPING
           
static int TRM_WIRE
           
 
Constructor Summary
Mesh()
          Mesh default constructor -- set everything to null/zero.
Mesh(JAInputStream jins, JAOptions jopts, int ver3dig)
          Constructs this Mesh with data from the given stream.
 
Method Summary
 void addToVerticesVector(int v3, float[] adjxyz)
          Adds the three given xyz values, to this mesh's vertices vector at positions v3, v3+1, v3+2.
 void addToVerticesVectorScaled(int v3, float[] adjxyz, float scale)
          Adds the three given xyz values, with the given scaling, to this mesh's vertices vector at positions v3, v3+1, v3+2.
 void copyDuplicateVerticesAndNormals()
          Copy the data for each duplicate vertex/normal pair.
 void draw(javax.media.opengl.GL2 gl, float[] MAT_DA, int texID)
          Sets up and performs the OpenGL drawElements() for this mesh.
 void drawNormalsColour(javax.media.opengl.GL2 gl)
          (used for bill-board avatar loading).
 void fixBoneReferences(Skeleton skeleton)
          Fix up the influencing-bone references for each of this mesh's vertices -- that is, convert each bone-id read from the definition file into (a link to) the actual bone with that id.
 float getLODRange()
          Returns the LOD range for this mesh.
 MorphHandler getMorphHandler()
          Returns this mesh's morph-handler.
 float[] getNormals()
          Returns the normals array for this mesh.
 MeshVertex[] getPoints()
          Returns the points array for this mesh.
 void getVertex(int v3, float[] vtx)
          Returns the coordinates of the vertex at position v3 in the given array vtx.
 float[] getVertices()
          Returns the vertices array for this mesh.
 void save(JAOutputStream jouts, boolean dupsv22)
          Writes this Mesh to the given stream, using ints rather than unsigned shorts if the dupsv22 flag is set.
 void setNormalsVector(int n3, float nvx, float nvy, float nvz)
          Copies the given vector component values to this mesh's normals vector at positions n3, n3+1, n3+2.
 void setNormalsVector(int n3, Vector3f nvec)
          Copies the three components of the given vector v to this mesh's normals vector at positions n3, n3+1, n3+2.
 void setVerticesVector(int v3, Vector3f vvec)
          Copies the three components of the given vector v to this mesh's vertices vector at positions v3, v3+1, v3+2.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRM_SMOOTH

public static int TRM_SMOOTH

TRM_TEXTURED

public static int TRM_TEXTURED

TRM_WIRE

public static int TRM_WIRE

TRM_POINTMESH

public static int TRM_POINTMESH

TRM_FLAT

public static int TRM_FLAT

TRM_SKELETON

public static int TRM_SKELETON

TRM_FACEPICKING

public static int TRM_FACEPICKING

TRM_MAP2D3D

public static int TRM_MAP2D3D

TRM_WEIGHTMAPPING

public static int TRM_WEIGHTMAPPING
Constructor Detail

Mesh

public Mesh()
Mesh default constructor -- set everything to null/zero.


Mesh

public Mesh(JAInputStream jins,
            JAOptions jopts,
            int ver3dig)
     throws java.io.IOException
Constructs this Mesh with data from the given stream.

Throws:
java.io.IOException
Method Detail

fixBoneReferences

public void fixBoneReferences(Skeleton skeleton)
Fix up the influencing-bone references for each of this mesh's vertices -- that is, convert each bone-id read from the definition file into (a link to) the actual bone with that id.


getLODRange

public float getLODRange()
Returns the LOD range for this mesh.


getPoints

public MeshVertex[] getPoints()
Returns the points array for this mesh.


getVertices

public float[] getVertices()
Returns the vertices array for this mesh.


getNormals

public float[] getNormals()
Returns the normals array for this mesh.


getVertex

public void getVertex(int v3,
                      float[] vtx)
Returns the coordinates of the vertex at position v3 in the given array vtx. [#UNUSED#]


getMorphHandler

public MorphHandler getMorphHandler()
Returns this mesh's morph-handler.


setNormalsVector

public void setNormalsVector(int n3,
                             Vector3f nvec)
Copies the three components of the given vector v to this mesh's normals vector at positions n3, n3+1, n3+2.


setNormalsVector

public void setNormalsVector(int n3,
                             float nvx,
                             float nvy,
                             float nvz)
Copies the given vector component values to this mesh's normals vector at positions n3, n3+1, n3+2.


setVerticesVector

public void setVerticesVector(int v3,
                              Vector3f vvec)
Copies the three components of the given vector v to this mesh's vertices vector at positions v3, v3+1, v3+2.


addToVerticesVector

public void addToVerticesVector(int v3,
                                float[] adjxyz)
Adds the three given xyz values, to this mesh's vertices vector at positions v3, v3+1, v3+2. [#UNUSED#]


addToVerticesVectorScaled

public void addToVerticesVectorScaled(int v3,
                                      float[] adjxyz,
                                      float scale)
Adds the three given xyz values, with the given scaling, to this mesh's vertices vector at positions v3, v3+1, v3+2. [#UNUSED#]


save

public void save(JAOutputStream jouts,
                 boolean dupsv22)
          throws java.io.IOException
Writes this Mesh to the given stream, using ints rather than unsigned shorts if the dupsv22 flag is set.

Throws:
java.io.IOException

copyDuplicateVerticesAndNormals

public void copyDuplicateVerticesAndNormals()
Copy the data for each duplicate vertex/normal pair.


drawNormalsColour

public void drawNormalsColour(javax.media.opengl.GL2 gl)
(used for bill-board avatar loading). Effectively [#UNUSED#] -- it's called by the Character method of the same name, but that one is truly unused.


draw

public void draw(javax.media.opengl.GL2 gl,
                 float[] MAT_DA,
                 int texID)
Sets up and performs the OpenGL drawElements() for this mesh.