/** * Create a new {@link Vector3i} with the same values as <code>v</code>. * * @param v * the {@link Vector3ic} to copy the values from */ public Vector3i(Vector3ic v) { this(v.x(), v.y(), v.z()); }
/** * Create a new {@link Vector4f} with the first three components from the * given <code>v</code> and the given <code>w</code>. * * @param v * the {@link Vector3ic} * @param w * the w component */ public Vector4f(Vector3ic v, float w) { this(v.x(), v.y(), v.z(), w); }
/** * Create a new {@link Vector3d} whose values will be copied from the given vector. * * @param v * provides the initial values for the new vector */ public Vector3d(Vector3ic v) { this(v.x(), v.y(), v.z()); }
/** * Create a new {@link Vector4d} with the first three components from the * given <code>v</code> and the given <code>w</code>. * * @param v * the {@link Vector3ic} * @param w * the w component */ public Vector4d(Vector3ic v, double w) { this(v.x(), v.y(), v.z(), w); }
/** * Create a new {@link Vector3f} with the same values as <code>v</code>. * * @param v * the {@link Vector3ic} to copy the values from */ public Vector3f(Vector3ic v) { this(v.x(), v.y(), v.z()); }
public Vector3i sub(Vector3ic v, Vector3i dest) { dest.x = x - v.x(); dest.y = y - v.y(); dest.z = z - v.z(); return dest; }
/** * Create a new {@link Vector3i} with the same values as <code>v</code>. * * @param v * the {@link Vector3ic} to copy the values from */ public Vector3i(Vector3ic v) { this(v.x(), v.y(), v.z()); }
public Vector3i sub(Vector3ic v, Vector3i dest) { dest.x = x - v.x(); dest.y = y - v.y(); dest.z = z - v.z(); return dest; }
/** * Create a new {@link Vector4i} with the first three components from the * given <code>v</code> and the given <code>w</code>. * * @param v * the {@link Vector3ic} * @param w * the w component */ public Vector4i(Vector3ic v, int w) { this(v.x(), v.y(), v.z(), w); }
public Vector3i add(Vector3ic v, Vector3i dest) { dest.x = x + v.x(); dest.y = y + v.y(); dest.z = z + v.z(); return dest; }
public Vector3i mul(Vector3ic v, Vector3i dest) { dest.x = x * v.x(); dest.y = y * v.y(); dest.z = z * v.z(); return dest; }
/** * Set the x, y and z components to match the supplied vector. * * @param v * the vector to set this vector's components from * @return this */ public Vector3d set(Vector3ic v) { return set(v.x(), v.y(), v.z()); }
/** * Set the x, y and z components to match the supplied vector. * * @param v * contains the values of x, y and z to set * @return this */ public Vector3f set(Vector3ic v) { return set(v.x(), v.y(), v.z()); }
/** * Multiply all components of this {@link Vector3i} by the given vector. * * @param v * the vector to multiply * @return a vector holding the result */ public Vector3i mul(Vector3ic v) { return mul(v.x(), v.y(), v.z(), thisOrNew()); }
/** * Subtract the supplied vector from this one and store the result in * <code>this</code>. * * @param v * the vector to subtract * @return a vector holding the result */ public Vector3i sub(Vector3ic v) { return sub(v.x(), v.y(), v.z(), thisOrNew()); }
/** * Add the supplied vector to this one. * * @param v * the vector to add * @return a vector holding the result */ public Vector3i add(Vector3ic v) { return add(v.x(), v.y(), v.z(), thisOrNew()); }
/** * (non-Javadoc) * @see org.joml.Vector3ic#gridDistance(org.joml.Vector3ic) */ public long gridDistance(Vector3ic v) { return Math.abs(v.x() - x()) + Math.abs(v.y() - y()) + Math.abs(v.z() - z()); }