예제 #1
0
		public IsometricCamera(Device device, Window window, Vector3D lookDirection)
			: base(device, window)
		{
			base.Position = -lookDirection;
			ResetZoom();
			leftDirection = Vector3D.Normalize(Vector3D.Cross(lookDirection, -UpDirection));
		}
예제 #2
0
		public IsometricCamera(Device device, Window window)
			: base(device, window)
		{
			base.Position = -Vector3D.UnitY;
			ResetZoom();
			leftDirection = Vector3D.Normalize(Vector3D.Cross(Vector3D.UnitY, -UpDirection));
		}
예제 #3
0
		public PathCamera(Device device, Window window, CameraPath path)
			: base(device, window)
		{
			if (path.ViewMatrices == null || path.ViewMatrices.Length < 2)
				throw new NoTrackSpecified();
			viewMatrices = path.ViewMatrices;
		}
 private Drawing SetupDrawing(Device device)
 {
     var mockDrawing = new Mock<Drawing>(device);
     mockDrawing.Setup(
         d => d.DrawVertices(It.IsAny<VerticesMode>(), It.IsAny<VertexPositionColor[]>())).Callback(
             (VerticesMode mode, VertexPositionColor[] vertices) =>
                 testResolver.NumberOfVerticesDrawn += vertices.Length);
     return testResolver.RegisterMock(mockDrawing.Object);
 }
예제 #5
0
		public void CameraShouldBeAbleToHandleViewportChanges()
		{
			new Grid3D(new Size(5));
			usedDevice = Resolve<Device>();
			usedWindow = Resolve<Window>();
			Matrix originalProjectionMatrix = usedDevice.CameraProjectionMatrix;
			usedWindow.ViewportPixelSize = new Size(400, 300);
			usedDevice.Set3DMode();
			Assert.AreNotEqual(originalProjectionMatrix, usedDevice.CameraProjectionMatrix);
		}
예제 #6
0
		public LevelEditorCamera(Device device, Window window)
			: base(device, window)
		{
			new Command(Command.Drag,
				(startPos, currentPos, isDragDone) => RotateByDrag(startPos, currentPos)).Add(
					new MouseDragTrigger(MouseButton.Right));
			new Command(Command.Zoom, Zoom);
			//new Command(Command.Drag,
			//	(startPos, currentPos, isDragDone) => PanByDrag(startPos, currentPos)).Add(
			//		new MouseDragTrigger(MouseButton.Middle));
		}
예제 #7
0
		public LookAtCamera(Device device, Window window)
			: base(device, window)
		{
			// ReSharper disable DoNotCallOverridableMethodsInConstructor
			//Position = Vector3D.One * 3.0f;
			Position = DefaultPosition;
			Target = Vector3D.Zero;
			UpdatePosition();
			new Command(Command.Zoom, Zoom);
			new Command(Command.MoveLeft, () => Move(-MoveSpeedPerSecond, 0));
			new Command(Command.MoveRight, () => Move(MoveSpeedPerSecond, 0));
			new Command(Command.MoveUp, () => Move(0, MoveSpeedPerSecond));
			new Command(Command.MoveDown, () => Move(0, -MoveSpeedPerSecond));
			new Command(Command.Drag,
				//ncrunch: no coverage start
				(startPos, currentPos, isDragDone) => RotateByDragCommand(currentPos, isDragDone));
			//ncrunch: no coverage end
		}
예제 #8
0
		public FreeCamera(Device device, Window window)
			: base(device, window)
		{
			Rotation = Quaternion.Identity;
		}
예제 #9
0
		public OrthoCamera(Device device, Window window, ScreenSpace screenSpace)
			: base(device, window)
		{
			this.screenSpace = screenSpace;
			ZoomLevel = 1.0f;
		}
예제 #10
0
		public PathCamera(Device device, Window window)
			: base(device, window)
		{
			viewMatrices = new Matrix[]{Matrix.Identity, Matrix.Identity};
		}
예제 #11
0
		public BillboardRenderer(Drawing drawing, Device device)
		{
			this.drawing = drawing;
			this.device = device;
		}
예제 #12
0
 protected Drawing(Device device)
 {
     GraphicsDevice = device;
 }
예제 #13
0
 protected Drawing(Device device)
 {
     this.device = device;
 }
예제 #14
0
			public BackgroundUVUpdater(Device device)
			{
				this.device = device;
			}
예제 #15
0
		public Particle3DRenderer(BatchRenderer3D renderer, Device device)
		{
			this.renderer = renderer;
			this.device = device;
		}
예제 #16
0
		protected TargetedCamera(Device device, Window window)
			: base(device, window) {}