summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/share/com/sun/j3d/utils/picking/PickIntersection.java18
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;