From a5ae2df830611505b04d2539bfd8bdf878b82cc7 Mon Sep 17 00:00:00 2001 From: Chien Yang Date: Fri, 2 Mar 2007 21:27:15 +0000 Subject: Fixed a getPrimitiveTexCoords() bug submitted by Shawn. git-svn-id: https://svn.java.net/svn/j3d-core-utils~svn/trunk@155 9497e636-51bd-65ba-982d-a4982e1767a5 --- .../com/sun/j3d/utils/picking/PickIntersection.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/classes/share/com/sun/j3d/utils/picking/PickIntersection.java b/src/classes/share/com/sun/j3d/utils/picking/PickIntersection.java index b9fa631..93024b9 100644 --- a/src/classes/share/com/sun/j3d/utils/picking/PickIntersection.java +++ b/src/classes/share/com/sun/j3d/utils/picking/PickIntersection.java @@ -1025,14 +1025,20 @@ public class PickIntersection { public TexCoord3f[] getPrimitiveTexCoords (int index) { if (primitiveTexCoords == null) { primitiveTexCoords = new TexCoord3f[primitiveVertexIndices.length]; + TexCoord2f primitiveTexCoords2DTmp = new TexCoord2f(); + int[] indices = getPrimitiveTexCoordIndices(index); int vformat = geom.getVertexFormat(); - if ((vformat & GeometryArray.BY_REFERENCE) == 0) { - for (int i = 0; i < indices.length; i++) { - primitiveTexCoords[i] = new TexCoord3f(); - geom.getTextureCoordinate(index, indices[i], primitiveTexCoords[i]); - } - } + if ((vformat & GeometryArray.BY_REFERENCE) == 0) { + for (int i = 0; i < indices.length; i++) { + primitiveTexCoords[i] = new TexCoord3f(); + geom.getTextureCoordinate(index, indices[i], primitiveTexCoords2DTmp); + primitiveTexCoords[i].set( + primitiveTexCoords2DTmp.x, + primitiveTexCoords2DTmp.y, + 0.0f); + } + } else { if ((vformat & GeometryArray.INTERLEAVED) == 0) { int val; -- cgit v1.2.3