* attached to this ProximityComponent
* @param listener the listener to remove
*/
public void removeProximityListener(ProximityListener listener) {
// dummy record to compare against
ProximityListenerRecord comp = new ProximityListenerRecord(
new ClientProximityListenerWrapper(cell, listener), new BoundingVolume[0]);
ProximityListenerRecord found = null;
synchronized(listenerRecords) {
// find and cleanup the record
for (ProximityListenerRecord rec : listenerRecords) {
if (rec.equals(comp)) {
found = rec;
break;
}
}
listenerRecords.remove(comp);
if (found != null) {
// clean up the listener so an exit event is generated
Cell viewCell = ClientContextJME.getViewManager().getPrimaryViewCell();
found.cleanup(viewCell.getCellID());
}
}
}