private void InitLongRangeSensors() { // long range sensors longRangeSensorsArray [0] = new VRAVESensor(numShortRangeSensors, transform.forward * m_sensorsStart); longRangeSensorsArray [1] = new VRAVESensor(numShortRangeSensors + 1, longRangeSensorsArray [0].Direction); longRangeSensorsArray [2] = new VRAVESensor(numShortRangeSensors + 2, longRangeSensorsArray [0].Direction); }
private void InitShortRangeSensors() { // Short range sensors float delta = m_shortSensorAngleDelta / (numShortRangeSensors - 1); float angle = -(m_shortSensorAngleDelta / 2); for (int idx = 0; idx < numShortRangeSensors; ++idx) { Quaternion deviation = Quaternion.AngleAxis(angle, new Vector3(0, 1, 0)); shortRangeSensorsArray [idx] = new VRAVESensor(idx, deviation * transform.forward); angle = angle + delta; } }
private void InitShortRangeSensors() { // Short range sensors float delta = m_shortSensorAngleDelta / (numShortRangeSensors-1); float angle = -(m_shortSensorAngleDelta / 2); for (int idx = 0; idx < numShortRangeSensors; ++idx) { Quaternion deviation = Quaternion.AngleAxis (angle, new Vector3 (0, 1, 0)); shortRangeSensorsArray [idx] = new VRAVESensor(idx, deviation * transform.forward); angle = angle + delta; } }