コード例 #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
ファイル: PathCamera.cs プロジェクト: whztt07/DeltaEngine
		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;
		}
コード例 #4
0
 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
ファイル: CameraTests.cs プロジェクト: whztt07/DeltaEngine
		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
ファイル: LookAtCamera.cs プロジェクト: whztt07/DeltaEngine
		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
ファイル: FreeCamera.cs プロジェクト: whztt07/DeltaEngine
		public FreeCamera(Device device, Window window)
			: base(device, window)
		{
			Rotation = Quaternion.Identity;
		}
コード例 #9
0
ファイル: OrthoCamera.cs プロジェクト: whztt07/DeltaEngine
		public OrthoCamera(Device device, Window window, ScreenSpace screenSpace)
			: base(device, window)
		{
			this.screenSpace = screenSpace;
			ZoomLevel = 1.0f;
		}
コード例 #10
0
ファイル: PathCamera.cs プロジェクト: whztt07/DeltaEngine
		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
ファイル: Drawing.cs プロジェクト: lilinghui/DeltaEngine
 protected Drawing(Device device)
 {
     GraphicsDevice = device;
 }
コード例 #13
0
ファイル: Drawing.cs プロジェクト: hillwhite/DeltaEngine
 protected Drawing(Device device)
 {
     this.device = device;
 }
コード例 #14
0
ファイル: Sprite3DTests.cs プロジェクト: whztt07/DeltaEngine
			public BackgroundUVUpdater(Device device)
			{
				this.device = device;
			}
コード例 #15
0
		public Particle3DRenderer(BatchRenderer3D renderer, Device device)
		{
			this.renderer = renderer;
			this.device = device;
		}
コード例 #16
0
ファイル: TargetedCamera.cs プロジェクト: whztt07/DeltaEngine
		protected TargetedCamera(Device device, Window window)
			: base(device, window) {}