コード例 #1
0
 /// <summary>
 /// Sets the actively selected matrix in the <see cref="InputsViewModel"/> to the given matrix
 /// </summary>
 /// <param name="mat"></param>
 public void SetMatrixAsSelected(Matrix4ViewModel mat)
 {
     if (Inputs.IsMatrixSelected)
     {
         Inputs.SelectedMatrix.Set(mat.GetMatrix());
     }
 }
コード例 #2
0
 /// <summary>
 /// Sets a given matrix to the actively selected matrix in the <see cref="InputsViewModel"/>
 /// </summary>
 /// <param name="mat"></param>
 public void SetMatrixFromSelected(Matrix4ViewModel mat)
 {
     if (Inputs.IsMatrixSelected)
     {
         mat.Set(Inputs.SelectedMatrix.GetMatrix());
     }
 }
コード例 #3
0
 public MatrixCalculationsViewModel()
 {
     DotProductInput1           = new Matrix4ViewModel();
     DotProductInput2           = new Matrix4ViewModel();
     DotProductOutput           = new Matrix4ViewModel();
     RotationMatrixInput        = new Matrix4ViewModel();
     RotationXInput             = new Vector3ViewModel();
     RotationYInput             = new Vector3ViewModel();
     RotationZInput             = new Vector3ViewModel();
     RotationMatrixOutput       = new Matrix4ViewModel();
     CalculateDotProductCommand = new Command(CalculateDotProduct);
     CalculateRotationCommand   = new CommandParam <string>(CalculateRotation);
 }
コード例 #4
0
        public static Matrix4ViewModel RotateZ(Matrix4ViewModel a, Vector3ViewModel b)
        {
            Matrix4 rot = a.GetMatrix() * Matrix4.RotateZ(b.Z);

            return(new Matrix4ViewModel(rot));
        }
コード例 #5
0
 public static Matrix4ViewModel MultiplyMatrixByMatrix(Matrix4ViewModel a, Matrix4ViewModel m)
 {
     return(new Matrix4ViewModel(a.GetMatrix() * m.GetMatrix()));
 }