public override void Transform(Mat4x4D forward, Mat4x4D inverse) { Vec4D center = forward * GetCenter(); Normal = (inverse.Transpose3x3() * Normal).Normalize(); OriginDistance = center.Dot(Normal); }
public override void Transform(Mat4x4D forward, Mat4x4D inverse) { Vert0 = Vert0.Transformed(forward); Vert1 = Vert1.Transformed(forward); Vert2 = Vert2.Transformed(forward); Recalculate(); }
/// <summary>Rotates the camera around the specified <paramref name="axis"/> vector by <paramref name="angle"/> degrees.</summary> /// <param name="angle">The angle to rotate by.</param> /// <param name="axis">The axis to rotate around.</param> public void Rotate(double angle, Vec4D axis) { Mat4x4D rotMat = MatrixTransforms.Rotate(angle, axis); position = rotMat * position; look = rotMat * look; up = rotMat * up; }
public override void Transform(Mat4x4D forward, Mat4x4D inverse) { if (forward != Mat4x4D.Identity4x4) { Transformed = true; } MatrixToObject *= forward; MatrixToWorld = inverse * MatrixToWorld; MatrixToNormal = MatrixToWorld.Transpose3x3(); CenterObj = MatrixToWorld * Center; }
public static TreeNode CreateMatrix(Mat4x4D matrix, string name) { TreeNode node = Create($"{name} (4x4 Matrix):", name); node.Tag = matrix; node.Nodes.Add($"Row 1: {matrix.D00} {matrix.D01} {matrix.D02} {matrix.D03}"); node.Nodes.Add($"Row 2: {matrix.D10} {matrix.D11} {matrix.D12} {matrix.D13}"); node.Nodes.Add($"Row 3: {matrix.D20} {matrix.D21} {matrix.D22} {matrix.D23}"); node.Nodes.Add($"Row 4: {matrix.D30} {matrix.D31} {matrix.D32} {matrix.D33}"); return(node); }
public Vertex Transformed(Mat4x4D matrix) { return(new Vertex(matrix * Position, (matrix * Normal).Normalize())); }
public override void Transform(Mat4x4D objectMatrix, Mat4x4D worldMatrix) { }
/// <summary> /// Apply a transformation to the primitive on top of any previous transformations. /// </summary> /// <param name="objectMatrix">The world-to-object transformation matrix.</param> /// <param name="worldMatrix">The object-to-world transformation matrix.</param> public abstract void Transform(Mat4x4D objectMatrix, Mat4x4D worldMatrix);