com.md5importer.model.mesh.primitive
Class Vertex

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

public class Vertex
extends java.lang.Object
implements java.io.Serializable, IVertex

Vertex defines the concrete implementation of a vertex.

Vertex cannot be cloned directly. The cloning process of Vertex 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
Vertex()
          Constructor of Vertex.
Vertex(int index)
          Constructor of Vertex.
 
Method Summary
 IVertex clone(IWeight[] clonedWeights)
          Clone this vertex.
 java.lang.Class getClassTag()
           
 int getIndex()
          Retrieve the index value of this vertex.
 com.jme.math.Vector3f getNormal()
          Retrieve the normal of this vertex.
 com.jme.math.Vector3f getPosition()
          Retrieve the position of this vertex.
 com.jme.math.Vector2f getTextureCoords()
          Retrieve the texture coordinates of this vertex.
 int getUsedTimes()
          Retrieve the number of times this vertex has been used.
 void incrementUsedTimes()
          Increment the number of times this vertex has been used by a triangle
 void processPosition()
          Process the vertex position.
 void read(com.jme.util.export.JMEImporter im)
           
 void resetInformation()
          Reset the normal and position information of this vertex.
 void setNormal(com.jme.math.Vector3f normal)
          Set the normal vector of this vertex.
 void setNormalReference(com.jme.math.Vector3f normal)
          Set this vertex to directly use the given reference as normal.
 void setTextureCoords(float u, float v)
          Set the texture coordinates of this vertex.
 void setWeights(IWeight... weights)
          Set weights that affects this vertex
 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

Vertex

public Vertex()
Constructor of Vertex.


Vertex

public Vertex(int index)
Constructor of Vertex.

Parameters:
index - The Integer index value.
Method Detail

processPosition

public void processPosition()
Description copied from interface: IVertex
Process the vertex position.

Specified by:
processPosition in interface IVertex

resetInformation

public void resetInformation()
Description copied from interface: IVertex
Reset the normal and position information of this vertex.

Specified by:
resetInformation in interface IVertex

incrementUsedTimes

public void incrementUsedTimes()
Description copied from interface: IVertex
Increment the number of times this vertex has been used by a triangle

Specified by:
incrementUsedTimes in interface IVertex

setTextureCoords

public void setTextureCoords(float u,
                             float v)
Description copied from interface: IVertex
Set the texture coordinates of this vertex.

Specified by:
setTextureCoords in interface IVertex
Parameters:
u - The u value.
v - The un-inverted v value.

setWeights

public void setWeights(IWeight... weights)
Description copied from interface: IVertex
Set weights that affects this vertex

Specified by:
setWeights in interface IVertex
Parameters:
weights - The variable argument of IWeight.

setNormal

public void setNormal(com.jme.math.Vector3f normal)
Description copied from interface: IVertex
Set the normal vector of this vertex.

Specified by:
setNormal in interface IVertex
Parameters:
normal - The normal Vector3f to be set.

setNormalReference

public void setNormalReference(com.jme.math.Vector3f normal)
Description copied from interface: IVertex
Set this vertex to directly use the given reference as normal.

Specified by:
setNormalReference in interface IVertex
Parameters:
normal - The Vector3f normal reference.

getTextureCoords

public com.jme.math.Vector2f getTextureCoords()
Description copied from interface: IVertex
Retrieve the texture coordinates of this vertex.

Specified by:
getTextureCoords in interface IVertex
Returns:
The Vector2f texture coordinates.

getUsedTimes

public int getUsedTimes()
Description copied from interface: IVertex
Retrieve the number of times this vertex has been used.

Specified by:
getUsedTimes in interface IVertex
Returns:
The Integer number of used times.

getPosition

public com.jme.math.Vector3f getPosition()
Description copied from interface: IVertex
Retrieve the position of this vertex.

Specified by:
getPosition in interface IVertex
Returns:
The Vector3f position.

getNormal

public com.jme.math.Vector3f getNormal()
Description copied from interface: IVertex
Retrieve the normal of this vertex.

Specified by:
getNormal in interface IVertex
Returns:
The normal Vector3f.

getIndex

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

Specified by:
getIndex in interface IVertex
Returns:
The Integer index.

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 IVertex clone(IWeight[] clonedWeights)
Description copied from interface: IVertex
Clone this vertex.

Specified by:
clone in interface IVertex
Returns:
The cloned copy of this Vertex