void TeamSensorSystem::removeSensor (SensorSystemPtr sensor) { sensor->clearContacts(); long index = sensor->getMasterIndex(); sensor->setMasterIndex(-1); sensors[index] = NULL; if (index < (numSensors - 1)) { sensors[index] = sensors[numSensors - 1]; sensors[index]->setMasterIndex(index); sensors[numSensors - 1] = NULL; } numSensors--; }
void TeamSensorSystem::removeSensor(SensorSystemPtr sensor) { sensor->clearContacts(); int32_t index = sensor->getMasterIndex(); sensor->setMasterIndex(-1); sensors[index] = nullptr; if(index < (numSensors - 1)) { sensors[index] = sensors[numSensors - 1]; sensors[index]->setMasterIndex(index); sensors[numSensors - 1] = nullptr; } numSensors--; }