fixed screenspace water reflections
@@ -155,14 +155,14 @@ public void updateMatrices(float fov) {
normViewMatrix = MatrixUtils.createViewMatrix(0f, 0f, 0f, viewingDirection.x, viewingDirection.y, viewingDirection.z,
up.x + tempRightVector.x, up.y + tempRightVector.y, up.z + tempRightVector.z);
- reflectionMatrix.setRow(0, new Vector4f(1.0f, 0.0f, 0.0f, 0.0f));
- reflectionMatrix.setRow(1, new Vector4f(0.0f, 1.0f, 0.0f, 2f * (-position.y + getReflectionHeight())));
- reflectionMatrix.setRow(2, new Vector4f(0.0f, 0.0f, 1.0f, 0.0f));
- reflectionMatrix.setRow(3, new Vector4f(0.0f, 0.0f, 0.0f, 1.0f));
- viewMatrix.mul(reflectionMatrix, viewMatrixReflected);
-
- reflectionMatrix.setRow(1, new Vector4f(0.0f, -1.0f, 0.0f, 0.0f));
- normViewMatrix.mul(reflectionMatrix,normViewMatrixReflected);
+ reflectionMatrix.setColumn(0, new Vector4f(1.0f, 0.0f, 0.0f, 0.0f));
+ reflectionMatrix.setColumn(1, new Vector4f(0.0f, -1.0f, 0.0f, 2f * (-position.y + getReflectionHeight())));
+ reflectionMatrix.setColumn(2, new Vector4f(0.0f, 0.0f, 1.0f, 0.0f));
+ reflectionMatrix.setColumn(3, new Vector4f(0.0f, 0.0f, 0.0f, 1.0f));
+ reflectionMatrix.mul(viewMatrix, viewMatrixReflected);
+
+ reflectionMatrix.setColumn(1, new Vector4f(0.0f, -1.0f, 0.0f, 0.0f));
+ reflectionMatrix.mul(normViewMatrix,normViewMatrixReflected);
// viewProjectionMatrix = MatrixUtils.calcViewProjectionMatrix(viewMatrix, projectionMatrix);
viewProjectionMatrix = new Matrix4f(viewMatrix).mul(projectionMatrix);
