Fix in normals calculations when Y is up axis.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8528 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
7193c0b2d3
commit
ae739ef441
@ -194,7 +194,12 @@ public class MeshHelper extends AbstractBlenderHelper {
|
|||||||
int v3 = ((Number) mFace.getFieldValue("v3")).intValue();
|
int v3 = ((Number) mFace.getFieldValue("v3")).intValue();
|
||||||
int v4 = ((Number) mFace.getFieldValue("v4")).intValue();
|
int v4 = ((Number) mFace.getFieldValue("v4")).intValue();
|
||||||
|
|
||||||
Vector3f n = FastMath.computeNormal(vertices[v1], vertices[v2], vertices[v3]);
|
Vector3f n;
|
||||||
|
if(fixUpAxis) {
|
||||||
|
n = FastMath.computeNormal(vertices[v1], vertices[v3], vertices[v2]);
|
||||||
|
} else {
|
||||||
|
n = FastMath.computeNormal(vertices[v1], vertices[v2], vertices[v3]);
|
||||||
|
}
|
||||||
this.addNormal(n, normalMap, smooth, vertices[v1], vertices[v2], vertices[v3]);
|
this.addNormal(n, normalMap, smooth, vertices[v1], vertices[v2], vertices[v3]);
|
||||||
normalList.add(normalMap.get(vertices[v1]));
|
normalList.add(normalMap.get(vertices[v1]));
|
||||||
normalList.add(normalMap.get(vertices[v2]));
|
normalList.add(normalMap.get(vertices[v2]));
|
||||||
@ -489,7 +494,7 @@ public class MeshHelper extends AbstractBlenderHelper {
|
|||||||
* this exception is thrown when the blend file structure is somehow invalid or corrupted
|
* this exception is thrown when the blend file structure is somehow invalid or corrupted
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public Vector3f[] getVertices(Structure meshStructure, BlenderContext blenderContext) throws BlenderFileException {
|
private Vector3f[] getVertices(Structure meshStructure, BlenderContext blenderContext) throws BlenderFileException {
|
||||||
int verticesAmount = ((Number) meshStructure.getFieldValue("totvert")).intValue();
|
int verticesAmount = ((Number) meshStructure.getFieldValue("totvert")).intValue();
|
||||||
Vector3f[] vertices = new Vector3f[verticesAmount];
|
Vector3f[] vertices = new Vector3f[verticesAmount];
|
||||||
if (verticesAmount == 0) {
|
if (verticesAmount == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user