public void updatePrevViewProjectionMatrix() { prevViewProjectionMatrix.set(viewProjectionMatrix); }
@Override public void updateMatrices(float fov) { prevViewProjectionMatrix.set(viewProjectionMatrix);
modelMatrix.set(lightComponent.lightAttenuationRange); // scales the modelview matrix, effectively scales the light sphere
private void jomlMatrix4f(org.joml.Matrix4f matrixInput, org.terasology.math.geom.Matrix4f matrixOut) { matrixOut.set(0, 0, matrixInput.m00()); matrixOut.set(0, 1, matrixInput.m10()); matrixOut.set(0, 2, matrixInput.m20()); matrixOut.set(0, 3, matrixInput.m30()); matrixOut.set(1, 0, matrixInput.m01()); matrixOut.set(1, 1, matrixInput.m11()); matrixOut.set(1, 2, matrixInput.m21()); matrixOut.set(1, 3, matrixInput.m31()); matrixOut.set(2, 0, matrixInput.m02()); matrixOut.set(2, 1, matrixInput.m12()); matrixOut.set(2, 2, matrixInput.m22()); matrixOut.set(2, 3, matrixInput.m32()); matrixOut.set(3, 0, matrixInput.m03()); matrixOut.set(3, 1, matrixInput.m13()); matrixOut.set(3, 2, matrixInput.m23()); matrixOut.set(3, 3, matrixInput.m33()); }
@Override public void updateMatrices(float fov) { prevViewProjectionMatrix.set(viewProjectionMatrix); // Nothing to do... if (cachedPosition.equals(getPosition()) && cachedViewigDirection.equals(getViewingDirection()) && cachedZFar == zFar && cachedZNear == zNear) { return; } projectionMatrix = MatrixUtils.createOrthogonalProjectionMatrix(left, right, top, bottom, zNear, zFar); viewMatrix = MatrixUtils.createViewMatrix(0f, 0.0f, 0f, viewingDirection.x, viewingDirection.y, viewingDirection.z, up.x, up.y, up.z); normViewMatrix = MatrixUtils.createViewMatrix(0f, 0f, 0f, viewingDirection.x, viewingDirection.y, viewingDirection.z, up.x, up.y, up.z); viewProjectionMatrix = MatrixUtils.calcViewProjectionMatrix(viewMatrix, projectionMatrix); inverseViewProjectionMatrix.invert(viewProjectionMatrix); // Used for dirty checks cachedPosition.set(getPosition()); cachedViewigDirection.set(getViewingDirection()); cachedZFar = zFar; cachedZNear = zNear; updateFrustum(); }