Bugfix: fixed a bug that occured when vertex had more than 4 weights but the first 4 weights were not attached to any bone.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10233 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
Kae..pl 2013-01-29 14:47:44 +00:00
parent a37b8114b9
commit ded6dce715

View File

@ -333,7 +333,7 @@ import com.jme3.util.BufferUtils;
} else if(weight > 0) {//if weight is zero the simply ignore it
warnAboutTooManyVertexWeights = true;
Entry<Float, Integer> lowestWeightAndIndex = weightToIndexMap.firstEntry();
if(lowestWeightAndIndex.getKey() < weight) {
if(lowestWeightAndIndex != null && lowestWeightAndIndex.getKey() < weight) {
weightsFloatData.put(lowestWeightAndIndex.getValue(), weight);
indicesData.put(lowestWeightAndIndex.getValue(), boneIndex.byteValue());
weightToIndexMap.remove(lowestWeightAndIndex.getKey());