public void updateTextureMatrix(final Matrix4 matrixStore) { update(); final ReadOnlyMatrix4 projectorView = getViewMatrix(); final ReadOnlyMatrix4 projectorProjection = getProjectionMatrix(); matrixStore.set(projectorView).multiplyLocal(projectorProjection).multiplyLocal(BIAS); } }
public void updateTextureMatrix(final Matrix4 matrixStore) { update(); final ReadOnlyMatrix4 projectorView = getModelViewMatrix(); final ReadOnlyMatrix4 projectorProjection = getProjectionMatrix(); matrixStore.set(projectorView).multiplyLocal(projectorProjection).multiplyLocal(BIAS); } }
/** * update modelViewProjection if necessary. */ private void checkModelViewProjection() { if (_updateMVPMatrix) { _modelViewProjection.set(getModelViewMatrix()).multiplyLocal(getProjectionMatrix()); _updateMVPMatrix = false; } }
/** * update modelViewProjection if necessary. */ private void checkModelViewProjection() { if (_updateMVPMatrix) { _modelViewProjection.set(getViewMatrix()).multiplyLocal(getProjectionMatrix()); _updateMVPMatrix = false; } }
result.multiplyLocal(1.0 / det);
result.multiplyLocal(1.0 / det);
/** * Update texture matrix. * * @param index * the index */ private void updateTextureMatrix(final int index) { // Create a matrix going from light to camera space final Camera cam = ContextManager.getCurrentContext().getCurrentCamera(); _shadowMatrix.set(cam.getViewMatrix()).invertLocal(); _shadowMatrix.multiplyLocal(_shadowMapRenderer.getCamera().getModelViewProjectionMatrix()) .multiplyLocal(SCALE_BIAS_MATRIX); // _shadowMapTexture[index].setTextureMatrix(_shadowMatrix); }
/** * Update texture matrix. * * @param index * the index */ private void updateTextureMatrix(final int index) { // Create a matrix going from light to camera space final Camera cam = ContextManager.getCurrentContext().getCurrentCamera(); _shadowMatrix.set(cam.getModelViewMatrix()).invertLocal(); _shadowMatrix.multiplyLocal(_shadowMapRenderer.getCamera().getModelViewProjectionMatrix()).multiplyLocal( SCALE_BIAS_MATRIX); _shadowMapTexture[index].setTextureMatrix(_shadowMatrix); }
workingMat.setIdentity(); workingMat.setColumn(3, new Vector4(array[0], array[1], array[2], 1.0)); finalMat.multiplyLocal(workingMat); } else if ("rotate".equals(transform.getName())) { if (array[3] != 0) { array[0], array[1], array[2])); workingMat.set(rotate); finalMat.multiplyLocal(workingMat); finalMat.multiplyLocal(workingMat); } else if ("matrix".equals(transform.getName())) { workingMat.fromArray(array); finalMat.multiplyLocal(workingMat); } else if ("lookat".equals(transform.getName())) { final Vector3 pos = new Vector3(array[0], array[1], array[2]); workingMat.set(rot); workingMat.setColumn(3, new Vector4(array[0], array[1], array[2], 1)); finalMat.multiplyLocal(workingMat); } else { logger.warning("transform not currently supported: " + transform.getClass().getCanonicalName());
workingMat.setIdentity(); workingMat.setColumn(3, new Vector4(array[0], array[1], array[2], 1.0)); finalMat.multiplyLocal(workingMat); } else if (type == TransformElementType.Rotation) { if (array[3] != 0) { array[0], array[1], array[2])); workingMat.set(rotate); finalMat.multiplyLocal(workingMat); finalMat.multiplyLocal(workingMat); } else if (type == TransformElementType.Matrix) { workingMat.fromArray(array); finalMat.multiplyLocal(workingMat); } else if (type == TransformElementType.Lookat) { final Vector3 pos = new Vector3(array[0], array[1], array[2]); workingMat.set(rot); workingMat.setColumn(3, new Vector4(array[0], array[1], array[2], 1.0)); finalMat.multiplyLocal(workingMat); } else { if (logger.isLoggable(Level.WARNING)) {
rangeMatrix.multiplyLocal(modelViewProjectionInverseMatrix);
rangeMatrix.multiplyLocal(modelViewProjectionInverseMatrix);
2.0, 2.1, 2.2, 2.3, // 3.0, 3.1, 3.2, 3.3); mat4A.multiplyLocal(2); assertEquals(new Matrix4( // 0.02, 0.2, 0.4, 0.6, // assertTrue(6.0 * 2 + 6.2 * 6 + 6.4 * 10 + 6.6 * 14 == result.getM32()); assertTrue(6.0 * 3 + 6.2 * 7 + 6.4 * 11 + 6.6 * 15 == result.getM33()); mat4A.multiplyLocal(mat4B); assertTrue(0.02 * 0.5 + 0.2 * 4 + 0.4 * 8 + 0.6 * 12 == mat4A.getM00()); assertTrue(0.02 * 1 + 0.2 * 5 + 0.4 * 9 + 0.6 * 13 == mat4A.getM01());