public Camera(System.Drawing.Rectangle clientBounds, MuxEngine.LinearAlgebra.Matrix4 xform) : base(xform) { ClientBounds = clientBounds; initCommon (); }
public Movable(MuxEngine.LinearAlgebra.Matrix4 xform) { m_rotation = xform.Rotation; m_position = xform.Translation; m_scale = new Vector3 (1,1,1); }
public ClTextureCamera(Rectangle clientBounds, ComputeCommandQueue commandQueue, MuxEngine.LinearAlgebra.Matrix4 transform) : base(clientBounds, transform) { rayTracingInit(commandQueue); }
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); }
public RayTracingCamera(System.Drawing.Rectangle clientBounds, MuxEngine.LinearAlgebra.Matrix4 transform) : base(clientBounds, transform) { rayTracingInit(); }