This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Sync Issue - Tuple3f.java

By: lukejessee on Jun 13th, 2012  |  syntax: Java  |  size: 0.71 KB  |  views: 82  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class Tuple3f {
  2.         public float x;
  3.         public float y;
  4.         public float z;
  5.  
  6.         public Tuple3f() {
  7.                 this.x = 1;
  8.                 this.y = 0;
  9.                 this.z = 0;
  10.         }
  11.  
  12.         public boolean equals(Object t1) {
  13.                 try {
  14.                         Tuple3f t2 = (Tuple3f) t1;
  15.                         return (this.x == t2.x && this.y == t2.y && this.z == t2.z);
  16.                 } catch (NullPointerException e2) {
  17.                         return false;
  18.                 } catch (ClassCastException e1) {
  19.                         return false;
  20.                 }
  21.         }
  22.  
  23.         public int hashCode() {
  24.                 long bits = 1L;
  25.                 bits = 31L * bits + (long) ((x == 0) ? 0l : Float.floatToIntBits(x));
  26.                 bits = 31L * bits + (long) ((y == 0) ? 0l : Float.floatToIntBits(y));
  27.                 bits = 31L * bits + (long) ((z == 0) ? 0l : Float.floatToIntBits(z));
  28.                 return (int) (bits ^ (bits >> 32));
  29.         }
  30. }
clone this paste RAW Paste Data