/** * Sets the value of this vector to (0, 0) * * @return this vector for chaining */ public Vector2 zero() { return set(0, 0); }
/** */ protected void calculateAlignmentOffset() { _alignOffset.set(0, 0); if (_align != null) { _alignOffset.setX(_size.getX() * _align.horizontal); _alignOffset.setY(_size.getY() * _align.vertical); } }
/** * @param nearOpaque * text is completely opaque when distance between camera and text is less than this value * @param farTransparent * text is completely transparent when distance between camera and text is greater than this value */ public void setAutoFadeDistanceRange(final double nearOpaque, final double farTransparent) { _distanceAlphaRange.set(nearOpaque, farTransparent); }
/** * @param nearOpaque * text is completely opaque when distance between camera and text is less than this value * @param farTransparent * text is completely transparent when distance between camera and text is greater than this value */ public void setAutoFadeDistanceRange(final double nearOpaque, final double farTransparent) { _distanceAlphaRange.set(nearOpaque, farTransparent); }
/** * Increments the values of this vector with the given x and y values. * * @param x * @param y * @return this vector for chaining */ public Vector2 addLocal(final double x, final double y) { return set(getX() + x, getY() + y); }
/** * Decrements the values of this vector by the given x and y values. * * @param x * @param y * @return this vector for chaining */ public Vector2 subtractLocal(final double x, final double y) { return set(getX() - x, getY() - y); }
/** * Internally modifies the values of this vector by dividing them each by the values of the given scale. * * @param x * @param y * @return this vector for chaining */ public Vector2 divideLocal(final double x, final double y) { return set(getX() / x, getY() / y); }
/** * Internally modifies the values of this vector by multiplying them each by the given scalar value. * * @param scalar * @return this vector for chaining */ public Vector2 multiplyLocal(final double scalar) { return set(getX() * scalar, getY() * scalar); }
/** * Internally modifies the values of this vector by multiplying them each by the values of the given scale. * * @param x * @param y * @return this vector for chaining */ public Vector2 multiplyLocal(final double x, final double y) { return set(getX() * x, getY() * y); }
/** * Decrements the values of this vector by the given x and y values. * * @param x * @param y * @return this vector for chaining */ public Vector2 subtractLocal(final double x, final double y) { return set(getX() - x, getY() - y); }
/** * Internally modifies the values of this vector by dividing them each by the given scalar value. * * @param scalar * @return this vector for chaining * @throws ArithmeticException * if scalar is 0 */ public Vector2 divideLocal(final double scalar) { final double invScalar = 1.0 / scalar; return set(getX() * invScalar, getY() * invScalar); }
/** * Internally modifies the values of this vector by dividing them each by the values of the given scale. * * @param x * @param y * @return this vector for chaining */ public Vector2 divideLocal(final double x, final double y) { return set(getX() / x, getY() / y); }
@Override public Vector2 get2DPoint(final ReadOnlyVector3 worldLocation, final Vector2 store) { final Vector2 rVal = store != null ? store : new Vector2(); return rVal.set(worldLocation.getX(), worldLocation.getZ()); } }
/** * set a fixed offset from the alignment center of rotation IN FONT UNITS */ public void setFixedOffset(double x, double y) { x *= _font.getSize(); y *= _font.getSize(); _fixedOffset.set(x, y); setText(_textString); }
@Override public Vector2 get2DPoint(final ReadOnlyVector3 worldLocation, final Vector2 store) { final Vector2 rVal = store != null ? store : new Vector2(); return rVal.set(worldLocation.getX(), worldLocation.getY()); } }
/** * Internally modifies the values of this vector by multiplying them each by the values of the given scale. * * @param scale * @return this vector for chaining */ public Vector2 multiplyLocal(final ReadOnlyVector2 scale) { return set(getX() * scale.getX(), getY() * scale.getY()); }
/** * Internally modifies the values of this vector by dividing them each by the values of the given scale. * * @param scale * @return this vector for chaining */ public Vector2 divideLocal(final ReadOnlyVector2 scale) { return set(getX() / scale.getX(), getY() / scale.getY()); }
/** * Internally modifies the values of this vector by multiplying them each by the values of the given scale. * * @param scale * @return this vector for chaining */ public Vector2 multiplyLocal(final ReadOnlyVector2 scale) { return set(getX() * scale.getX(), getY() * scale.getY()); }
/** * set a fixed offset from the alignment center of rotation IN FONT UNITS */ public void setFixedOffset(final Vector2 offset) { final double x = offset.getX() * _font.getSize(); final double y = offset.getY() * _font.getSize(); _fixedOffset.set(x, y); setText(_textString); }
/** * set a fixed offset from the alignment center of rotation IN FONT UNITS */ public void setFixedOffset(final ReadOnlyVector2 offset) { final double x = offset.getX() * _font.getSize(); final double y = offset.getY() * _font.getSize(); _fixedOffset.set(x, y); setText(_textString); }