public Vector4f transform(float x, float y, float z, float w, Vector4f dest) { dest.x = x; dest.y = y; dest.z = z; dest.w = w; return dest.mul(this); }
public Vector4f transform(float x, float y, float z, float w, Vector4f dest) { dest.x = x; dest.y = y; dest.z = z; dest.w = w; return dest.mul(this); }
public Vector4f transform(Vector4f v) { return v.mul(this); }
public Vector4f transform(Vector4f v) { return v.mul(this); }
public Vector4f transform(Vector4f v) { return v.mul(this); }
public Vector4f transform(Vector4f v) { return v.mul(this); }
/** * Multiply the given matrix mat with this Vector4f and store the result in * <code>this</code>. * * @param mat * the matrix to multiply the vector with * @return a vector holding the result */ public Vector4f mul(Matrix4fc mat) { return mul(mat, thisOrNew()); }
/** * Multiply this Vector4f component-wise by another Vector4f. * * @param v * the other vector * @return a vector holding the result */ public Vector4f mul(Vector4fc v) { return mul(v, thisOrNew()); }
/** * Multiply the given matrix mat with this Vector4f and store the result in * <code>this</code>. * * @param mat * the matrix to multiply the vector with * @return a vector holding the result */ public Vector4f mul(Matrix4x3fc mat) { return mul(mat, thisOrNew()); }
/** * Multiply this Vector4f component-wise by another Vector4f. * * @param v * the other vector * @return a vector holding the result */ public Vector4f mul(Vector4fc v) { return mul(v, thisOrNew()); }
/** * Multiply the given matrix mat with this Vector4f and store the result in * <code>this</code>. * * @param mat * the matrix to multiply the vector with * @return a vector holding the result */ public Vector4f mul(Matrix4x3fc mat) { return mul(mat, thisOrNew()); }
/** * Multiply all components of this {@link Vector4f} by the given scalar * value. * * @param scalar * the scalar to multiply by * @return a vector holding the result */ public Vector4f mul(float scalar) { return mul(scalar, thisOrNew()); }
/** * Multiply the given matrix mat with this Vector4f and store the result in * <code>this</code>. * * @param mat * the matrix to multiply the vector with * @return a vector holding the result */ public Vector4f mul(Matrix4fc mat) { return mul(mat, thisOrNew()); }
/** * Multiply all components of this {@link Vector4f} by the given scalar * value. * * @param scalar * the scalar to multiply by * @return a vector holding the result */ public Vector4f mul(float scalar) { return mul(scalar, thisOrNew()); }
/** * Multiply the components of this Vector4f by the given scalar values and store the result in <code>this</code>. * * @param x * the x component to multiply by * @param y * the y component to multiply by * @param z * the z component to multiply by * @param w * the w component to multiply by * @return a vector holding the result */ public Vector4f mul(float x, float y, float z, float w) { return mul(x, y, z, w, thisOrNew()); }
/** * Multiply the components of this Vector4f by the given scalar values and store the result in <code>this</code>. * * @param x * the x component to multiply by * @param y * the y component to multiply by * @param z * the z component to multiply by * @param w * the w component to multiply by * @return a vector holding the result */ public Vector4f mul(float x, float y, float z, float w) { return mul(x, y, z, w, thisOrNew()); }
public boolean selectGameItem(GameItem[] gameItems, Window window, Vector2d mousePos, Camera camera) { // Transform mouse coordinates into normalized spaze [-1, 1] int wdwWitdh = window.getWidth(); int wdwHeight = window.getHeight(); float x = (float)(2 * mousePos.x) / (float)wdwWitdh - 1.0f; float y = 1.0f - (float)(2 * mousePos.y) / (float)wdwHeight; float z = -1.0f; invProjectionMatrix.set(window.getProjectionMatrix()); invProjectionMatrix.invert(); tmpVec.set(x, y, z, 1.0f); tmpVec.mul(invProjectionMatrix); tmpVec.z = -1.0f; tmpVec.w = 0.0f; Matrix4f viewMatrix = camera.getViewMatrix(); invViewMatrix.set(viewMatrix); invViewMatrix.invert(); tmpVec.mul(invViewMatrix); mouseDir.set(tmpVec.x, tmpVec.y, tmpVec.z); return selectGameItem(gameItems, camera.getPosition(), mouseDir); } }
public boolean selectGameItem(GameItem[] gameItems, Window window, Vector2d mousePos, Camera camera) { // Transform mouse coordinates into normalized spaze [-1, 1] int wdwWitdh = window.getWidth(); int wdwHeight = window.getHeight(); float x = (float)(2 * mousePos.x) / (float)wdwWitdh - 1.0f; float y = 1.0f - (float)(2 * mousePos.y) / (float)wdwHeight; float z = -1.0f; invProjectionMatrix.set(window.getProjectionMatrix()); invProjectionMatrix.invert(); tmpVec.set(x, y, z, 1.0f); tmpVec.mul(invProjectionMatrix); tmpVec.z = -1.0f; tmpVec.w = 0.0f; Matrix4f viewMatrix = camera.getViewMatrix(); invViewMatrix.set(viewMatrix); invViewMatrix.invert(); tmpVec.mul(invViewMatrix); mouseDir.set(tmpVec.x, tmpVec.y, tmpVec.z); return selectGameItem(gameItems, camera.getPosition(), mouseDir); } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); component.getStyle().getBackground().setColor(settings.denyColor()); if (settings.shadowColor()== null || settings.shadowColor().length() > 0.00001f) { component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, settings.shadowColor())); } else { component.getStyle().setShadow(null); } component.getHoveredStyle().getBackground().setColor(settings.denyColor().mul(1.3f, 1.3f, 1.3f, 1f)); component.getPressedStyle().getBackground().setColor(settings.denyColor().mul(1.6f, 1.6f, 1.6f, 1f)); component.setToggledBackgroundColor(settings.allowColor()); } }
/** * Used to apply theme only for component and not apply for child components. * * @param component component to apply theme. */ @Override public void apply(T component) { super.apply(component); component.getStyle().setBorder(null); Vector4f bgc = ColorUtil.negativeColorRGB(settings.backgroundColor()); component.getStyle().getBackground().setColor(bgc); component.getStyle().setShadow(new Shadow(-4, 4, 17, -7, ColorUtil.oppositeBlackOrWhite(bgc).mul(0.8f))); component.getTextState().setTextColor(ColorUtil.oppositeBlackOrWhite(bgc)); } }