aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorphil <[email protected]>2016-11-02 13:53:50 +1300
committerphil <[email protected]>2016-11-02 13:53:50 +1300
commit5da4049aa53cc1781ea175e98f14e1abcb0d2ece (patch)
tree8c6e155ff1b5056c414269f45a75b4b44ec37e85 /src/main
parent58ba592b289a22136f77c66b6cfe16f20413de04 (diff)
Bug 1330 - Bug fixes required to ensure a full compile() works
Note teh compile method must still be called manually
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/jogamp/java3d/ShaderAttributeArray.java32
-rw-r--r--src/main/java/org/jogamp/java3d/ShaderAttributeValue.java20
-rw-r--r--src/main/java/org/jogamp/java3d/Shape3DRetained.java4
3 files changed, 54 insertions, 2 deletions
diff --git a/src/main/java/org/jogamp/java3d/ShaderAttributeArray.java b/src/main/java/org/jogamp/java3d/ShaderAttributeArray.java
index 6f32de6..430d8bb 100644
--- a/src/main/java/org/jogamp/java3d/ShaderAttributeArray.java
+++ b/src/main/java/org/jogamp/java3d/ShaderAttributeArray.java
@@ -160,4 +160,36 @@ public class ShaderAttributeArray extends ShaderAttributeObject {
this.retained = new ShaderAttributeArrayRetained();
this.retained.setSource(this);
}
+
+
+ @Override
+ public boolean equals(Object anObject)
+ {
+ if (this == anObject)
+ {
+ return true;
+ }
+ if (anObject instanceof ShaderAttributeArray)
+ {
+ ShaderAttributeArray anotherShaderAttributeArray = (ShaderAttributeArray) anObject;
+ if (this.getAttributeName().equals(anotherShaderAttributeArray.getAttributeName()))
+ {
+ Object[] values = (Object[]) getValue();
+ Object[] otherValues = (Object[]) anotherShaderAttributeArray.getValue();
+ int n = values.length;
+ if (n == otherValues.length)
+ {
+ int i = 0;
+ while (n-- != 0)
+ {
+ if (!values[i].equals(otherValues[i]))
+ return false;
+ i++;
+ }
+ return true;
+ }
+ }
+ }
+ return false;
+ }
}
diff --git a/src/main/java/org/jogamp/java3d/ShaderAttributeValue.java b/src/main/java/org/jogamp/java3d/ShaderAttributeValue.java
index 9a84e2c..9a29a99 100644
--- a/src/main/java/org/jogamp/java3d/ShaderAttributeValue.java
+++ b/src/main/java/org/jogamp/java3d/ShaderAttributeValue.java
@@ -112,5 +112,25 @@ public class ShaderAttributeValue extends ShaderAttributeObject {
this.retained = new ShaderAttributeValueRetained();
this.retained.setSource(this);
}
+
+ @Override
+ public boolean equals(Object anObject)
+ {
+ if (this == anObject)
+ {
+ return true;
+ }
+ if (anObject instanceof ShaderAttributeValue)
+ {
+ ShaderAttributeValue anotherShaderAttributeValue = (ShaderAttributeValue) anObject;
+ if (this.getAttributeName().equals(anotherShaderAttributeValue.getAttributeName()))
+ {
+ Object value = ((ShaderAttributeValueRetained) this.retained).getValue();
+ Object otherValue = ((ShaderAttributeValueRetained) anotherShaderAttributeValue.retained).getValue();
+ return value.equals(otherValue);
+ }
+ }
+ return false;
+ }
}
diff --git a/src/main/java/org/jogamp/java3d/Shape3DRetained.java b/src/main/java/org/jogamp/java3d/Shape3DRetained.java
index 88f3823..a8597b5 100644
--- a/src/main/java/org/jogamp/java3d/Shape3DRetained.java
+++ b/src/main/java/org/jogamp/java3d/Shape3DRetained.java
@@ -1407,7 +1407,7 @@ Enumeration getAllGeometries(int id) {
// currentLocalToVworld in the intersect test, it will then
// be more costly and really beat the purpose of eliminating
// the static transform group
- if (isPickable || isCollidable ||
+ if (pickable || collidable ||
source.getCapability(Shape3D.ALLOW_PICKABLE_WRITE) ||
source.getCapability(Shape3D.ALLOW_COLLIDABLE_WRITE)) {
return false;
@@ -2560,7 +2560,7 @@ final static ArrayList<ArrayList<GeometryAtom>> getGeomAtomsList(LinkedHashSet<N
boolean isEquivalent(Shape3DRetained shape) {
- if (this.appearance != shape.appearance ||
+ if (!this.appearance.equals(shape.appearance) ||
// Scoping info should be same since they are under same group
this.appearanceOverrideEnable != shape.appearanceOverrideEnable ||
this.isPickable != shape.isPickable ||