/** * @param x * @param y * @param z * @param w * @return the dot product of this vector with the given x, y, z, w values. */ @Override public double dot(final double x, final double y, final double z, final double w) { return getX() * x + getY() * y + getZ() * z + getW() * w; }
/** * @return the string representation of this vector. */ @Override public String toString() { return "com.ardor3d.math.Vector4 [X=" + getX() + ", Y=" + getY() + ", Z=" + getZ() + ", W=" + getW() + "]"; }
/** * @param x * @param y * @param z * @param w * @return the dot product of this vector with the given x, y, z, w values. */ @Override public double dot(final double x, final double y, final double z, final double w) { return getX() * x + getY() * y + getZ() * z + getW() * w; }
/** * Increments the values of this vector with the given x, y, z and w values. * * @param x * @param y * @param z * @param w * @return this vector for chaining */ public Vector4 addLocal(final double x, final double y, final double z, final double w) { return set(getX() + x, getY() + y, getZ() + z, getW() + w); }
/** * Internally modifies the values of this vector by multiplying them each by the given scalar value. * * @param scalar * @return this vector for chaining */ public Vector4 multiplyLocal(final double scalar) { return set(getX() * scalar, getY() * scalar, getZ() * scalar, getW() * scalar); }
/** * Decrements the values of this vector by the given x, y, z and w values. * * @param x * @param y * @param z * @param w * @return this vector for chaining */ public Vector4 subtractLocal(final double x, final double y, final double z, final double w) { return set(getX() - x, getY() - y, getZ() - z, getW() - w); }
/** * Internally modifies the values of this vector by multiplying them each by the given scalar value. * * @param scalar * @return this vector for chaining */ public Vector4 multiplyLocal(final double scalar) { return set(getX() * scalar, getY() * scalar, getZ() * scalar, getW() * scalar); }
/** * Internally modifies the values of this vector by multiplying them each by the given scale values. * * @param x * @param y * @param z * @param w * @return this vector for chaining */ public Vector4 multiplyLocal(final double x, final double y, final double z, final double w) { return set(getX() * x, getY() * y, getZ() * z, getW() * w); }
/** * Internally modifies the values of this vector by dividing them each by the given scale values. * * @param x * @param y * @param z * @param w * @return this vector for chaining */ public Vector4 divideLocal(final double x, final double y, final double z, final double w) { return set(getX() / x, getY() / y, getZ() / z, getW() / w); }
/** * Increments the values of this vector with the given x, y, z and w values. * * @param x * @param y * @param z * @param w * @return this vector for chaining */ public Vector4 addLocal(final double x, final double y, final double z, final double w) { return set(getX() + x, getY() + y, getZ() + z, getW() + w); }
/** * Internally modifies the values of this vector by multiplying them each by the given scale values. * * @param x * @param y * @param z * @param w * @return this vector for chaining */ public Vector4 multiplyLocal(final double x, final double y, final double z, final double w) { return set(getX() * x, getY() * y, getZ() * z, getW() * w); }
private void getWorldIntersection(final double planeHeight, final ReadOnlyVector2 screenPosition, final ReadOnlyMatrix4 modelViewProjectionInverseMatrix, final Vector3 store) { calculateIntersection(planeHeight, screenPosition, modelViewProjectionInverseMatrix); store.set(origin.getX(), origin.getY(), origin.getZ()).divideLocal(origin.getW()); }
private void getWorldIntersection(final double planeHeight, final ReadOnlyVector2 screenPosition, final ReadOnlyMatrix4 modelViewProjectionInverseMatrix, final Vector3 store) { calculateIntersection(planeHeight, screenPosition, modelViewProjectionInverseMatrix); store.set(origin.getX(), origin.getY(), origin.getZ()).divideLocal(origin.getW()); }
@Override public void write(final OutputCapsule capsule) throws IOException { capsule.write(getX(), "x", 0); capsule.write(getY(), "y", 0); capsule.write(getZ(), "z", 0); capsule.write(getW(), "w", 0); }
/** * Internally modifies the values of this vector by dividing them each by the given scale values. * * @param scale * @return this vector for chaining */ public Vector4 divideLocal(final ReadOnlyVector4 scale) { return set(getX() / scale.getX(), getY() / scale.getY(), getZ() / scale.getZ(), getW() / scale.getW()); }
/** * Internally modifies the values of this vector by dividing them each by the given scale values. * * @param scale * @return this vector for chaining */ public Vector4 divideLocal(final ReadOnlyVector4 scale) { return set(getX() / scale.getX(), getY() / scale.getY(), getZ() / scale.getZ(), getW() / scale.getW()); }
/** * Internally modifies the values of this vector by multiplying them each by the given scale values. * * @param scale * @return this vector for chaining */ public Vector4 multiplyLocal(final ReadOnlyVector4 scale) { return set(getX() * scale.getX(), getY() * scale.getY(), getZ() * scale.getZ(), getW() * scale.getW()); }
/** * Internally modifies the values of this vector by multiplying them each by the given scale values. * * @param scale * @return this vector for chaining */ public Vector4 multiplyLocal(final ReadOnlyVector4 scale) { return set(getX() * scale.getX(), getY() * scale.getY(), getZ() * scale.getZ(), getW() * scale.getW()); }