public class Mesh
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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(com.jogamp.opengl.GL2 gl,
float[] MAT_DA,
int texID)
Sets up and performs the OpenGL drawElements() for this mesh.
|
void |
drawNormalsColour(com.jogamp.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.
|
public static int TRM_SMOOTH
public static int TRM_TEXTURED
public static int TRM_WIRE
public static int TRM_POINTMESH
public static int TRM_FLAT
public static int TRM_SKELETON
public static int TRM_FACEPICKING
public static int TRM_MAP2D3D
public static int TRM_WEIGHTMAPPING
public Mesh()
public Mesh(JAInputStream jins, JAOptions jopts, int ver3dig) throws java.io.IOException
java.io.IOException
public void fixBoneReferences(Skeleton skeleton)
public float getLODRange()
public MeshVertex[] getPoints()
public float[] getVertices()
public float[] getNormals()
public void getVertex(int v3, float[] vtx)
public MorphHandler getMorphHandler()
public void setNormalsVector(int n3, Vector3f nvec)
public void setNormalsVector(int n3, float nvx, float nvy, float nvz)
public void setVerticesVector(int v3, Vector3f vvec)
public void addToVerticesVector(int v3, float[] adjxyz)
public void addToVerticesVectorScaled(int v3, float[] adjxyz, float scale)
public void save(JAOutputStream jouts, boolean dupsv22) throws java.io.IOException
java.io.IOException
public void copyDuplicateVerticesAndNormals()
public void drawNormalsColour(com.jogamp.opengl.GL2 gl)
public void draw(com.jogamp.opengl.GL2 gl, float[] MAT_DA, int texID)