public void rotate(Vector3 v) { double ts = -this.x * v.x - this.y * v.y - this.z * v.z; double tx = this.s * v.x + this.y * v.z - this.z * v.y; double ty = this.s * v.y - this.x * v.z + this.z * v.x; double tz = this.s * v.z + this.x * v.y - this.y * v.x; v.x = (tx * this.s - ts * this.x - ty * this.z + tz * this.y); v.y = (ty * this.s - ts * this.y + tx * this.z - tz * this.x); v.z = (tz * this.s - ts * this.z - tx * this.y + ty * this.x); }
public final void setPosition(final float _x, final float _y, final float _z) { position.x = _x; position.y = _y; position.z = _z; }
public final void addToPosition(final float _x, final float _y, final float _z) { position.x += _x; position.y += _y; position.z += _z; }
public Vector3 add(Vector3 v) { return new Vector3(x() + v.x(), y() + v.y(), z() + v.z()); }