Exemple #1
0
 private void InitLongRangeSensors()
 {
     // long range sensors
     longRangeSensorsArray [0] = new VRSensor(numShortRangeSensors, transform.forward * m_sensorsStart);
     longRangeSensorsArray [1] = new VRSensor(numShortRangeSensors + 1, longRangeSensorsArray [0].Direction);
     longRangeSensorsArray [2] = new VRSensor(numShortRangeSensors + 2, longRangeSensorsArray [0].Direction);
 }
Exemple #2
0
        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 VRSensor(idx, deviation * transform.forward);
                angle = angle + delta;
            }
        }