Fixed how model bound were refreshed in BathNode : issue https://github.com/jMonkeyEngine/jmonkeyengine/issues/275

experimental
Nehon 10 years ago
parent 6d1ab7af65
commit 34220640aa
  1. 18
      jme3-core/src/main/java/com/jme3/scene/BatchNode.java

@ -119,19 +119,6 @@ public class BatchNode extends GeometryGroupNode {
setNeedsFullRebatch(true);
}
@Override
public void updateGeometricState() {
if (!children.isEmpty()) {
for (Batch batch : batches.getArray()) {
if (batch.needMeshUpdate) {
batch.geometry.updateModelBound();
batch.geometry.updateWorldBound();
batch.needMeshUpdate = false;
}
}
}
super.updateGeometricState();
}
protected Matrix4f getTransformMatrix(Geometry g){
return g.cachedWorldMat;
@ -169,7 +156,7 @@ public class BatchNode extends GeometryGroupNode {
nvb.updateData(normBuf);
batch.needMeshUpdate = true;
batch.geometry.updateModelBound();
}
}
@ -234,7 +221,7 @@ public class BatchNode extends GeometryGroupNode {
batch.geometry.setMesh(m);
batch.geometry.getMesh().updateCounts();
batch.geometry.getMesh().updateBound();
batch.geometry.updateModelBound();
batches.add(batch);
}
if (batches.size() > 0) {
@ -748,7 +735,6 @@ public class BatchNode extends GeometryGroupNode {
}
}
Geometry geometry;
boolean needMeshUpdate = false;
}
protected void setNeedsFullRebatch(boolean needsFullRebatch) {

Loading…
Cancel
Save