/** * Used to set focused stroke color vector. * * @param r red value. * @param g green value. * @param b blue value. * @param a alpha value. */ public void setFocusedStrokeColor(float r, float g, float b, float a) { focusedStrokeColor.set(r, g, b, a); }
/** * Used to set background color vector. * * @param r red value. * @param g green value. * @param b blue value. * @param a alpha value. */ public void setColor(float r, float g, float b, float a) { color.set(r, g, b, a); }
/** * Read this vector from the supplied {@link FloatBuffer} at the current * buffer {@link FloatBuffer#position() position}. * <p> * This method will not increment the position of the given FloatBuffer. * <p> * In order to specify the offset into the FloatBuffer at which * the vector is read, use {@link #set(int, FloatBuffer)}, taking * the absolute position as parameter. * * @param buffer * values will be read in <code>x, y, z, w</code> order * @return this * @see #set(int, FloatBuffer) */ public Vector4f set(FloatBuffer buffer) { return set(buffer.position(), buffer); }
/** * Read this vector from the supplied {@link ByteBuffer} at the current * buffer {@link ByteBuffer#position() position}. * <p> * This method will not increment the position of the given ByteBuffer. * <p> * In order to specify the offset into the ByteBuffer at which * the vector is read, use {@link #set(int, ByteBuffer)}, taking * the absolute position as parameter. * * @param buffer * values will be read in <code>x, y, z, w</code> order * @return this * @see #set(int, ByteBuffer) */ public Vector4f set(ByteBuffer buffer) { return set(buffer.position(), buffer); }
/** * Read this vector from the supplied {@link FloatBuffer} at the current * buffer {@link FloatBuffer#position() position}. * <p> * This method will not increment the position of the given FloatBuffer. * <p> * In order to specify the offset into the FloatBuffer at which * the vector is read, use {@link #set(int, FloatBuffer)}, taking * the absolute position as parameter. * * @param buffer * values will be read in <code>x, y, z, w</code> order * @return this * @see #set(int, FloatBuffer) */ public Vector4f set(FloatBuffer buffer) { return set(buffer.position(), buffer); }
/** * Used to copy provided text state to current state. * * @param state state to copy. */ public void copy(TextState state) { this.setText(state.getText()); this.font = state.font; this.fontSize = state.fontSize; this.setText(state.text); this.horizontalAlign = state.horizontalAlign; this.verticalAlign = state.verticalAlign; this.textColor.set(state.textColor); this.highlightColor.set(state.highlightColor); }
/** * Used to create negative color and set it to dest. Alpha value will be the same as in source color. * * @param color color to negotiate. * @param dest target color object to set. */ public static void negativeColor(Vector4f color, Vector4f dest) { dest.zero().set(1).sub(color); dest.w = color.w; }
/** * Used to create negative color and set it to dest. Alpha value will be setted to 1. * * @param color color to negotiate. * @param dest target color object to set. * * @return destination color filled with negative color. */ public static Vector4f negativeColorRGB(Vector4f color, Vector4f dest) { dest.zero().set(1).sub(color); dest.w = 1; return dest; }
/** * Sets the first two components of this to the components of given <code>v</code> * and last two components to the given <code>z</code>, and <code>w</code>. * * @param v * the {@link Vector2fc} * @param z * the z component * @param w * the w component * @return this */ public Vector4f set(Vector2fc v, float z, float w) { return set(v.x(), v.y(), z, w); }
/** * Sets the first two components of this to the components of given <code>v</code> * and last two components to the given <code>z</code>, and <code>w</code>. * * @param v * the {@link Vector2ic} * @param z * the z component * @param w * the w component * @return this */ public Vector4f set(Vector2ic v, float z, float w) { return set(v.x(), v.y(), z, w); }
/** * Sets the first two components of this to the components of given <code>v</code> * and last two components to the given <code>z</code>, and <code>w</code>. * * @param v * the {@link Vector2fc} * @param z * the z component * @param w * the w component * @return this */ public Vector4f set(Vector2fc v, float z, float w) { return set(v.x(), v.y(), z, w); }
/** * Sets the first two components of this to the components of given <code>v</code> * and last two components to the given <code>z</code>, and <code>w</code>. * * @param v * the {@link Vector2ic} * @param z * the z component * @param w * the w component * @return this */ public Vector4f set(Vector2ic v, float z, float w) { return set(v.x(), v.y(), z, w); }
/** * Set the first three components of this to the components of * <code>v</code> and the last component to <code>w</code>. * * @param v * the {@link Vector3ic} to copy * @param w * the w component * @return this */ public Vector4f set(Vector3ic v, float w) { return set(v.x(), v.y(), v.z(), w); }
/** * Set the first three components of this to the components of * <code>v</code> and the last component to <code>w</code>. * * @param v * the {@link Vector3fc} to copy * @param w * the w component * @return this */ public Vector4f set(Vector3fc v, float w) { return set(v.x(), v.y(), v.z(), w); }
/** * Set the first three components of this to the components of * <code>v</code> and the last component to <code>w</code>. * * @param v * the {@link Vector3ic} to copy * @param w * the w component * @return this */ public Vector4f set(Vector3ic v, float w) { return set(v.x(), v.y(), v.z(), w); }
/** * Set the first three components of this to the components of * <code>v</code> and the last component to <code>w</code>. * * @param v * the {@link Vector3fc} to copy * @param w * the w component * @return this */ public Vector4f set(Vector3fc v, float w) { return set(v.x(), v.y(), v.z(), w); }
/** * Set this {@link Vector4f} to the values of the given <code>v</code>. * * @param v * the vector whose values will be copied into this * @return this */ public Vector4f set(Vector4ic v) { return set(v.x(), v.y(), v.z(), v.w()); }
/** * Set this {@link Vector4f} to the values of the given <code>v</code>. * * @param v * the vector whose values will be copied into this * @return this */ public Vector4f set(Vector4ic v) { return set(v.x(), v.y(), v.z(), v.w()); }
/** * Set this {@link Vector4f} to the values of the given <code>v</code>. * <p> * Note that due to the given vector <code>v</code> storing the components in double-precision, * there is the possibility to lose precision. * * @param v * the vector whose values will be copied into this * @return this */ public Vector4f set(Vector4dc v) { return set((float) v.x(), (float) v.y(), (float) v.z(), (float) v.w()); }
/** * Set this {@link Vector4f} to the values of the given <code>v</code>. * <p> * Note that due to the given vector <code>v</code> storing the components in double-precision, * there is the possibility to lose precision. * * @param v * the vector whose values will be copied into this * @return this */ public Vector4f set(Vector4dc v) { return set((float) v.x(), (float) v.y(), (float) v.z(), (float) v.w()); }