From a47fb27e562bd2b587aab5157c82e4c03e58106f Mon Sep 17 00:00:00 2001 From: pspeed42 Date: Tue, 12 Aug 2014 04:06:07 -0400 Subject: [PATCH] WaterUtils tries to hard to avoid allocation... I fixed three cases that were causing new Vector3fs to be created. --- jme3-effects/src/main/java/com/jme3/water/WaterUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jme3-effects/src/main/java/com/jme3/water/WaterUtils.java b/jme3-effects/src/main/java/com/jme3/water/WaterUtils.java index f232a6512..0060d7935 100644 --- a/jme3-effects/src/main/java/com/jme3/water/WaterUtils.java +++ b/jme3-effects/src/main/java/com/jme3/water/WaterUtils.java @@ -34,15 +34,15 @@ public class WaterUtils { sceneCam.getFrustumBottom()); reflectionCam.setParallelProjection(sceneCam.isParallelProjection()); - sceneTarget.set(sceneCam.getLocation()).addLocal(sceneCam.getDirection()); + sceneTarget.set(sceneCam.getLocation()).addLocal(sceneCam.getDirection(vars.vect6)); reflectDirection = plane.reflect(sceneTarget, reflectDirection); reflectDirection.subtractLocal(camLoc); - sceneTarget.set(sceneCam.getLocation()).subtractLocal(sceneCam.getUp()); + sceneTarget.set(sceneCam.getLocation()).subtractLocal(sceneCam.getUp(vars.vect6)); reflectUp = plane.reflect(sceneTarget, reflectUp); reflectUp.subtractLocal(camLoc); - sceneTarget.set(sceneCam.getLocation()).addLocal(sceneCam.getLeft()); + sceneTarget.set(sceneCam.getLocation()).addLocal(sceneCam.getLeft(vars.vect6)); reflectLeft = plane.reflect(sceneTarget, reflectLeft); reflectLeft.subtractLocal(camLoc);