WaterUtils tries to hard to avoid allocation... I

fixed three cases that were causing new Vector3fs
to be created.
experimental
pspeed42 11 years ago
parent c98a348fd2
commit a47fb27e56
  1. 6
      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);

Loading…
Cancel
Save