/** * An internal function for comparing an object against the contents of a * node. * * @return Whether or not any overlaps were found. */ protected Boolean overlapNode() { // Walk the list and check for overlaps Boolean overlapProcessed = false; FlxObject checkObject; while (_iterator != null) { if (!_object.Exists || (_object.AllowCollisions <= 0)) { break; } checkObject = _iterator.Object; if ((_object == checkObject) || ((_object != null) && (_object.Equals(checkObject))) || !checkObject.Exists || (checkObject.AllowCollisions <= 0)) { _iterator = _iterator.next; continue; } // calculate bulk hull for _object _objectHullX = (_object.X < _object.Last.X) ? _object.X : _object.Last.X; _objectHullY = (_object.Y < _object.Last.Y) ? _object.Y : _object.Last.Y; _objectHullWidth = _object.X - _object.Last.X; _objectHullWidth = _object.Width + ((_objectHullWidth > 0) ? _objectHullWidth : -_objectHullWidth); _objectHullHeight = _object.Y - _object.Last.Y; _objectHullHeight = _object.Height + ((_objectHullHeight > 0) ? _objectHullHeight : -_objectHullHeight); // calculate bulk hull for checkObject _checkObjectHullX = (checkObject.X < checkObject.Last.X) ? checkObject.X : checkObject.Last.X; _checkObjectHullY = (checkObject.Y < checkObject.Last.Y) ? checkObject.Y : checkObject.Last.Y; _checkObjectHullWidth = checkObject.X - checkObject.Last.X; _checkObjectHullWidth = checkObject.Width + ((_checkObjectHullWidth > 0) ? _checkObjectHullWidth : -_checkObjectHullWidth); _checkObjectHullHeight = checkObject.Y - checkObject.Last.Y; _checkObjectHullHeight = checkObject.Height + ((_checkObjectHullHeight > 0) ? _checkObjectHullHeight : -_checkObjectHullHeight); // check for intersection of the two hulls if ((_objectHullX + _objectHullWidth > _checkObjectHullX) && (_objectHullX < _checkObjectHullX + _checkObjectHullWidth) && (_objectHullY + _objectHullHeight > _checkObjectHullY) && (_objectHullY < _checkObjectHullY + _checkObjectHullHeight)) { // Execute callback functions if they exist if ((_processingCallback == null) || _processingCallback(_object, checkObject)) { overlapProcessed = true; if (_notifyCallback != null) { _notifyCallback(_object, checkObject); } } } _iterator = _iterator.next; } return(overlapProcessed); }