From 979ab971d7fdea92fd1908f0cce64c28117e19cf Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sun, 15 Jan 2012 16:48:51 -0800 Subject: j3dcore: reduce memory footprint of BoundSphere The temp array of Point3d's are only used in one constructor, which is not called anywhere in the Java3d package. Allocate a temp inside the constructor as-required and reduce the memory use for everyone else. Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/BoundingSphere.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/classes') diff --git a/src/classes/share/javax/media/j3d/BoundingSphere.java b/src/classes/share/javax/media/j3d/BoundingSphere.java index db14526..2f10b9e 100644 --- a/src/classes/share/javax/media/j3d/BoundingSphere.java +++ b/src/classes/share/javax/media/j3d/BoundingSphere.java @@ -55,9 +55,6 @@ final Point3d center; */ double radius; - Point3d boxVerts[]; - boolean allocBoxVerts = false; - // reusable temp objects private BoundingBox tmpBox = null; private BoundingPolytope tmpPolytope = null; @@ -193,6 +190,7 @@ double radius; if(boundsIsInfinite) return; + Point3d[] boxVerts = null; for(;i