/* */ package NET.worlds.scape; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class Point3Temp /* */ { /* */ public float x; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public float y; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public float z; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 39 */ private static Recycler recycler = new Recycler(); /* */ /* */ static /* */ { /* 43 */ nativeInit(); /* */ } /* */ /* */ public static native void nativeInit(); /* */ /* */ public static Point3Temp make(float x, float y, float z) /* */ { /* 50 */ Point3Temp p = (Point3Temp)recycler.alloc(); /* 51 */ if (p == null) /* */ { /* 53 */ recycler.recycle(new Point3Temp(0)); /* 54 */ p = (Point3Temp)recycler.alloc(); /* */ } /* */ /* 57 */ p.x = x; /* 58 */ p.y = y; /* 59 */ p.z = z; /* */ /* 61 */ return p; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ public static Point3Temp make() /* */ { /* 70 */ return make(0.0F, 0.0F, 0.0F); /* */ } /* */ /* */ /* */ /* */ /* */ public static Point3Temp make(Point3Temp p) /* */ { /* 78 */ return make(p.x, p.y, p.z); /* */ } /* */ /* */ /* */ /* */ /* */ protected Point3Temp(int dummy) {} /* */ /* */ /* */ /* */ public Point3Temp copy(Point3Temp b) /* */ { /* 90 */ set(b.x, b.y, b.z); /* 91 */ return this; /* */ } /* */ /* */ public void set(float _x, float _y, float _z) { /* 95 */ this.x = _x; /* 96 */ this.y = _y; /* 97 */ this.z = _z; /* */ } /* */ /* */ /* */ /* */ /* */ public float length() /* */ { /* 105 */ return (float)Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); /* */ } /* */ /* */ public float squaredLength() /* */ { /* 110 */ return this.x * this.x + this.y * this.y + this.z * this.z; /* */ } /* */ /* */ /* */ /* */ /* */ public native Point3Temp times(Transform paramTransform); /* */ /* */ /* */ /* */ /* */ public native Point3Temp vectorTimes(Transform paramTransform); /* */ /* */ /* */ /* */ /* */ public Point3Temp normalize() /* */ { /* 128 */ float len = length(); /* 129 */ if (len > 0.0F) { /* 130 */ dividedBy(len); /* */ } /* 132 */ return this; /* */ } /* */ /* */ /* */ /* */ /* */ public Point3Temp negate() /* */ { /* 140 */ this.x = (-this.x); /* 141 */ this.y = (-this.y); /* 142 */ this.z = (-this.z); /* */ /* 144 */ return this; /* */ } /* */ /* */ /* */ /* */ /* */ public Point3Temp abs() /* */ { /* 152 */ this.x = Math.abs(this.x); /* 153 */ this.y = Math.abs(this.y); /* 154 */ this.z = Math.abs(this.z); /* */ /* 156 */ return this; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static Point3Temp getDirVector(float amount, float angle) /* */ { /* 166 */ angle = (float)(angle * 0.017453292519943295D); /* 167 */ return make(-amount * (float)Math.sin(angle), /* 168 */ amount * (float)Math.cos(angle), /* 169 */ 0.0F); /* */ } /* */ /* */ /* */ public Point3Temp plus(Point3Temp p) /* */ { /* 175 */ this.x += p.x; /* 176 */ this.y += p.y; /* 177 */ this.z += p.z; /* */ /* 179 */ return this; /* */ } /* */ /* */ /* */ public Point3Temp cross(Point3Temp p) /* */ { /* 185 */ float xNew = this.y * p.z - this.z * p.y; /* 186 */ float yNew = this.z * p.x - this.x * p.z; /* 187 */ this.z = (this.x * p.y - this.y * p.x); /* 188 */ this.x = xNew; /* 189 */ this.y = yNew; /* */ /* 191 */ return this; /* */ } /* */ /* */ /* */ public Point3Temp plus(float v) /* */ { /* 197 */ this.x += v; /* 198 */ this.y += v; /* 199 */ this.z += v; /* */ /* 201 */ return this; /* */ } /* */ /* */ /* */ public Point3Temp minus(float v) /* */ { /* 207 */ return plus(-v); /* */ } /* */ /* */ /* */ public Point3Temp minus(Point3Temp p) /* */ { /* 213 */ this.x -= p.x; /* 214 */ this.y -= p.y; /* 215 */ this.z -= p.z; /* */ /* 217 */ return this; /* */ } /* */ /* */ /* */ public Point3Temp times(float v) /* */ { /* 223 */ this.x *= v; /* 224 */ this.y *= v; /* 225 */ this.z *= v; /* */ /* 227 */ return this; /* */ } /* */ /* */ /* */ public Point3Temp times(Point3Temp p) /* */ { /* 233 */ this.x *= p.x; /* 234 */ this.y *= p.y; /* 235 */ this.z *= p.z; /* */ /* 237 */ return this; /* */ } /* */ /* */ /* */ public Point3Temp dividedBy(float v) /* */ { /* 243 */ this.x /= v; /* 244 */ this.y /= v; /* 245 */ this.z /= v; /* */ /* 247 */ return this; /* */ } /* */ /* */ /* */ public Point3Temp dividedBy(Point3Temp p) /* */ { /* 253 */ this.x /= p.x; /* 254 */ this.y /= p.y; /* 255 */ this.z /= p.z; /* */ /* 257 */ return this; /* */ } /* */ /* */ /* */ public float dot(Point3Temp p) /* */ { /* 263 */ return p.x * this.x + p.y * this.y + p.z * this.z; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public float det(Point3Temp a, Point3Temp b) /* */ { /* 273 */ return this.x * a.y * b.z + a.x * b.y * this.z + b.x * this.y * a.z - /* 274 */ this.z * a.y * b.x - a.z * b.y * this.x - b.z * this.y * a.x; /* */ } /* */ /* */ /* */ /* */ /* */ public boolean sameValue(Point3Temp p) /* */ { /* 282 */ if (p == null) { /* 283 */ return false; /* */ } /* 285 */ return (this.x == p.x) && (this.y == p.y) && (this.z == p.z); /* */ } /* */ /* */ public String toString() /* */ { /* 290 */ return this.x + "," + this.y + "," + this.z; /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\Point3Temp.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */