/** * Sets the value of this quaternion to (x, y, z, w) * * @param x * @param y * @param z * @param w * @return this quaternion for chaining */ public Quaternion set(final double x, final double y, final double z, final double w) { setX(x); setY(y); setZ(z); setW(w); return this; }
/** * Sets the value of this quaternion to (x, y, z, w) * * @param x * @param y * @param z * @param w * @return this quaternion for chaining */ public Quaternion set(final double x, final double y, final double z, final double w) { setX(x); setY(y); setZ(z); setW(w); return this; }
@Override public void read(final InputCapsule capsule) throws IOException { setX(capsule.readDouble("x", 0)); setY(capsule.readDouble("y", 0)); setZ(capsule.readDouble("z", 0)); setW(capsule.readDouble("w", 1)); }
@Override public void read(final InputCapsule capsule) throws IOException { setX(capsule.readDouble("x", 0)); setY(capsule.readDouble("y", 0)); setZ(capsule.readDouble("z", 0)); setW(capsule.readDouble("w", 1)); }
/** * Multiplies each value of this quaternion by the given scalar value. The result is stored in this quaternion. * * @param scalar * the quaternion to multiply this quaternion by. * @return this quaternion for chaining. */ public Quaternion multiplyLocal(final double scalar) { setX(getX() * scalar); setY(getY() * scalar); setZ(getZ() * scalar); setW(getW() * scalar); return this; }
/** * Sets the value of this quaternion to the (x, y, z, w) values of the provided source quaternion. * * @param source * @return this quaternion for chaining * @throws NullPointerException * if source is null. */ public Quaternion set(final ReadOnlyQuaternion source) { setX(source.getX()); setY(source.getY()); setZ(source.getZ()); setW(source.getW()); return this; }
/** * Multiplies each value of this quaternion by the given scalar value. The result is stored in this quaternion. * * @param scalar * the quaternion to multiply this quaternion by. * @return this quaternion for chaining. */ public Quaternion multiplyLocal(final double scalar) { setX(getX() * scalar); setY(getY() * scalar); setZ(getZ() * scalar); setW(getW() * scalar); return this; }
/** * Used with serialization. Not to be called manually. * * @param in * ObjectInput * @throws IOException * @throws ClassNotFoundException */ @Override public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { setX(in.readDouble()); setY(in.readDouble()); setZ(in.readDouble()); setW(in.readDouble()); }
/** * Sets the value of this quaternion to the (x, y, z, w) values of the provided source quaternion. * * @param source * @return this quaternion for chaining * @throws NullPointerException * if source is null. */ public Quaternion set(final ReadOnlyQuaternion source) { setX(source.getX()); setY(source.getY()); setZ(source.getZ()); setW(source.getW()); return this; }
/** * Used with serialization. Not to be called manually. * * @param in * ObjectInput * @throws IOException * @throws ClassNotFoundException */ @Override public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException { setX(in.readDouble()); setY(in.readDouble()); setZ(in.readDouble()); setW(in.readDouble()); }
/** * Internally increments the fields of this quaternion with the field values of the given quaternion. * * @param quat * @return this quaternion for chaining */ public Quaternion addLocal(final ReadOnlyQuaternion quat) { setX(getX() + quat.getX()); setY(getY() + quat.getY()); setZ(getZ() + quat.getZ()); setW(getW() + quat.getW()); return this; }
/** * Internally decrements the fields of this quaternion by the field values of the given quaternion. * * @param quat * @return this quaternion for chaining. */ public Quaternion subtractLocal(final ReadOnlyQuaternion quat) { setX(getX() - quat.getX()); setY(getY() - quat.getY()); setZ(getZ() - quat.getZ()); setW(getW() - quat.getW()); return this; }
/** * Internally increments the fields of this quaternion with the field values of the given quaternion. * * @param quat * @return this quaternion for chaining */ public Quaternion addLocal(final ReadOnlyQuaternion quat) { setX(getX() + quat.getX()); setY(getY() + quat.getY()); setZ(getZ() + quat.getZ()); setW(getW() + quat.getW()); return this; }
/** * Internally decrements the fields of this quaternion by the field values of the given quaternion. * * @param quat * @return this quaternion for chaining. */ public Quaternion subtractLocal(final ReadOnlyQuaternion quat) { setX(getX() - quat.getX()); setY(getY() - quat.getY()); setZ(getZ() - quat.getZ()); setW(getW() - quat.getW()); return this; }
assertFalse(quat.equals(comp)); assertFalse(quat.strictEquals(comp)); comp.setZ(2); assertFalse(quat.equals(comp)); assertFalse(quat.strictEquals(comp));