com.jme.scene.lod
Class CollapseRecord

java.lang.Object
  extended by com.jme.scene.lod.CollapseRecord
All Implemented Interfaces:
Savable, java.io.Serializable

public class CollapseRecord
extends java.lang.Object
implements java.io.Serializable, Savable

CollapseRecord originally ported from David Eberly's c++, modifications and enhancements made from there.

This class keeps an array of vertex index positions that are to be collapsed. It is used to modify ClodMesh objects so that they contain less information.

Version:
$Id: CollapseRecord.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Joshua Slack, Jack Lindamood (javadoc only)
See Also:
Serialized Form

Field Summary
 int[] indices
          An integer value in the Mesh's indices array referencing a vertex to keep or throw.
 int numbIndices
          Lenght of this indices array.
 int numbTriangles
          The number of triangles in the Mesh after edge collapse.
 int numbVerts
           
 int vertToKeep
          An int index in the Mesh's vertex array.
 int vertToThrow
          An int index in the Mesh's vertex array.
 
Constructor Summary
CollapseRecord()
          Creates a new collapse record with all values at their default.
CollapseRecord(int toKeep, int toThrow, int vertQuantity, int triQuantity)
          Creates a new CollapseRecord.
 
Method Summary
 java.lang.Class getClassTag()
           
 void read(JMEImporter e)
           
 void write(JMEExporter e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertToKeep

public int vertToKeep
An int index in the Mesh's vertex array. It is the vertex assigned from the indices array. Used in collapsing the mesh.


vertToThrow

public int vertToThrow
An int index in the Mesh's vertex array. It is the vertex assigned from the indices array. Used in expanding the mesh.


numbVerts

public int numbVerts

numbTriangles

public int numbTriangles
The number of triangles in the Mesh after edge collapse.


numbIndices

public int numbIndices
Lenght of this indices array.


indices

public int[] indices
An integer value in the Mesh's indices array referencing a vertex to keep or throw.

Constructor Detail

CollapseRecord

public CollapseRecord(int toKeep,
                      int toThrow,
                      int vertQuantity,
                      int triQuantity)
Creates a new CollapseRecord.

Parameters:
toKeep - The vertex index that is kept.
toThrow - The vertex index that is thrown.
vertQuantity - The new vertex quantity of the mesh using this record.
triQuantity - The new triangle quantity of the mesh using this record.

CollapseRecord

public CollapseRecord()
Creates a new collapse record with all values at their default.

Method Detail

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Throws:
java.io.IOException

getClassTag

public java.lang.Class getClassTag()
Specified by:
getClassTag in interface Savable