From f24a01217f39df3b02a01444ac1a720994f090c8 Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Wed, 10 Oct 2012 00:29:53 -0700 Subject: j3dcore: fix fatal bug in Shape3DCompileRetained intersect() This code must not be being triggered as the type annotation uncovered it mixing up Geometry and GeometryRetained, this likely looks like the Geometry should have been getting its .retained member used instead, do that here, it can't be any worse than what was there before. Signed-off-by: Harvey Harrison --- src/classes/share/javax/media/j3d/Shape3DCompileRetained.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java b/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java index c77fd77..7b5f863 100644 --- a/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java +++ b/src/classes/share/javax/media/j3d/Shape3DCompileRetained.java @@ -65,7 +65,6 @@ Shape3DCompileRetained(Shape3DRetained[] shapes, int nShapes, int compileFlags) // Remove the null that was added by Shape3DRetained constructor geometryList.remove(0); - int geoIndex = 0; // Assign the fields for this compile shape boundsAutoCompute = shapes[0].boundsAutoCompute; @@ -316,8 +315,8 @@ Bounds getBounds(int childIndex) { } - boolean intersect(PickInfo pickInfo, PickShape pickShape, int flags, - ArrayList geometryList) { +boolean intersect(PickInfo pickInfo, PickShape pickShape, int flags, + ArrayList geometryList) { Transform3D localToVworld = pickInfo.getLocalToVWorldRef(); @@ -327,14 +326,13 @@ Bounds getBounds(int childIndex) { int geomListSize = geometryList.size(); GeometryRetained geometry; - if (((flags & PickInfo.CLOSEST_INTERSECTION_POINT) == 0) && ((flags & PickInfo.CLOSEST_DISTANCE) == 0) && ((flags & PickInfo.CLOSEST_GEOM_INFO) == 0) && ((flags & PickInfo.ALL_GEOM_INFO) == 0)) { for (int i=0; i < geomListSize; i++) { - geometry = (GeometryRetained) geometryList.get(i); + geometry = (GeometryRetained) geometryList.get(i).retained; if (geometry != null) { if (geometry.mirrorGeometry != null) { geometry = geometry.mirrorGeometry; @@ -355,7 +353,7 @@ Bounds getBounds(int childIndex) { Point3d iPntVW = new Point3d(); for (int i=0; i < geomListSize; i++) { - geometry = (GeometryRetained) geometryList.get(i); + geometry = (GeometryRetained) geometryList.get(i).retained; if (geometry != null) { if (geometry.mirrorGeometry != null) { geometry = geometry.mirrorGeometry; -- cgit v1.2.3