Fixed how model bound were refreshed in BathNode : issue https://github.com/jMonkeyEngine/jmonkeyengine/issues/275
This commit is contained in:
		
							parent
							
								
									6d1ab7af65
								
							
						
					
					
						commit
						34220640aa
					
				| @ -119,19 +119,6 @@ public class BatchNode extends GeometryGroupNode { | |||||||
|         setNeedsFullRebatch(true); |         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){ |     protected Matrix4f getTransformMatrix(Geometry g){ | ||||||
|         return g.cachedWorldMat; |         return g.cachedWorldMat; | ||||||
| @ -169,7 +156,7 @@ public class BatchNode extends GeometryGroupNode { | |||||||
|             nvb.updateData(normBuf); |             nvb.updateData(normBuf); | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|             batch.needMeshUpdate = true; |             batch.geometry.updateModelBound(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -234,7 +221,7 @@ public class BatchNode extends GeometryGroupNode { | |||||||
| 
 | 
 | ||||||
|             batch.geometry.setMesh(m); |             batch.geometry.setMesh(m); | ||||||
|             batch.geometry.getMesh().updateCounts(); |             batch.geometry.getMesh().updateCounts(); | ||||||
|             batch.geometry.getMesh().updateBound(); |             batch.geometry.updateModelBound();             | ||||||
|             batches.add(batch); |             batches.add(batch); | ||||||
|         } |         } | ||||||
|         if (batches.size() > 0) { |         if (batches.size() > 0) { | ||||||
| @ -747,8 +734,7 @@ public class BatchNode extends GeometryGroupNode { | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         Geometry geometry; |         Geometry geometry;         | ||||||
|         boolean needMeshUpdate = false; |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     protected void setNeedsFullRebatch(boolean needsFullRebatch) { |     protected void setNeedsFullRebatch(boolean needsFullRebatch) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user