/** Cube Monster by Eduardo Omine [2008-11-16] http://blog.omine.net/ */ class Vec3 { float x, y, z; Vec3() { set(0, 0, 0); } Vec3(float x, float y, float z) { set(x, y, z); } Vec3(Vec2 v) { set(v); } void set(float x, float y, float z) { this.x = x; this.y = y; this.z = z; } void set(Vec3 v) { this.x = v.x; this.y = v.y; this.z = v.z; } void set(Vec2 v) { this.x = v.x; this.y = v.y; this.z = 0; } void add(float x, float y, float z) { this.x += x; this.y += y; this.z += z; } void add(Vec3 v) { this.x += v.x; this.y += v.y; this.z += v.z; } void mult(float f) { this.x *= f; this.y *= f; this.z *= f; } void rand(float a, float b) { this.x = random(a, b); this.y = random(a, b); this.z = random(a, b); } void addRand(float a, float b) { this.x += random(a, b); this.y += random(a, b); this.z += random(a, b); } }