diff options
author | Chien Yang <[email protected]> | 2007-03-02 21:27:15 +0000 |
---|---|---|
committer | Chien Yang <[email protected]> | 2007-03-02 21:27:15 +0000 |
commit | a5ae2df830611505b04d2539bfd8bdf878b82cc7 (patch) | |
tree | c67fa6752d7840b31730a7938947feae74428292 /src/classes | |
parent | a4681c797ef3f606e2c050e63439bc1467601e19 (diff) |
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
Diffstat (limited to 'src/classes')
-rw-r--r-- | src/classes/share/com/sun/j3d/utils/picking/PickIntersection.java | 18 |
1 files 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; |