/// <summary> /// Sets a given vector to the actively selected vector in the <see cref="InputsViewModel"/> /// </summary> /// <param name="vec"></param> public void SetVectorFromSelected(Vector3ViewModel vec) { if (Inputs.IsVectorSelected) { vec.Set(Inputs.SelectedVector.GetVector()); } }
/// <summary> /// Sets the actively selected vector in the <see cref="InputsViewModel"/> to the given vector /// </summary> /// <param name="vec"></param> public void SetVectorAsSelected(Vector3ViewModel vec) { if (Inputs.IsVectorSelected) { Inputs.SelectedVector.Set(vec.GetVector()); } }
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); }
public static Matrix4ViewModel RotateZ(Matrix4ViewModel a, Vector3ViewModel b) { Matrix4 rot = a.GetMatrix() * Matrix4.RotateZ(b.Z); return(new Matrix4ViewModel(rot)); }
public static Vector3 FromViewModel(this Vector3ViewModel vm) { return(new Vector3(vm.X, vm.Y, vm.Z)); }