org.xith3d.utility.geometry
Class TangentsFactory

java.lang.Object
  extended by org.xith3d.utility.geometry.TangentsFactory

public class TangentsFactory
extends java.lang.Object

The TangentsFactory generates tanget data (tangents and bitangents) for arbitrary meshes.


Nested Class Summary
static class TangentsFactory.TangentsStoreMode
           
 
Field Summary
static TangentsFactory INSTANCE
           
 
Constructor Summary
protected TangentsFactory()
           
 
Method Summary
 void calculateTangents(Geometry geom, TangentsFactory.TangentsStoreMode storeMode, int storeIndex1, int storeIndex2)
          Calculates the tangents and bitangents for the given GeomContainer.
 void calculateTangents(Geometry geom, TangentsFactory.TangentsStoreMode storeMode, int storeIndex1, int storeIndex2, org.openmali.vecmath2.Vector3f[] tangents, org.openmali.vecmath2.Vector3f[] bitangents)
          Calculates the tangents and bitangents for the given GeomContainer.
static TangentsFactory getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final TangentsFactory INSTANCE
Constructor Detail

TangentsFactory

protected TangentsFactory()
Method Detail

getInstance

public static TangentsFactory getInstance()

calculateTangents

public void calculateTangents(Geometry geom,
                              TangentsFactory.TangentsStoreMode storeMode,
                              int storeIndex1,
                              int storeIndex2,
                              org.openmali.vecmath2.Vector3f[] tangents,
                              org.openmali.vecmath2.Vector3f[] bitangents)
Calculates the tangents and bitangents for the given GeomContainer. The GeometryArray must have at least three texture units where the first one (0) must be filled. It also has to have normals.
If both of the two array parameters are null, the tanget data is directly applied to the 2nd and 3rd (1, 2) texture units.

Parameters:
geom -
storeMode - use null to only store in the arrays (index1 and index2 are ignored then)
storeIndex1 -
storeIndex2 -
tangents -
bitangents -

calculateTangents

public void calculateTangents(Geometry geom,
                              TangentsFactory.TangentsStoreMode storeMode,
                              int storeIndex1,
                              int storeIndex2)
Calculates the tangents and bitangents for the given GeomContainer. The GeometryArray must have at least three texture units where the first one (0) must be filled. It also has to have normals.

Parameters:
geom -
storeMode -
storeIndex1 -
storeIndex2 -