public void addProximityDetector(ProximityDetector detector) { // make sure the bounding volumes are up to date // PERFORMANCE< we recalc the bounding volumes for bounding volume "dirty" objects to save some cycles > transformOnlyDirtyObjects(); recalcBoundingVolumesForDirtyObjects(); // do this to add all objects and particles which overlap IEnumerable <ProximityDetector> listOfOneProximityDetector = new ProximityDetector[] { detector }; ProximityHelper.checkProximityDetectorsAndFireEventsForParticles(listOfOneProximityDetector, particles); ProximityHelper.checkProximityDetectorsAndFireEventsForObjects(listOfOneProximityDetector, physicsAndMeshPairs.Select(v => v.physicsComponent)); privateProximityDetectors.Add(detector); }
void checkProximityAndFireEvents() { ProximityHelper.checkProximityDetectorsAndFireEventsForParticles(privateProximityDetectors, particles); ProximityHelper.checkProximityDetectorsAndFireEventsForObjects(privateProximityDetectors, physicsAndMeshPairs.Select(v => v.physicsComponent)); }