/// <summary> /// Parses a rotation from four components of the input data /// </summary> /// <param name="input">The input data.</param> /// <param name="indices">The indices in the data to parse from.</param> public void ParseRotationWXYZ(string[] input, int[] indices) { Quaternion result = CsvDataProvider.ParseQuaternionFromSample(input[indices[0]], input[indices[1]], input[indices[2]], input[indices[3]]); result.Normalize(); Matrix4x4 rotMatrixData = Matrix4x4.Rotate(result); Matrix4x4 rotMatrixUnity = axisTransformationMatrix4x4 * rotMatrixData * axisTransformationMatrix4x4.inverse; result = rotMatrixUnity.rotation; currentSample.Rotation = result; }
/// <summary> /// Parses a position from the input data /// </summary> /// <param name="input">The input data.</param> /// <param name="indices">The indices in the data to parse from.</param> public void ParsePosition(string[] input, int[] indices) { Vector3 result = UnitConversionFactor * CsvDataProvider.ParseVector3FromSample(input[indices[0]], input[indices[1]], input[indices[2]]); Vector4 vector = new Vector4(result.x, result.y, result.z, 0); vector = axisTransformationMatrix4x4 * vector; result.x = vector.x; result.y = vector.y; result.z = vector.z; currentSample.Position = result; }
/// <summary> /// Parses a scale from the input data /// </summary> /// <param name="input">The input data.</param> /// <param name="indices">The indices in the data to parse from.</param> public void ParseScale(string[] input, int[] indices) { currentSample.Scale = CsvDataProvider.ParseVector3FromSample(input[indices[0]], input[indices[1]], input[indices[2]]); }