示例#1
0
        public Camera(System.Drawing.Rectangle clientBounds, MuxEngine.LinearAlgebra.Matrix4 xform)
            : base(xform)
        {
            ClientBounds = clientBounds;

            initCommon ();
        }
示例#2
0
 public Movable(MuxEngine.LinearAlgebra.Matrix4 xform)
 {
     m_rotation = xform.Rotation;
     m_position = xform.Translation;
     m_scale = new Vector3 (1,1,1);
 }
示例#3
0
 public ClTextureCamera(Rectangle clientBounds, ComputeCommandQueue commandQueue, MuxEngine.LinearAlgebra.Matrix4 transform)
     : base(clientBounds, transform)
 {
     rayTracingInit(commandQueue);
 }
示例#4
0
        protected void computeViewMatrix(ref MuxEngine.LinearAlgebra.Matrix4 world)
        {
            // Compute view matrix directly for speed
            //   To invert the world matrix we transpose it
            //   We ensure it's orthonormal first
            Vector3 zDir = world.Backward;
            Vector3.Normalize (ref zDir, out zDir);
            Vector3 xDir = Vector3.Cross (world.Up, zDir);
            Vector3.Normalize (ref xDir, out xDir);
            Vector3 yDir = Vector3.Cross (zDir, xDir);

            // Column four shouldn't deviate from [ 0 0 0 1 ]
            m_view.M11 = xDir.X;
            m_view.M12 = yDir.X;
            m_view.M13 = zDir.X;
            m_view.M21 = xDir.Y;
            m_view.M22 = yDir.Y;
            m_view.M23 = zDir.Y;
            m_view.M31 = xDir.Z;
            m_view.M32 = yDir.Z;
            m_view.M33 = zDir.Z;
            Vector3 eye = world.Translation;
            m_view.M41 = -Vector3.Dot (eye, xDir);
            m_view.M42 = -Vector3.Dot (eye, yDir);
            m_view.M43 = -Vector3.Dot (eye, zDir);
        }
示例#5
0
		public RayTracingCamera(System.Drawing.Rectangle clientBounds, MuxEngine.LinearAlgebra.Matrix4 transform)
			: base(clientBounds, transform)
		{
			rayTracingInit();
		}