Bugfix: fixed a bug that caused NPE to be raised when Subsurface

modifier worked on an edge without faces.
experimental
jmekaelthas 10 years ago
parent f364d66640
commit 0c27026978
  1. 3
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/meshes/TemporalMesh.java

@ -194,7 +194,10 @@ public class TemporalMesh extends Geometry {
*/ */
public List<Face> getAdjacentFaces(Edge edge) { public List<Face> getAdjacentFaces(Edge edge) {
List<Face> result = new ArrayList<Face>(indexToFaceMapping.get(edge.getFirstIndex())); List<Face> result = new ArrayList<Face>(indexToFaceMapping.get(edge.getFirstIndex()));
List<Face> secondIndexAdjacentFaces = indexToFaceMapping.get(edge.getSecondIndex());
if(secondIndexAdjacentFaces != null) {
result.retainAll(indexToFaceMapping.get(edge.getSecondIndex())); result.retainAll(indexToFaceMapping.get(edge.getSecondIndex()));
}
return result; return result;
} }

Loading…
Cancel
Save