/** * <code>mult</code> multiplies this matrix with another matrix. The * result matrix will then be returned. This matrix will be on the left hand * side, while the parameter matrix will be on the right. * * @param in2 * the matrix to multiply this matrix by. * @return the resultant matrix */ public Matrix4f mult(Matrix4f in2) { return mult(in2, null); }
pos.y = tmpFloat[index1]; pos.z = tmpFloat[index2]; transform.mult(pos, pos); tmpFloat[index] = pos.x; tmpFloat[index1] = pos.y;
/** * <code>mult</code> multiplies a vector about a rotation matrix. The * resulting vector is returned as a new Vector3f. * * @param vec * vec to multiply against. * @return the rotated vector. */ public Vector3f mult(Vector3f vec) { return mult(vec, null); }
globalBoneMatrix = armatureWorldMatrix.mult(globalBoneMatrix);
Vector3f pp = ivm.mult(point, vars.vect2); Vector3f pn = ivm.multNormal(clipPlane.getNormal(), vars.vect3); Vector4f clipPlaneV = vars.vect4f1.set(pn.x * sideFactor, pn.y * sideFactor, pn.z * sideFactor, -(pp.dot(pn)) * sideFactor);
/** * <code>mult</code> multiplies a <code>Vector4f</code> about a rotation * matrix. The resulting vector is returned as a new <code>Vector4f</code>. * * @param vec * vec to multiply against. * @return the rotated vector. */ public Vector4f mult(Vector4f vec) { return mult(vec, null); }
/** * <code>mult</code> multiplies this matrix with another matrix. The * results are stored internally and a handle to this matrix will * then be returned. This matrix will be on the left hand * side, while the parameter matrix will be on the right. * * @param in2 * the matrix to multiply this matrix by. * @return the resultant matrix */ public Matrix4f multLocal(Matrix4f in2) { return mult(in2, this); }
public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) { modelTransformMatrix.mult(inverseModelBindMatrix, outTransform); }
private void transformPosition(Matrix4f viewMatrix, Vector3f location) { viewMatrix.mult(location, location); }
public void getOffsetTransform(Matrix4f outTransform, Matrix4f inverseModelBindMatrix) { modelTransform.toTransformMatrix(outTransform).mult(inverseModelBindMatrix, outTransform); }
private static void doTransformVerts(FloatBuffer inBuf, int offset, FloatBuffer outBuf, Matrix4f transform) { Vector3f pos = new Vector3f(); // offset is given in element units // convert to be in component units offset *= 3; for (int i = 0; i < inBuf.limit() / 3; i++) { pos.x = inBuf.get(i * 3 + 0); pos.y = inBuf.get(i * 3 + 1); pos.z = inBuf.get(i * 3 + 2); transform.mult(pos, pos); outBuf.put(offset + i * 3 + 0, pos.x); outBuf.put(offset + i * 3 + 1, pos.y); outBuf.put(offset + i * 3 + 2, pos.z); } }
@Override public void updateModelTransform(Transform localTransform, Joint parent) { localTransform.toTransformMatrix(modelTransformMatrix); if (parent != null) { ((MatrixJointModelTransform) parent.getJointModelTransform()).getModelTransformMatrix().mult(modelTransformMatrix, modelTransformMatrix); } }
public BoundingVolume transform(Matrix4f trans, BoundingVolume store) { BoundingSphere sphere; if (store == null || store.getType() != BoundingVolume.Type.Sphere) { sphere = new BoundingSphere(1, new Vector3f(0, 0, 0)); } else { sphere = (BoundingSphere) store; } trans.mult(center, sphere.center); Vector3f axes = new Vector3f(1, 1, 1); trans.mult(axes, axes); float ax = getMaxAxis(axes); sphere.radius = FastMath.abs(ax * radius) + RADIUS_EPSILON - 1f; return sphere; }
@Override public void applyBindPose(Transform localTransform, Matrix4f inverseModelBindMatrix, Joint parent) { modelTransformMatrix.set(inverseModelBindMatrix).invertLocal(); // model transform = model bind if (parent != null) { ((MatrixJointModelTransform) parent.getJointModelTransform()).getModelTransformMatrix().invert().mult(modelTransformMatrix, modelTransformMatrix); } localTransform.fromTransformMatrix(modelTransformMatrix); }
@Override protected void postQueue(RenderQueue queue) { getClipCoordinates(lightPosition, screenLightPos, viewPort.getCamera()); viewPort.getCamera().getViewMatrix().mult(lightPosition, viewLightPos); if (adaptative) { float densityX = 1f - FastMath.clamp(FastMath.abs(screenLightPos.x - 0.5f), 0, 1); float densityY = 1f - FastMath.clamp(FastMath.abs(screenLightPos.y - 0.5f), 0, 1); innerLightDensity = lightDensity * densityX * densityY; } else { innerLightDensity = lightDensity; } display = innerLightDensity != 0.0 && viewLightPos.z < 0; }
/** * This method transforms the first line of the bevel points positioning it * on the first point of the curve. * * @param startingLinePoints * the vbevel shape points * @param firstCurvePoint * the first curve's point * @param secondCurvePoint * the second curve's point * @return points of transformed bevel */ protected Vector3f[] transformToFirstLineOfBevelPoints(Vector3f[] startingLinePoints, Vector3f firstCurvePoint, Vector3f secondCurvePoint) { Vector3f planeNormal = secondCurvePoint.subtract(firstCurvePoint).normalizeLocal(); float angle = FastMath.acos(planeNormal.dot(Vector3f.UNIT_X)); Vector3f rotationVector = Vector3f.UNIT_X.cross(planeNormal).normalizeLocal(); Matrix4f m = new Matrix4f(); m.setRotationQuaternion(new Quaternion().fromAngleAxis(angle, rotationVector)); m.setTranslation(firstCurvePoint); Vector3f temp = new Vector3f(); Vector3f[] verts = new Vector3f[startingLinePoints.length]; for (int i = 0; i < verts.length; ++i) { verts[i] = m.mult(startingLinePoints[i], temp).clone(); } return verts; } }
material.setFloat("Time", time); Camera sceneCam = viewPort.getCamera(); biasMatrix.mult(sceneCam.getViewProjectionMatrix(), textureProjMatrix); material.setMatrix4("TextureProjMatrix", textureProjMatrix); material.setVector3("CameraPosition", sceneCam.getLocation());