// get world axis from face normal public Vector3 GetClosestAxisForPlaneNormal() { Vector3 norm = Normal.Absolute(); return(norm.X >= norm.Y && norm.X >= norm.Z ? Vector3.UnitX : (norm.Y >= norm.Z) ? Vector3.UnitY : Vector3.UnitZ); }
/// <summary> /// Gets the axis closest to the normal of this plane /// </summary> /// <returns>Coordinate.UnitX, Coordinate.UnitY, or Coordinate.UnitZ depending on the plane's normal</returns> public Coordinate GetClosestAxisToNormal() { // VHE prioritises the axes in order of X, Y, Z. var norm = Normal.Absolute(); if (norm.X >= norm.Y && norm.X >= norm.Z) { return(Coordinate.UnitX); } if (norm.Y >= norm.Z) { return(Coordinate.UnitY); } return(Coordinate.UnitZ); }
/// <summary> /// Gets the axis closest to the normal of this plane /// </summary> /// <returns>Vector3.UnitX, Vector3.UnitY, or Vector3.UnitZ depending on the plane's normal</returns> public Vector3 GetClosestAxisToNormal() { // VHE prioritises the axes in order of X, Y, Z. Vector3 norm = Normal.Absolute(); if (norm.X >= norm.Y && norm.X >= norm.Z) { return(Vector3.UnitX); } if (norm.Y >= norm.Z) { return(Vector3.UnitY); } return(Vector3.UnitZ); }