diff options
Diffstat (limited to 'src/classes')
4 files changed, 19 insertions, 16 deletions
diff --git a/src/classes/share/javax/media/j3d/BoundingBox.java b/src/classes/share/javax/media/j3d/BoundingBox.java index a6d8f4f..2e9228c 100644 --- a/src/classes/share/javax/media/j3d/BoundingBox.java +++ b/src/classes/share/javax/media/j3d/BoundingBox.java @@ -13,6 +13,7 @@ package javax.media.j3d; import javax.vecmath.*; +import com.sun.j3d.internal.HashCodeUtil; /** * This class defines an axis aligned bounding box which is used for @@ -418,12 +419,12 @@ public class BoundingBox extends Bounds { */ public int hashCode() { long bits = 1L; - bits = 31L * bits + Double.doubleToLongBits(lower.x); - bits = 31L * bits + Double.doubleToLongBits(lower.y); - bits = 31L * bits + Double.doubleToLongBits(lower.z); - bits = 31L * bits + Double.doubleToLongBits(upper.x); - bits = 31L * bits + Double.doubleToLongBits(upper.y); - bits = 31L * bits + Double.doubleToLongBits(upper.z); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(lower.x); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(lower.y); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(lower.z); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(upper.x); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(upper.y); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(upper.z); return (int) (bits ^ (bits >> 32)); } diff --git a/src/classes/share/javax/media/j3d/BoundingPolytope.java b/src/classes/share/javax/media/j3d/BoundingPolytope.java index 2c6ae33..91076ee 100644 --- a/src/classes/share/javax/media/j3d/BoundingPolytope.java +++ b/src/classes/share/javax/media/j3d/BoundingPolytope.java @@ -14,6 +14,7 @@ package javax.media.j3d; import javax.vecmath.*; import java.lang.Math; +import com.sun.j3d.internal.HashCodeUtil; /** * A BoundingPolytope defines a polyhedral bounding region using the @@ -514,10 +515,10 @@ public class BoundingPolytope extends Bounds { long bits = 1L; for (int i = 0; i < planes.length; i++) { - bits = 31L * bits + Double.doubleToLongBits(planes[i].x); - bits = 31L * bits + Double.doubleToLongBits(planes[i].y); - bits = 31L * bits + Double.doubleToLongBits(planes[i].z); - bits = 31L * bits + Double.doubleToLongBits(planes[i].w); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(planes[i].x); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(planes[i].y); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(planes[i].z); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(planes[i].w); } return (int) (bits ^ (bits >> 32)); diff --git a/src/classes/share/javax/media/j3d/BoundingSphere.java b/src/classes/share/javax/media/j3d/BoundingSphere.java index 796adac..6e7e2e4 100644 --- a/src/classes/share/javax/media/j3d/BoundingSphere.java +++ b/src/classes/share/javax/media/j3d/BoundingSphere.java @@ -14,6 +14,7 @@ package javax.media.j3d; import javax.vecmath.*; import java.lang.Math; +import com.sun.j3d.internal.HashCodeUtil; /** * This class defines a spherical bounding region which is defined by a @@ -406,10 +407,10 @@ public class BoundingSphere extends Bounds { */ public int hashCode() { long bits = 1L; - bits = 31L * bits + Double.doubleToLongBits(radius); - bits = 31L * bits + Double.doubleToLongBits(center.x); - bits = 31L * bits + Double.doubleToLongBits(center.y); - bits = 31L * bits + Double.doubleToLongBits(center.z); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(radius); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(center.x); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(center.y); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(center.z); return (int) (bits ^ (bits >> 32)); } diff --git a/src/classes/share/javax/media/j3d/Transform3D.java b/src/classes/share/javax/media/j3d/Transform3D.java index 4b1d69f..5bf0da8 100644 --- a/src/classes/share/javax/media/j3d/Transform3D.java +++ b/src/classes/share/javax/media/j3d/Transform3D.java @@ -13,7 +13,7 @@ package javax.media.j3d; import javax.vecmath.*; -import java.lang.*; +import com.sun.j3d.internal.HashCodeUtil; /** * A generalized transform object represented internally as a 4x4 @@ -3921,7 +3921,7 @@ public class Transform3D { long bits = 1L; for (int i = 0; i < 16; i++) { - bits = 31L * bits + Double.doubleToLongBits(mat[i]); + bits = 31L * bits + HashCodeUtil.doubleToLongBits(mat[i]); } return (int) (bits ^ (bits >> 32)); } |