From a408ebecbfbbb8622a252390758afbcf1acba665 Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Mon, 8 Oct 2007 23:39:56 +0000 Subject: Fixed Issue 519 : IntersectionInfo.getGeometry return null for IndexedArrayGeometry. This fix is submitted by jeromerobert. Removed unuse import and local variables. git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@869 ba19aa83-45c5-6ac9-afd3-db810772062c --- .../media/j3d/IndexedGeometryArrayRetained.java | 4 +- .../j3d/IndexedGeometryStripArrayRetained.java | 50 +++++++++++----------- 2 files changed, 28 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java b/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java index b8fdc02..3e0d74d 100644 --- a/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java +++ b/src/classes/share/javax/media/j3d/IndexedGeometryArrayRetained.java @@ -91,7 +91,6 @@ abstract class IndexedGeometryArrayRetained extends GeometryArrayRetained { GeometryArrayRetained cloneNonIndexedGeometry() { GeometryArrayRetained obj = null; - int vOffset; switch (this.geoType) { case GEO_TYPE_INDEXED_LINE_SET: @@ -116,7 +115,8 @@ abstract class IndexedGeometryArrayRetained extends GeometryArrayRetained { vertexAttrCount, vertexAttrSizes); obj.cloneSourceArray = this; obj.unIndexify(this); - + obj.source=source; + return obj; } diff --git a/src/classes/share/javax/media/j3d/IndexedGeometryStripArrayRetained.java b/src/classes/share/javax/media/j3d/IndexedGeometryStripArrayRetained.java index 656b0f5..98293cc 100644 --- a/src/classes/share/javax/media/j3d/IndexedGeometryStripArrayRetained.java +++ b/src/classes/share/javax/media/j3d/IndexedGeometryStripArrayRetained.java @@ -11,7 +11,6 @@ */ package javax.media.j3d; -import java.util.Vector; import java.util.ArrayList; /** @@ -138,29 +137,32 @@ abstract class IndexedGeometryStripArrayRetained extends IndexedGeometryArrayRet } - GeometryArrayRetained cloneNonIndexedGeometry() { - GeometryStripArrayRetained obj = null; - int i; - switch (this.geoType) { - case GEO_TYPE_INDEXED_LINE_STRIP_SET: - obj = new LineStripArrayRetained(); - break; - case GEO_TYPE_INDEXED_TRI_FAN_SET: - obj = new TriangleFanArrayRetained(); - break; - case GEO_TYPE_INDEXED_TRI_STRIP_SET: - obj = new TriangleStripArrayRetained(); - break; - } - obj.createGeometryArrayData(validIndexCount, - (vertexFormat & ~(GeometryArray.BY_REFERENCE|GeometryArray.INTERLEAVED|GeometryArray.USE_NIO_BUFFER)), - texCoordSetCount, texCoordSetMap, - vertexAttrCount, vertexAttrSizes); - obj.unIndexify(this); - obj.setStripVertexCounts(stripIndexCounts); - - return obj; - } + @Override + GeometryArrayRetained cloneNonIndexedGeometry() { + GeometryStripArrayRetained obj = null; + + switch (this.geoType) { + case GEO_TYPE_INDEXED_LINE_STRIP_SET: + obj = new LineStripArrayRetained(); + break; + case GEO_TYPE_INDEXED_TRI_FAN_SET: + obj = new TriangleFanArrayRetained(); + break; + case GEO_TYPE_INDEXED_TRI_STRIP_SET: + obj = new TriangleStripArrayRetained(); + break; + } + obj.createGeometryArrayData(validIndexCount, + (vertexFormat & ~(GeometryArray.BY_REFERENCE|GeometryArray.INTERLEAVED|GeometryArray.USE_NIO_BUFFER)), + texCoordSetCount, texCoordSetMap, + vertexAttrCount, vertexAttrSizes); + obj.unIndexify(this); + obj.setStripVertexCounts(stripIndexCounts); + obj.cloneSourceArray = this; + obj.source = source; + + return obj; + } /** -- cgit v1.2.3