示例#1
0
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--;
}
示例#2
0
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--;
}