com.md5importer.model.mesh.primitive
Class Triangle

java.lang.Object
  extended by com.md5importer.model.mesh.primitive.Triangle
All Implemented Interfaces:
com.jme.util.export.Savable, ITriangle, java.io.Serializable

public class Triangle
extends java.lang.Object
implements java.io.Serializable, ITriangle

Triangle defines the concrete implementation of a triangle. It is responsible for calculating the normal vector for each IVertex.

Triangle cannot be cloned directly. The cloning process of a Triangle can only be initiated by the cloning process of the parent IMesh.

This class is used internally by MD5Importer only.

See Also:
Serialized Form

Constructor Summary
Triangle()
          Constructor of Triangle.
Triangle(int index, IVertex[] vertices)
          Constructor of Triangle.
 
Method Summary
 ITriangle clone(IVertex[] clonedVertices)
          Clone this triangle.
 java.lang.Class getClassTag()
           
 int getIndex()
          Retrieve the index value of this triangle.
 IVertex getVertex(int index)
          Retrieve the vertex with given array index.
 void processNormal()
          Process the normal of vertices and store the normal values in the IVertex instances.
 void read(com.jme.util.export.JMEImporter im)
           
 void write(com.jme.util.export.JMEExporter ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Triangle

public Triangle()
Constructor of Triangle.


Triangle

public Triangle(int index,
                IVertex[] vertices)
Constructor of Triangle.

Parameters:
index - The Integer index value.
vertices - The array of IVertex instances.
Method Detail

processNormal

public void processNormal()
Description copied from interface: ITriangle
Process the normal of vertices and store the normal values in the IVertex instances.

Specified by:
processNormal in interface ITriangle

getVertex

public IVertex getVertex(int index)
Description copied from interface: ITriangle
Retrieve the vertex with given array index.

Specified by:
getVertex in interface ITriangle
Parameters:
index - The Integer index number in the ITriangle.
Returns:
The IVertex instance with given array index.

getIndex

public int getIndex()
Description copied from interface: ITriangle
Retrieve the index value of this triangle.

Specified by:
getIndex in interface ITriangle
Returns:
The Integer index value.

getClassTag

public java.lang.Class getClassTag()
Specified by:
getClassTag in interface com.jme.util.export.Savable

write

public void write(com.jme.util.export.JMEExporter ex)
           throws java.io.IOException
Specified by:
write in interface com.jme.util.export.Savable
Throws:
java.io.IOException

read

public void read(com.jme.util.export.JMEImporter im)
          throws java.io.IOException
Specified by:
read in interface com.jme.util.export.Savable
Throws:
java.io.IOException

clone

public ITriangle clone(IVertex[] clonedVertices)
Description copied from interface: ITriangle
Clone this triangle.

Specified by:
clone in interface ITriangle
Parameters:
clonedVertices - The array of cloned IVertex.
Returns:
The cloned copy of this ITriangle