Пример #1
0
        public void Paint(int trackPos, RoadBrush road, AboveBrush above, SceneryBrush left, SceneryBrush right)
        {
            switch (road)
            {
                case RoadBrush.Road:
                    Offset = new Vector3(0f, 0f, 0f);
                    Size = new Vector2(1f, 0.05f);
                    TextureName = "road-normal";
                    TrackSurface = SurfaceType.Road;
                    if (trackPos % 2 == 0) Tint = Color.DarkGray.ToVector3();
                    else Tint = Color.White.ToVector3();
                    break;
                case RoadBrush.Wood:
                    Offset = new Vector3(0f, 0f, 0f);
                    Size = new Vector2(1f, 0.05f);
                    TextureName = "road-wood";
                    TrackSurface = SurfaceType.Road;
                    if (trackPos % 2 == 0) Tint = Color.DarkGray.ToVector3();
                    else Tint = Color.White.ToVector3();
                    break;
                case RoadBrush.Crossroad:
                    Offset = new Vector3(0f, 0f, 0f);
                    Size = new Vector2(1f, 0.05f);
                    TextureName = "crossroad";
                    TrackSurface = SurfaceType.Road;
                    //if (trackPos % 2 == 0) Tint = Color.DarkGray.ToVector3();
                    Tint = Color.White.ToVector3();
                    break;

            }

            Vector3 leftV = Vector3.Cross(Normal, Vector3.Up);
            Vector3 rightV = -Vector3.Cross(Normal, Vector3.Up);

            switch (above)
            {
                case AboveBrush.Tunnel:
                    AboveOffset = new Vector3(0f,0.45f,0f);
                    AboveSize = new Vector2(3f, 1f);
                    AboveTextureName = "tunnel";
                    if (trackPos % 4 == 0) AboveTint = Color.DarkGray.ToVector3();
                    else AboveTint = Color.White.ToVector3();
                    break;
                case AboveBrush.TunnelUpper:
                    AboveOffset = new Vector3(0f, 1.25f, 0f);
                    AboveSize = new Vector2(1f, 0.5f);
                    AboveTextureName = "tunnel-upper";
                    if (trackPos % 4 == 0) AboveTint = Color.DarkGray.ToVector3();
                    else AboveTint = Color.White.ToVector3();
                    break;
                case AboveBrush.StartGrid:
                    if (trackPos % 10 == 0)
                    {
                        AboveOffset = new Vector3(0f, 0.45f, 0f);
                        AboveSize = new Vector2(1.5f, 1f);
                        AboveTextureName = "start";
                        AboveTint = Color.White.ToVector3();
                    }
                    break;
                case AboveBrush.Erase:
                    AboveTextureName = "";
                    break;

            }

            switch (left)
            {
                case SceneryBrush.Trees:
                    if (trackPos % 10 == 0)
                    {
                        LeftOffset = (leftV * 1f) + (leftV * new Vector3(((float)randomNumber.NextDouble()*3f), 0f, 0f)) + new Vector3(0f, (-Position.Y) +0.4f, 0f);
                        LeftSize = new Vector2(0.5f, 1f);
                        LeftTextureName = "tree";
                        LeftScenery = SceneryType.Offroad;
                        LeftTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.LampPost:
                    if (trackPos % 10 == 0)
                    {
                        LeftOffset = (leftV * 1f) + new Vector3(0f, (-Position.Y) + 0.4f, 0f);
                        LeftSize = new Vector2(0.5f, 1f);
                        LeftTextureName = "lamppost-left";
                        LeftScenery = SceneryType.Offroad;
                        LeftTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.SignLeft:
                case SceneryBrush.SignRight:
                    if (trackPos % 20 == 0)
                    {
                        LeftOffset = (leftV * 1f) + new Vector3(0f, (-Position.Y) + 0.4f, 0f);
                        LeftSize = new Vector2(0.5f, 1f);
                        LeftTextureName = left==SceneryBrush.SignLeft?"sign-left":"sign-right";
                        LeftScenery = SceneryType.Wall;
                        LeftTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.Girders:
                    if (trackPos % 20 == 0)
                    {
                        LeftSize = new Vector2(0.25f, Position.Y + 1f);
                        LeftOffset = (leftV * 0.625f) + new Vector3(0f, (-Position.Y) + ((LeftSize.Y / 2)-0.1f), 0f);
                        LeftTextureName = "girder";
                        LeftScenery = SceneryType.Wall;
                        LeftTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.UpperWall:
                    LeftOffset = (leftV * 1f) + new Vector3(0f, 0f, 0f);
                    LeftSize = new Vector2(1f, 3f);
                    LeftTextureName = "wall";
                    LeftScenery = SceneryType.Wall;
                    if (trackPos % 4 == 0) LeftTint = Color.DarkGray.ToVector3();
                    else LeftTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.LowerWall:
                    LeftOffset = new Vector3(0f, -0.8f, 0f);
                    LeftSize = new Vector2(1.1f, 1.5f);
                    LeftTextureName = "wall";
                    LeftScenery = SceneryType.Wall;
                    if (trackPos % 4 == 0) LeftTint = Color.DarkGray.ToVector3();
                    else LeftTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.Ground:
                    LeftOffset = (leftV * 4f) + new Vector3(0f, (-Position.Y) -3f, 0f);
                    LeftSize = new Vector2(5f, 6f);
                    LeftTextureName = "ground";
                    LeftScenery = SceneryType.Offroad;
                    LeftTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.Building:
                    if (trackPos % 15 == 0)
                    {
                        LeftOffset = (leftV * 1f) + new Vector3(0f, (-Position.Y) + 1.2f, 0f);
                        LeftSize = new Vector2(2.5f, 2.5f);
                        LeftTextureName = "building";
                        LeftScenery = SceneryType.Offroad;
                        LeftTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.BuildingCorner:
                    if (trackPos % 1 == 0)
                    {
                        LeftOffset = (leftV * 2f) + new Vector3(0f, (-Position.Y) + 1.2f, 0f);
                        LeftSize = new Vector2(2f, 2.5f);
                        LeftTextureName = "buildingcorner";
                        LeftScenery = SceneryType.Offroad;
                        LeftTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.Crossroad:
                    LeftOffset = (leftV * 3f) + new Vector3(0f, 0f, 0f);
                    LeftSize = new Vector2(5f, 0.05f);
                    LeftTextureName = "crossroad";
                    LeftScenery = SceneryType.Offroad;
                    if (trackPos % 20 == 0) LeftTint = Color.Red.ToVector3();
                    else LeftTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.Erase:
                    LeftTextureName = "";
                    break;
            }
            switch (right)
            {
                case SceneryBrush.Trees:
                    if (trackPos % 10 == 0)
                    {
                        RightOffset = (rightV * 1f) + (rightV * new Vector3(((float)randomNumber.NextDouble() * 3f), 0f, 0f)) + new Vector3(0f, (-Position.Y) +0.4f, 0f);
                        RightSize = new Vector2(0.5f, 1f);
                        RightTextureName = "tree";
                        RightScenery = SceneryType.Offroad;
                        RightTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.LampPost:
                    if (trackPos % 10 == 0)
                    {
                        RightOffset = (rightV * 1f) + new Vector3(0f, (-Position.Y) + 0.4f, 0f);
                        RightSize = new Vector2(0.5f, 1f);
                        RightTextureName = "lamppost-right";
                        RightScenery = SceneryType.Offroad;
                        RightTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.SignLeft:
                case SceneryBrush.SignRight:
                    if (trackPos % 20 == 0)
                    {
                        RightOffset = (rightV * 1f) + new Vector3(0f, (-Position.Y) + 0.4f, 0f);
                        RightSize = new Vector2(0.5f, 1f);
                        RightTextureName = right == SceneryBrush.SignLeft ? "sign-left" : "sign-right";
                        RightScenery = SceneryType.Wall;
                        RightTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.Girders:
                    if (trackPos % 20 == 0)
                    {
                        RightSize = new Vector2(0.25f, Position.Y+1f);
                        RightOffset = (rightV * 0.625f) + new Vector3(0f, (-Position.Y) + ((RightSize.Y / 2)-0.1f), 0f);
                        RightTextureName = "girder";
                        RightScenery = SceneryType.Wall;
                        RightTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.UpperWall:
                    RightOffset = (rightV * 1f) + new Vector3(0f, 0f, 0f);
                    RightSize = new Vector2(1f, 3f);
                    RightTextureName = "wall";
                    RightScenery = SceneryType.Wall;
                    if (trackPos % 4 == 0) RightTint = Color.DarkGray.ToVector3();
                    else RightTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.LowerWall:
                    RightOffset = new Vector3(0f, -0.8f, 0f);
                    RightSize = new Vector2(1.1f, 1.5f);
                    RightTextureName = "wall";
                    RightScenery = SceneryType.Wall;
                    if (trackPos % 4 == 0) RightTint = Color.DarkGray.ToVector3();
                    else RightTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.Ground:
                    RightOffset = (rightV * 4f) + new Vector3(0f, (-Position.Y) -3f, 0f);
                    RightSize = new Vector2(4f, 6f);
                    RightTextureName = "ground";
                    RightScenery = SceneryType.Offroad;
                    RightTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.Building:
                    if (trackPos % 20 == 0)
                    {
                        RightOffset = (rightV * 1f) + new Vector3(0f, (-Position.Y) + 1.2f, 0f);
                        RightSize = new Vector2(2.5f, 2.5f);
                        RightTextureName = "building";
                        RightScenery = SceneryType.Offroad;
                        RightTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.BuildingCorner:
                    if (trackPos % 1 == 0)
                    {
                        RightOffset = (rightV * 2f) + new Vector3(0f, (-Position.Y) + 1.2f, 0f);
                        RightSize = new Vector2(2f, 2.5f);
                        RightTextureName = "buildingcorner";
                        RightScenery = SceneryType.Offroad;
                        RightTint = Color.White.ToVector3();
                    }
                    break;
                case SceneryBrush.Crossroad:
                    RightOffset = (rightV * 3f) + new Vector3(0f, 0f, 0f);
                    RightSize = new Vector2(5f, 0.05f);
                    RightTextureName = "crossroad";
                    RightScenery = SceneryType.Offroad;
                    if (trackPos % 20 == 0) RightTint = Color.Red.ToVector3();
                    else RightTint = Color.White.ToVector3();
                    break;
                case SceneryBrush.Erase:
                    RightTextureName = "";
                    break;
            }
        }
Пример #2
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            KeyboardState cks = Keyboard.GetState();
            MouseState cms = Mouse.GetState();
            Vector2 mousePos = new Vector2(cms.X, cms.Y);
            Vector2 mousedelta = mousePos - new Vector2(lms.X, lms.Y);
            int wheelDelta = cms.ScrollWheelValue - lms.ScrollWheelValue;

            //Mode select
            if (cks.IsKeyDown(Keys.F1) && !lks.IsKeyDown(Keys.F1))
            {
                Mode = EditorMode.Construction;
            }
            if (cks.IsKeyDown(Keys.F2) && !lks.IsKeyDown(Keys.F2))
            {
                Mode = EditorMode.Painting;
                currentTrackPos = 0;
                paintPos = 0;
            }
            if (cks.IsKeyDown(Keys.F3) && !lks.IsKeyDown(Keys.F3))
            {
                Mode = EditorMode.Testing;
                ResetCars();
                Camera.Position = Cars[7].CameraPosition;
                //car = new car(0, Track);
            }
            if (cks.IsKeyDown(Keys.F5) && !lks.IsKeyDown(Keys.F5))
            {
                Save();
            }

            if (cks.IsKeyDown(Keys.F12) && !lks.IsKeyDown(Keys.F12))
            {
                Load();
            }

            if (Mode == EditorMode.Construction)// || Mode == EditorMode.Testing)
            {
                Camera.AttachedToCar = false;

                if (cks.IsKeyDown(Keys.PageUp) && !lks.IsKeyDown(Keys.PageUp))
                {
                    selectedPoint++;
                    if (selectedPoint == ControlPoints.Count) selectedPoint = 0;
                }
                if (cks.IsKeyDown(Keys.PageDown) && !lks.IsKeyDown(Keys.PageDown))
                {
                    selectedPoint--;
                    if (selectedPoint == -1) selectedPoint = ControlPoints.Count - 1;
                }
                if (cks.IsKeyDown(Keys.Space) && !lks.IsKeyDown(Keys.Space))
                {
                    int pos = selectedPoint;
                    int nextpos = selectedPoint + 1;
                    if (pos >= ControlPoints.Count) pos = pos - (ControlPoints.Count);
                    if (nextpos >= ControlPoints.Count) nextpos = nextpos - ControlPoints.Count;
                    Vector3 delta = (ControlPoints[nextpos] - ControlPoints[pos]);
                    delta.X = delta.X / 2;
                    delta.Z = delta.Z / 2;
                    ControlPoints.Insert(selectedPoint + 1, ControlPoints[pos] + delta);
                    selectedPoint++;
                    Track.Rebuild(ControlPoints);
                }

                if (cks.IsKeyDown(Keys.Back) && !lks.IsKeyDown(Keys.Back))
                {
                    if(selectedPoint!=0)
                    {ControlPoints.RemoveAt(selectedPoint);
                    selectedPoint--;
                        }
                    Track.Rebuild(ControlPoints);
                }

                Vector3 moveVector = new Vector3(0, 0, 0);
                if (cks.IsKeyDown(Keys.Up) || cks.IsKeyDown(Keys.W))
                    moveVector += new Vector3(0, 0, -1);
                if (cks.IsKeyDown(Keys.Down) || cks.IsKeyDown(Keys.S))
                    moveVector += new Vector3(0, 0, 1);
                if (cks.IsKeyDown(Keys.Right) || cks.IsKeyDown(Keys.D))
                    moveVector += new Vector3(1, 0, 0);
                if (cks.IsKeyDown(Keys.Left) || cks.IsKeyDown(Keys.A))
                    moveVector += new Vector3(-1, 0, 0);
                Camera.AddToPosition(moveVector);

                if (cms.RightButton == ButtonState.Pressed)
                {
                    Vector3 pos = ControlPoints[selectedPoint];
                    pos.X += mousedelta.X * 0.05f;
                    pos.Z += mousedelta.Y * 0.05f;
                    ControlPoints[selectedPoint] = pos;

                    if (wheelDelta != 0)
                    {
                        if (wheelDelta > 0)
                            pos.Y += 1;
                        else
                            pos.Y -= 1;
                        ControlPoints[selectedPoint] = pos;
                    }
                    Track.Rebuild(ControlPoints);
                }
                else
                {
                    if (wheelDelta != 0)
                    {
                        if (wheelDelta > 0)
                        {
                            selectedPoint++;
                            if (selectedPoint == ControlPoints.Count) selectedPoint = 0;
                        }
                        else
                        {
                            selectedPoint--;
                            if (selectedPoint == -1) selectedPoint = ControlPoints.Count - 1;
                        }
                    }
                }

                if (cms.LeftButton == ButtonState.Pressed)
                {
                    Camera.Rotate(mousedelta.X, mousedelta.Y);
                }
            }

            if (Mode == EditorMode.Painting)
            {
                Camera.AttachedToCar = false;

                if (cks.IsKeyDown(Keys.Up) || cks.IsKeyDown(Keys.W))
                {
                    currentTrackPos++;
                    paintPos = currentTrackPos;
                }
                if (cks.IsKeyDown(Keys.Down) || cks.IsKeyDown(Keys.S))
                {
                    currentTrackPos--;
                    paintPos = currentTrackPos;
                }
                if (cks.IsKeyDown(Keys.Insert) && !lks.IsKeyDown(Keys.Insert))
                {
                    LeftBrush++;
                    if((int)LeftBrush > Enum.GetValues(typeof(SceneryBrush)).Length-1) LeftBrush = 0;
                }
                if (cks.IsKeyDown(Keys.Delete) && !lks.IsKeyDown(Keys.Delete))
                {
                    LeftBrush--;
                    if ((int)LeftBrush < 0) LeftBrush = (SceneryBrush)Enum.GetValues(typeof(SceneryBrush)).Length - 1;
                }
                if (cks.IsKeyDown(Keys.Home) && !lks.IsKeyDown(Keys.Home))
                {
                    RoadBrush++;
                    if ((int)RoadBrush > Enum.GetValues(typeof(RoadBrush)).Length - 1) RoadBrush = 0;
                }
                if (cks.IsKeyDown(Keys.End) && !lks.IsKeyDown(Keys.End))
                {
                    RoadBrush--;
                    if ((int)RoadBrush < 0) RoadBrush = (RoadBrush)Enum.GetValues(typeof(RoadBrush)).Length - 1;
                }
                if (cks.IsKeyDown(Keys.PageUp) && !lks.IsKeyDown(Keys.PageUp))
                {
                    RightBrush++;
                    if ((int)RightBrush > Enum.GetValues(typeof(SceneryBrush)).Length - 1) RightBrush = 0;
                }
                if (cks.IsKeyDown(Keys.PageDown) && !lks.IsKeyDown(Keys.PageDown))
                {
                    RightBrush--;
                    if ((int)RightBrush < 0) RightBrush = (SceneryBrush)Enum.GetValues(typeof(SceneryBrush)).Length - 1;
                }
                if (cks.IsKeyDown(Keys.NumPad7) && !lks.IsKeyDown(Keys.NumPad7))
                {
                    AboveBrush++;
                    if ((int)AboveBrush > Enum.GetValues(typeof(AboveBrush)).Length - 1) AboveBrush = 0;
                }
                if (cks.IsKeyDown(Keys.NumPad4) && !lks.IsKeyDown(Keys.NumPad4))
                {
                    AboveBrush--;
                    if ((int)AboveBrush < 0) AboveBrush = (AboveBrush)Enum.GetValues(typeof(AboveBrush)).Length - 1;
                }

                if (cks.IsKeyDown(Keys.R) && !lks.IsKeyDown(Keys.R))
                {
                    Track.Horizon++;
                    if ((int)Track.Horizon > Enum.GetValues(typeof(Horizon)).Length - 1) Track.Horizon = 0;
                    Track.LoadHorizon(Content, parallaxManager);
                }
                if (cks.IsKeyDown(Keys.F) && !lks.IsKeyDown(Keys.F))
                {
                    Track.Horizon--;
                    if ((int)Track.Horizon < 0) Track.Horizon = (Horizon)Enum.GetValues(typeof(Horizon)).Length - 1;
                    Track.LoadHorizon(Content, parallaxManager);
                }

                if (cks.IsKeyDown(Keys.T))
                {
                    Track.GroundColor.R++;
                }
                if (cks.IsKeyDown(Keys.G))
                {
                    Track.GroundColor.R--;
                }
                if (cks.IsKeyDown(Keys.Y))
                {
                    Track.GroundColor.G++;
                }
                if (cks.IsKeyDown(Keys.H))
                {
                    Track.GroundColor.G--;
                }
                if (cks.IsKeyDown(Keys.U))
                {
                    Track.GroundColor.B++;
                }
                if (cks.IsKeyDown(Keys.J))
                {
                    Track.GroundColor.B--;
                }

                if (currentTrackPos == Track.Length) currentTrackPos = 0;
                if (currentTrackPos == -1) currentTrackPos = Track.Length - 1;

                if (cks.IsKeyDown(Keys.Space))
                {
                    Track.TrackSegments[paintPos].Paint(paintPos, RoadBrush, AboveBrush, LeftBrush, RightBrush);
                    paintPos++;
                    if (paintPos > Track.TrackSegments.Count - 1) paintPos = 0;
                }

                if (cks.IsKeyDown(Keys.B) && !lks.IsKeyDown(Keys.B))
                {
                    Track.TrackSegments[paintPos].Paint(paintPos, RoadBrush, AboveBrush, LeftBrush, RightBrush);
                    paintPos++;
                    if (paintPos > Track.TrackSegments.Count - 1) paintPos = 0;
                }

                int nextpos = (currentTrackPos + 1);
                if (nextpos >= Track.TrackSegments.Count) nextpos = nextpos - Track.TrackSegments.Count;
                //Camera.viewMatrix = Matrix.CreateLookAt(Track.TrackSegments[currentTrackPos].Position + new Vector3(0, 0.5f, 0),
                //                                        Track.TrackSegments[nextpos].Position + new Vector3(0, 0.5f, 0),
                //                                        Vector3.Up);
                Camera.Position = Track.TrackSegments[currentTrackPos].Position + new Vector3(0, 0.5f, 0);
                Camera.LookAt(Track.TrackSegments[nextpos].Position + new Vector3(0, 0.5f, 0), 0f);

            }

            if (Mode == EditorMode.Testing)
            {
                if (!lockCameraToCar)
                {
                    Vector3 moveVector = new Vector3(0, 0, 0);
                    if (cks.IsKeyDown(Keys.Up) || cks.IsKeyDown(Keys.W))
                        moveVector += new Vector3(0, 0, -1);
                    if (cks.IsKeyDown(Keys.Down) || cks.IsKeyDown(Keys.S))
                        moveVector += new Vector3(0, 0, 1);
                    if (cks.IsKeyDown(Keys.Right) || cks.IsKeyDown(Keys.D))
                        moveVector += new Vector3(1, 0, 0);
                    if (cks.IsKeyDown(Keys.Left) || cks.IsKeyDown(Keys.A))
                        moveVector += new Vector3(-1, 0, 0);
                    Camera.AddToPosition(moveVector);

                    if (cms.LeftButton == ButtonState.Pressed)
                    {
                        Camera.Rotate(mousedelta.X, mousedelta.Y);
                    }
                }
                else
                {
                    Cars[7].ApplyThrottle(0f);
                    Cars[7].ApplyBrake(false);

                    if(cks.IsKeyDown(Keys.W) ||
                       cks.IsKeyDown(Keys.Up))
                    {
                        Cars[7].ApplyThrottle(1f);
                    }
                    else Cars[7].ApplyThrottle(0f);

                    if (cks.IsKeyDown(Keys.S) ||
                       cks.IsKeyDown(Keys.Down))
                    {
                        Cars[7].ApplyBrake(true);
                    }
                    else Cars[7].ApplyBrake(false);

                    if (cks.IsKeyDown(Keys.A) ||
                       cks.IsKeyDown(Keys.Left))
                    {
                        if (steeringAmount > 0f) steeringAmount -= 0.015f;
                        steeringAmount -= 0.01f;
                        steeringAmount = MathHelper.Clamp(steeringAmount, -0.5f, 0.5f);
                    }
                    else if (cks.IsKeyDown(Keys.D) ||
                            cks.IsKeyDown(Keys.Right))
                    {
                        if (steeringAmount < 0f) steeringAmount += 0.015f;
                        steeringAmount += 0.01f;
                        steeringAmount = MathHelper.Clamp(steeringAmount, -0.5f, 0.5f);
                    }
                    else steeringAmount = MathHelper.Lerp(steeringAmount, 0f, 0.15f);

                    Cars[7].Steer(steeringAmount);
                }

                if (cks.IsKeyDown(Keys.Space) && !lks.IsKeyDown(Keys.Space))
                {
                    lockCameraToCar = !lockCameraToCar;
                }
            }

            lks = cks;
            lms = cms;

            if (Mode == EditorMode.Testing)
            {
                foreach (Car c in Cars)
                {
                    c.Update(gameTime, Track, Cars);
                }

                if (lockCameraToCar)
                {
                    Camera.Position = Cars[7].CameraPosition;
                    Camera.LookAt(Cars[7].CameraLookat, (Cars[7].steeringAmount * 0.5f));
                    Camera.AttachedToCar = true;
                }
                else
                    Camera.AttachedToCar = false;
            }

            parallaxManager.Update(gameTime, new Vector2(((GraphicsDevice.Viewport.Width * 4) / MathHelper.TwoPi) * Helper.WrapAngle(Camera.Yaw), 0f));

            drawEffect.View = Camera.viewMatrix;
            drawAlphaEffect.View = Camera.viewMatrix;

            base.Update(gameTime);
        }