From 212b57ecc6a3850c84d6fb4d1f2aa5cacbbce238 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 27 Nov 2011 13:46:20 +0000 Subject: [PATCH] - add some equals() methods where compareTo is used git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8820 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/collision/CollisionResult.java | 8 ++++++++ .../jme3/terrain/geomipmap/picking/TerrainPickData.java | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/engine/src/core/com/jme3/collision/CollisionResult.java b/engine/src/core/com/jme3/collision/CollisionResult.java index 2f3455312..aef39367f 100644 --- a/engine/src/core/com/jme3/collision/CollisionResult.java +++ b/engine/src/core/com/jme3/collision/CollisionResult.java @@ -107,6 +107,14 @@ public class CollisionResult implements Comparable { return 0; } + @Override + public boolean equals(Object obj) { + if(obj instanceof CollisionResult){ + return ((CollisionResult)obj).compareTo(this) == 0; + } + return super.equals(obj); + } + public Vector3f getContactPoint() { return contactPoint; } diff --git a/engine/src/terrain/com/jme3/terrain/geomipmap/picking/TerrainPickData.java b/engine/src/terrain/com/jme3/terrain/geomipmap/picking/TerrainPickData.java index 7ec316c13..bee7623ab 100644 --- a/engine/src/terrain/com/jme3/terrain/geomipmap/picking/TerrainPickData.java +++ b/engine/src/terrain/com/jme3/terrain/geomipmap/picking/TerrainPickData.java @@ -68,4 +68,12 @@ public class TerrainPickData implements Comparable { return 0; } + @Override + public boolean equals(Object obj) { + if(obj instanceof TerrainPickData){ + return ((TerrainPickData)obj).compareTo(this) == 0; + } + return super.equals(obj); + } + }