Exemplo n.º 1
0
void TeamSensorSystem::addSensor(SensorSystemPtr sensor)
{
	if(numSensors == MAX_SENSORS_PER_TEAM)
		Fatal(0, " TeamSensorSystem.addSensor: too many sensors ");
	sensor->setMasterIndex(numSensors);
	sensors[numSensors++] = sensor;
}
Exemplo n.º 2
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--;
}
Exemplo n.º 3
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--;
}