Beispiel #1
0
 public static void Update(FixedCamera data, Vector3 charPos, int distance)
 {
     //75.0f
     data.Zoom();
     data.Position = Engine.TempVector3(charPos.X, (charPos.Y + 15.0f + distance / 3) - ((data._CurrentScrollValue / 60)), charPos.Z + 80.0f + distance - (data._CurrentScrollValue / 30));
     data.View = Matrix.CreateLookAt(data.Position, charPos, Vector3.Up);
 }
Beispiel #2
0
 /****************************************************************************************/
 public static void Initialize(FixedCamera data, Vector3 camPos, float nearClip, float farClip, float AspectRatio)
 {
     data.Position = camPos;
     data.AspectRatio = AspectRatio;
     data.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), data.AspectRatio, nearClip, farClip);
     data.View = Matrix.CreateLookAt(data.Position, Vector3.Backward, Vector3.Up);
     data.Type = CameraType.Fixed;
 }
Beispiel #3
0
 public void AddCamera(CameraType Type, string CameraName, Vector3 Position, float NearClip, float FarClip)
 {
     switch (Type) //<-- Switch with an enumeration found up top to add in additional cameras
     {
         case CameraType.Free:
             {
                 FreeCamera Dummy = new FreeCamera();
                 FreeCamera.Initialize(Dummy, Position, NearClip, FarClip, mGraphics.Peek.AspectRatio());
                 _Cameras.Add(CameraName, Dummy);
             }
             break;
         case CameraType.Fixed:
             {
                 FixedCamera Dummy = new FixedCamera();
                 FixedCamera.Initialize(Dummy, Position, NearClip, FarClip, mGraphics.Peek.AspectRatio());
                 _Cameras.Add(CameraName, Dummy);
             }
             break;
     }
 }