/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="updaterManager"></param>
		/// <param name="projection"></param>
		public ControlledCamera3D(UpdateManager updaterManager, Projection projection)
			: base(projection, Matrix.Identity)
		{
			if (updaterManager != null)
				updaterManager.Add(this);
		}
		/// <summary>
		/// Fast copy projection settings from another projection object
		/// </summary>
		/// <param name="projection"></param>
		public void CopyFrom(Projection projection)
		{
			if (projection == null)
				throw new ArgumentNullException();
			
			AssertInUse();

			this.aspect = projection.aspect;
			this.changeIndex = projection.changeIndex;
			this.computedAspect = projection.computedAspect;
			this.far = projection.far;
			this.fov = projection.fov;
			this.leftHandedProjection = projection.leftHandedProjection;
			this.mat = projection.mat;
			this.near = projection.near;
			this.orthographic = projection.orthographic;
			this.region = projection.region;
			this.aspectValue = this.aspect.HasValue ? this.aspect.Value : this.computedAspect;

			this.set = false;
			this.changeIndex = System.Threading.Interlocked.Increment(ref changeBaseIndex);
		}
Пример #3
0
		/// <summary>
		/// Construct a camera with a default camera projection, using an identity matrix for it's position
		/// </summary>
		public Camera3D()
		{
			this.proj = new Projection();
			this.camMatrix = Matrix.Identity;
		}
		/// <summary>
		/// Construct the camera
		/// </summary>
		/// <param name="updateManager"></param>
		/// <param name="startPosition"></param>
		/// <param name="zUp">If true, the Z-Axis is treated as the up/down axis, otherwise Y-Axis is treated as up/down</param>
		/// <param name="projection"></param>
		public FirstPersonControlledCamera3D(UpdateManager updateManager, Vector3 startPosition, bool zUp, Projection projection)
			: base(updateManager, projection)
		{
			this.zUp = zUp;
			CameraMatrix = Matrix.CreateLookAt(startPosition, startPosition + new Vector3(1, 0, 0), new Vector3(0, 0, 1));
			this.Position = startPosition;
		}
Пример #5
0
		/// <summary>
		/// Construct a camera with the given projection, using an identity matrix for it's position
		/// </summary>
		public Camera3D(Projection projection)
		{
			this.proj = projection;
			this.camMatrix = Matrix.Identity;
		}
Пример #6
0
		/// <summary>
		/// Construct a camera with a fixed projection matrix, using an identity matrix for it's position
		/// </summary>
		public Camera3D(Matrix fixedProjectionMatrix)
		{
			this.proj = new FixedProjection(fixedProjectionMatrix);
			this.camMatrix = Matrix.Identity;
		}
Пример #7
0
		/// <summary>
		/// Construct a camera with a fixed projection matrix, located at the given matrix
		/// </summary>
		public Camera3D(Matrix fixedProjection, Matrix cameraMatrix)
		{
			this.proj = new FixedProjection(fixedProjection);
			this.camMatrix = cameraMatrix;
		}
Пример #8
0
		/// <summary>
		/// Construct a camera with the given projection, located at the given matrix
		/// </summary>
		public Camera3D(Projection projection, Matrix cameraMatrix)
		{
			this.proj = projection;
			this.camMatrix = cameraMatrix;
		}
Пример #9
0
 /// <summary>
 /// Construct a camera with a default camera projection, using an identity matrix for it's position
 /// </summary>
 public Camera3D()
 {
     this.proj      = new Projection();
     this.camMatrix = Matrix.Identity;
 }
Пример #10
0
 /// <summary>
 /// Construct a camera with the given projection, using an identity matrix for it's position
 /// </summary>
 /// <param name="projection"></param>
 public Camera3D(Projection projection)
 {
     this.proj      = projection;
     this.camMatrix = Matrix.Identity;
 }
Пример #11
0
 /// <summary>
 /// Construct a camera with the given projection, located at the given matrix
 /// </summary>
 /// <param name="projection"></param>
 /// <param name="cameraMatrix"></param>
 public Camera3D(Projection projection, Matrix cameraMatrix)
 {
     this.proj      = projection;
     this.camMatrix = cameraMatrix;
 }