FindACamera() public method

public FindACamera ( IEnumerable cameraAngles, TrackCamera adjustedCamera = null, int adjustRatioBy = 1 ) : TrackCamera
cameraAngles IEnumerable
adjustedCamera TrackCamera
adjustRatioBy int
return TrackCamera
Exemplo n.º 1
0
        void UpdateBattleCamera(DataSample data)
        {
            if (data.Telemetry.SessionTimeSpan <= cameraChangeTime)
            {
                return;
            }

            cameraChangeTime = data.Telemetry.SessionTimeSpan + this.battleCameraChangePeriod;

            var otherCar = ChangeCarForCamera(data, battleFollower);

            var cameraSet = otherCar == null ? new [] { CameraAngle.LookingInfrontOfCar, CameraAngle.LookingAtCar } : new [] { CameraAngle.LookingInfrontOfCar, CameraAngle.LookingBehindCar, CameraAngle.LookingAtCar };

            camera         = cameraControl.FindACamera(cameraSet, adjustedCamera, 2);
            adjustedCamera = null;

            if (camera.CameraAngle == CameraAngle.LookingBehindCar)
            {
                TraceInfo.WriteLine("{0} Changing to forward car, with reverse camera", data.Telemetry.SessionTimeSpan);
                car = otherCar;
            }
            else
            {
                car = battleFollower;
            }
            TraceInfo.WriteLine("{0} Changing camera to driver: {1}; camera: {2}", data.Telemetry.SessionTimeSpan, car.UserName, camera.CameraName);
            cameraControl.CameraOnDriver(car.CarNumberRaw, camera.CameraNumber);
        }
Exemplo n.º 2
0
        public void Direct(DataSample data)
        {
            if (isWatchingRandomDriver)
            {
                return;
            }

            isWatchingRandomDriver = true;

            finishWatchingRandomDriverAt = data.Telemetry.SessionTimeSpan + stickyTime;

            camera = cameraControl.FindACamera(new[] { CameraAngle.LookingInfrontOfCar, CameraAngle.LookingAtCar, CameraAngle.LookingAtTrack });
            car    = FindADriver(data);

            TraceInfo.WriteLine("{0} Changing camera to random driver: {1}; camera: {2}", data.Telemetry.SessionTimeSpan, car.UserName, camera.CameraName);
            cameraControl.CameraOnDriver((short)car.CarNumberRaw, camera.CameraNumber);
        }