| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 877ab36 commit c84a5a5
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -926,9 +926,9 @@ public void lerp(float x, float y, float z, float amt) { | |||
| 926 | 926 | static public float angleBetween(PVector v1, PVector v2) { | |
| 927 | 927 | ||
| 928 | 928 | // We get NaN if we pass in a zero vector which can cause problems | |
| 929 | - // Zero seems like a reasonable angle between a (0,0) vector and something else | ||
| 930 | - if (v1.x == 0 && v1.y == 0) return 0.0f; | ||
| 931 | - if (v2.x == 0 && v2.y == 0) return 0.0f; | ||
| 929 | + // Zero seems like a reasonable angle between a (0,0,0) vector and something else | ||
| 930 | + if (v1.x == 0 && v1.y == 0 && v1.z == 0 ) return 0.0f; | ||
| 931 | + if (v2.x == 0 && v2.y == 0 && v2.z == 0 ) return 0.0f; | ||
| 932 | 932 | ||
| 933 | 933 | double dot = v1.x * v2.x + v1.y * v2.y + v1.z * v2.z; | |
| 934 | 934 | double v1mag = Math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z); | |
@@ -994,4 +994,4 @@ public int hashCode() { | |||
| 994 | 994 | result = 31 * result + Float.floatToIntBits(z); | |
| 995 | 995 | return result; | |
| 996 | 996 | } | |
| 997 | - } | ||
| 997 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments