* Fixed incorrect byte->float conversion when loading color buffer in Blender loader

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9014 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
Sha..rd 13 years ago
parent 8cca61b3ef
commit 3e6d649c48
  1. 8
      engine/src/blender/com/jme3/scene/plugins/blender/meshes/MeshHelper.java

@ -480,10 +480,10 @@ public class MeshHelper extends AbstractBlenderHelper {
verticesColors = new LinkedList<float[]>();
mCol = pMCol.fetchData(blenderContext.getInputStream());
for (Structure color : mCol) {
float r = ((Number) color.getFieldValue("r")).byteValue() / 256.0f;
float g = ((Number) color.getFieldValue("g")).byteValue() / 256.0f;
float b = ((Number) color.getFieldValue("b")).byteValue() / 256.0f;
float a = ((Number) color.getFieldValue("a")).byteValue() / 256.0f;
float r = (((Number)color.getFieldValue("r")).byteValue() & 0xFF) / 256.0f;
float g = (((Number)color.getFieldValue("g")).byteValue() & 0xFF) / 256.0f;
float b = (((Number)color.getFieldValue("b")).byteValue() & 0xFF) / 256.0f;
float a = (((Number)color.getFieldValue("a")).byteValue() & 0xFF) / 256.0f;
verticesColors.add(new float[]{b, g, r, a});
}
}

Loading…
Cancel
Save