Normand Briere
2019-10-01 e8908d5b90d44e43b9da885bc0202fb665a912d0
cVector.java
....@@ -63,6 +63,15 @@
6363 }
6464 }
6565
66
+ cVector ToFloat()
67
+ {
68
+ x = (float)x;
69
+ y = (float)y;
70
+ z = (float)z;
71
+
72
+ return this;
73
+ }
74
+
6675 void set(cVector v)
6776 {
6877 x = v.x;
....@@ -247,18 +256,21 @@
247256 return "[" + x0 + ", " + y0 + ", " + z0 + "]";
248257 }
249258
250
- /*
251259 public boolean equals(Object o)
252260 {
253261 //if (true) return false;
254262
255263 cVector vert = (cVector) o;
256264
265
+ double tolerance = 0.00001;
266
+
267
+ if (!Grafreed.epsequal)
268
+ tolerance = 0;
269
+
257270 return Math.abs(x - vert.x) +
258271 Math.abs(y - vert.y) +
259
- Math.abs(z - vert.z) < 0.01;
272
+ Math.abs(z - vert.z) <= tolerance;
260273 }
261
- */
262274
263275 public int hashCode()
264276 {
....@@ -266,7 +278,7 @@
266278 long ly = Double.doubleToRawLongBits(y);
267279 long lz = Double.doubleToRawLongBits(z);
268280
269
- if (GraphreeD.epsequal)
281
+ if (Grafreed.epsequal)
270282 {
271283 return 0;
272284 } else