public void SetWorldAxes(Matrix3x3 matrix)
{
if (Math.Abs(Vector3.Dot(matrix.Backward, matrix.Right)) > Toolbox.BigEpsilon)
throw new ArgumentException("The axes provided to the joint transform are not perpendicular. Ensure that the specified axes form a valid constraint.");
primaryAxis = Vector3.Normalize(matrix.Backward);
xAxis = Vector3.Normalize(matrix.Right);
Matrix3x3.TransformTranspose(ref this.primaryAxis, ref rotationMatrix, out localPrimaryAxis);
Matrix3x3.TransformTranspose(ref this.xAxis, ref rotationMatrix, out localXAxis);
}