From 30e1128a57fa0dfc874fd957b3e016f936d234fa Mon Sep 17 00:00:00 2001 From: "Sha..om" Date: Fri, 14 Oct 2011 14:37:05 +0000 Subject: [PATCH] * Remove silly allocation of triangle per BIH node. Use temp vars instead git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8388 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/collision/bih/BIHNode.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/src/core/com/jme3/collision/bih/BIHNode.java b/engine/src/core/com/jme3/collision/bih/BIHNode.java index 25ea749ac..ba067d005 100644 --- a/engine/src/core/com/jme3/collision/bih/BIHNode.java +++ b/engine/src/core/com/jme3/collision/bih/BIHNode.java @@ -66,7 +66,10 @@ public final class BIHNode implements Savable { private float leftPlane; private float rightPlane; private int axis; - private Triangle tmpTriangle = new Triangle(); + + //Do not do this: It increases memory usage of each BIHNode by at least 56 bytes! + // + //private Triangle tmpTriangle = new Triangle(); public BIHNode(int l, int r) { leftIndex = l; @@ -167,7 +170,7 @@ public final class BIHNode implements Savable { stack.add(new BIHStackData(this, 0, 0)); - Triangle t = tmpTriangle; + Triangle t = new Triangle(); int cols = 0; stackloop: