From 91f2353a5798b7e3f67acea2b22f6b07f2c8fc91 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Mon, 30 Jul 2012 07:13:00 +0000 Subject: [PATCH] Re-introduced WorldMatrixInverseTranspose in UniformBindingManager git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9603 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../core/com/jme3/shader/UniformBindingManager.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/engine/src/core/com/jme3/shader/UniformBindingManager.java b/engine/src/core/com/jme3/shader/UniformBindingManager.java index 82c25ef72..11f795e11 100644 --- a/engine/src/core/com/jme3/shader/UniformBindingManager.java +++ b/engine/src/core/com/jme3/shader/UniformBindingManager.java @@ -4,10 +4,10 @@ */ package com.jme3.shader; +import com.jme3.material.Material; import com.jme3.math.*; import com.jme3.renderer.Camera; import com.jme3.renderer.RenderManager; -import com.jme3.renderer.ViewPort; import com.jme3.system.Timer; import java.util.List; @@ -39,6 +39,7 @@ public class UniformBindingManager { private Matrix4f worldViewProjMatrix = new Matrix4f(); private Matrix3f normalMatrix = new Matrix3f(); private Matrix4f worldMatrixInv = new Matrix4f(); + private Matrix3f worldMatrixInvTrsp = new Matrix3f(); private Matrix4f viewMatrixInv = new Matrix4f(); private Matrix4f projMatrixInv = new Matrix4f(); private Matrix4f viewProjMatrixInv = new Matrix4f(); @@ -95,9 +96,9 @@ public class UniformBindingManager { u.setValue(VarType.Matrix4, worldMatrixInv); break; case WorldMatrixInverseTranspose: -// worldMatrix.toRotationMatrix(tempMat3); -// tempMat3.invertLocal().transposeLocal(); -// u.setValue(VarType.Matrix3, tempMat3, true); + worldMatrix.toRotationMatrix(worldMatrixInvTrsp); + worldMatrixInvTrsp.invertLocal().transposeLocal(); + u.setValue(VarType.Matrix3, worldMatrixInvTrsp); break; case ViewMatrixInverse: viewMatrixInv.set(viewMatrix); @@ -217,7 +218,7 @@ public class UniformBindingManager { far = cam.getFrustumFar(); } - public void setViewPort(int viewX, int viewY, int viewWidth, int viewHeight) { + public void setViewPort(int viewX, int viewY, int viewWidth, int viewHeight) { this.viewX = viewX; this.viewY = viewY; this.viewWidth = viewWidth;