Advertisement
movethebongos

AlmostEqual

Aug 22nd, 2017
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.28 KB | None | 0 0
  1. public static bool AlmostEqual(Vector3 v1, Vector3 v2, float precision)
  2. {
  3.     bool equal = true;
  4.     if (Mathf.Abs(v1.x - v2.x) > precision) equal = false;
  5.     if (Mathf.Abs(v1.y - v2.y) > precision) equal = false;
  6.     if (Mathf.Abs(v1.z - v2.z) > precision) equal = false;
  7.     return equal;
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement