com.jmex.model.ogrexml.anim
Class WeightBuffer

java.lang.Object
  extended by com.jmex.model.ogrexml.anim.WeightBuffer
All Implemented Interfaces:
java.io.Serializable

public final class WeightBuffer
extends java.lang.Object
implements java.io.Serializable

WeightBuffer contains associations of vertexes to bones and their weights. The WeightBuffer can be sent to a shader or processed on the CPU to do skinning.

See Also:
Serialized Form

Field Summary
(package private)  java.nio.ByteBuffer indexes
          Each 4 bytes in the boneIndex buffer are assigned to a vertex.
(package private)  int maxWeightsPerVert
          The maximum number of weighted bones used by the vertices Can be 1-4.
(package private)  java.nio.FloatBuffer weights
          The weight of each bone specified in the index buffer
 
Constructor Summary
WeightBuffer(java.nio.ByteBuffer indexes, java.nio.FloatBuffer weights)
           
WeightBuffer(int vertexCount)
           
 
Method Summary
 void initializeWeights()
          Normalizes weights if needed and finds largest amount of weights used for all vertices in the buffer.
 void sendToShader(GLSLShaderObjectsState shader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexes

java.nio.ByteBuffer indexes
Each 4 bytes in the boneIndex buffer are assigned to a vertex.


weights

java.nio.FloatBuffer weights
The weight of each bone specified in the index buffer


maxWeightsPerVert

int maxWeightsPerVert
The maximum number of weighted bones used by the vertices Can be 1-4. The indexes and weights still have 4 components per vertex, regardless of this value.

Constructor Detail

WeightBuffer

public WeightBuffer(int vertexCount)

WeightBuffer

public WeightBuffer(java.nio.ByteBuffer indexes,
                    java.nio.FloatBuffer weights)
Method Detail

sendToShader

public void sendToShader(GLSLShaderObjectsState shader)

initializeWeights

public void initializeWeights()
Normalizes weights if needed and finds largest amount of weights used for all vertices in the buffer.