Преглед на файлове

rename local variables (#1598)

* AndroidConfigChooser: rename "choosenConfig" -> "chosenConfig"

* rename "glfwkey" -> "glfwKey"

* GltfLoader: rename "znear"/"zfar" -> "zNear"/"zFar"

* LightProbeFactory: rename "progres" -> "faceProgress"

* LwjglContext: rename "vers" -> "version"

* LWJGLOpenVRMouseManager: rename "Xamount"/"Yamount"

* MathUtils: rename "numer"/"denom" -> "numerator"/"denominator"

* PerturbFilter: rename "noisex"/"noisey"/"perturbx"/"perturby"

* PFMLoader: rename "needEndienFlip" -> "needEndianFlip"

* SpotLight: rename "dsqr" -> "dSquared"

* TestBatchNode: rename "boxshape4" -> "boxShape4"

* Utils: rename "errname" -> "errorName"
Stephen Gold преди 4 години
родител
ревизия
b2862540fd

+ 24 - 24
jme3-android/src/main/java/com/jme3/system/android/AndroidConfigChooser.java

@@ -35,70 +35,70 @@ public class AndroidConfigChooser implements EGLConfigChooser {
         EGLConfig[] configs = getConfigs(egl, display);
 
         // First try to find an exact match, but allowing a higher stencil
-        EGLConfig choosenConfig = chooseConfig(egl, display, configs, requestedConfig, false, false, false, true);
-        if (choosenConfig == null && requestedConfig.d > 16) {
+        EGLConfig chosenConfig = chooseConfig(egl, display, configs, requestedConfig, false, false, false, true);
+        if (chosenConfig == null && requestedConfig.d > 16) {
             logger.log(Level.INFO, "EGL configuration not found, reducing depth");
             requestedConfig.d = 16;
-            choosenConfig = chooseConfig(egl, display, configs, requestedConfig, false, false, false, true);
+            chosenConfig = chooseConfig(egl, display, configs, requestedConfig, false, false, false, true);
         }
 
-        if (choosenConfig == null) {
+        if (chosenConfig == null) {
             logger.log(Level.INFO, "EGL configuration not found, allowing higher RGB");
-            choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, false, true);
+            chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, false, true);
         }
 
-        if (choosenConfig == null && requestedConfig.a > 0) {
+        if (chosenConfig == null && requestedConfig.a > 0) {
             logger.log(Level.INFO, "EGL configuration not found, allowing higher alpha");
-            choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, false, true);
+            chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, false, true);
         }
 
-        if (choosenConfig == null && requestedConfig.s > 0) {
+        if (chosenConfig == null && requestedConfig.s > 0) {
             logger.log(Level.INFO, "EGL configuration not found, allowing higher samples");
-            choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, true, true);
+            chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, true, true);
         }
 
-        if (choosenConfig == null && requestedConfig.a > 0) {
+        if (chosenConfig == null && requestedConfig.a > 0) {
             logger.log(Level.INFO, "EGL configuration not found, reducing alpha");
             requestedConfig.a = 1;
-            choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, false, true);
+            chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, false, true);
         }
 
-        if (choosenConfig == null && requestedConfig.s > 0) {
+        if (chosenConfig == null && requestedConfig.s > 0) {
             logger.log(Level.INFO, "EGL configuration not found, reducing samples");
             requestedConfig.s = 1;
             if (requestedConfig.a > 0) {
-                choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, true, true);
+                chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, true, true);
             } else {
-                choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, true, true);
+                chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, true, true);
             }
         }
 
-        if (choosenConfig == null && requestedConfig.getBitsPerPixel() > 16) {
+        if (chosenConfig == null && requestedConfig.getBitsPerPixel() > 16) {
             logger.log(Level.INFO, "EGL configuration not found, setting to RGB565");
             requestedConfig.r = 5;
             requestedConfig.g = 6;
             requestedConfig.b = 5;
-            choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, false, true);
+            chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, false, true);
 
-            if (choosenConfig == null) {
+            if (chosenConfig == null) {
                 logger.log(Level.INFO, "EGL configuration not found, allowing higher alpha");
-                choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, false, true);
+                chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, true, false, true);
             }
         }
 
-        if (choosenConfig == null) {
+        if (chosenConfig == null) {
             logger.log(Level.INFO, "EGL configuration not found, looking for best config with >= 16 bit Depth");
             //failsafe, should pick best config with at least 16 depth
             requestedConfig = new Config(0, 0, 0, 0, 16, 0, 0);
-            choosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, false, true);
+            chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, false, true);
         }
 
-        if (choosenConfig != null) {
+        if (chosenConfig != null) {
             logger.fine("GLSurfaceView asks for egl config, returning: ");
-            logEGLConfig(choosenConfig, display, egl, Level.FINE);
+            logEGLConfig(chosenConfig, display, egl, Level.FINE);
 
-            storeSelectedConfig(egl, display, choosenConfig);
-            return choosenConfig;
+            storeSelectedConfig(egl, display, chosenConfig);
+            return chosenConfig;
         } else {
             logger.severe("No EGL Config found");
             return null;

+ 2 - 2
jme3-core/src/main/java/com/jme3/environment/LightProbeFactory.java

@@ -260,8 +260,8 @@ public class LightProbeFactory {
 
         float getProgress() {
             float mean = 0;
-            for (double progres : progress) {
-                mean += progres;
+            for (double faceProgress : progress) {
+                mean += faceProgress;
             }
             return mean / 7f;
         }

+ 5 - 5
jme3-core/src/main/java/com/jme3/light/SpotLight.java

@@ -207,16 +207,16 @@ public class SpotLight extends Light {
         Vector3f U = position.subtract(E, vars.vect2);
         Vector3f D = otherCenter.subtract(U, vars.vect3);
 
-        float dsqr = D.dot(D);
+        float dSquared = D.dot(D);
         float e = direction.dot(D);
 
-        if (e > 0f && e * e >= dsqr * outerAngleCosSqr) {
+        if (e > 0f && e * e >= dSquared * outerAngleCosSqr) {
             D = otherCenter.subtract(position, vars.vect3);
-            dsqr = D.dot(D);
+            dSquared = D.dot(D);
             e = -direction.dot(D);
 
-            if (e > 0f && e * e >= dsqr * outerAngleSinSqr) {
-                return dsqr <= otherRadiusSquared;
+            if (e > 0f && e * e >= dSquared * outerAngleSinSqr) {
+                return dSquared <= otherRadiusSquared;
             } else {
                 return true;
             }

+ 4 - 4
jme3-core/src/main/java/com/jme3/math/MathUtils.java

@@ -263,14 +263,14 @@ public class MathUtils {
         double d4343 = p43.x * (double) p43.x + (double) p43.y * p43.y + (double) p43.z * p43.z;
         double d2121 = p21.x * (double) p21.x + (double) p21.y * p21.y + (double) p21.z * p21.z;
 
-        double denom = d2121 * d4343 - d4321 * d4321;
-        if (Math.abs(denom) < 0.0001) {
+        double denominator = d2121 * d4343 - d4321 * d4321;
+        if (Math.abs(denominator) < 0.0001) {
             vars.release();
             return -1;
         }
-        double numer = d1343 * d4321 - d1321 * d4343;
+        double numerator = d1343 * d4321 - d1321 * d4343;
 
-        double mua = numer / denom;
+        double mua = numerator / denominator;
         double mub = (d1343 + d4321 * (mua)) / d4343;
 
         resultSegmentPoint1.x = (float) (p1.x + mua * p21.x);

+ 2 - 2
jme3-core/src/plugins/java/com/jme3/texture/plugins/PFMLoader.java

@@ -99,7 +99,7 @@ public class PFMLoader implements AssetLoader {
         String scaleStr = readString(in);
         float scale = Float.parseFloat(scaleStr);
         ByteOrder order = scale < 0 ? ByteOrder.LITTLE_ENDIAN : ByteOrder.BIG_ENDIAN;
-        boolean needEndienFlip = order != ByteOrder.nativeOrder();
+        boolean needEndianFlip = order != ByteOrder.nativeOrder();
 
         // make sure all unnecessary stuff gets deleted from heap
         // before allocating large amount of memory
@@ -122,7 +122,7 @@ public class PFMLoader implements AssetLoader {
                 off += read;
             } while (read > 0);
 
-            if (needEndienFlip){
+            if (needEndianFlip){
                 flipScanline(scanline);
             }
 

+ 2 - 2
jme3-examples/src/main/java/jme3test/batching/TestBatchNode.java

@@ -81,8 +81,8 @@ public class TestBatchNode extends SimpleApplication {
          * A cube with a color "bleeding" through transparent texture. Uses
          * Texture from jme3-testdata library!
          */
-        Box boxshape4 = new Box(1f, 1f, 1f);
-        Geometry cube = new Geometry("cube1", boxshape4);
+        Box boxShape4 = new Box(1f, 1f, 1f);
+        Geometry cube = new Geometry("cube1", boxShape4);
         Material mat = assetManager.loadMaterial("Textures/Terrain/Pond/Pond.j3m");
         cube.setMaterial(mat);
         //Material mat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");

+ 4 - 4
jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/Utils.java

@@ -122,11 +122,11 @@ public class Utils {
     
     public static void reportError(int error, String callName) {
         if (error != CL10.CL_SUCCESS) {
-            String errname = getErrorName(error);
-            if (errname == null) {
-                errname = "UNKNOWN";
+            String errorName = getErrorName(error);
+            if (errorName == null) {
+                errorName = "UNKNOWN";
             }
-            LOG.log(Level.WARNING, "OpenCL error in {0}: {1} (0x{2})", new Object[]{callName, errname, Integer.toHexString(error)});
+            LOG.log(Level.WARNING, "OpenCL error in {0}: {1} (0x{2})", new Object[]{callName, errorName, Integer.toHexString(error)});
         }
     }
     

+ 2 - 2
jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java

@@ -278,8 +278,8 @@ public abstract class LwjglContext implements JmeContext {
                     + "required for jMonkeyEngine");
         }
 
-        int vers[] = getGLVersion(settings.getRenderer());
-        if (vers != null) {
+        int version[] = getGLVersion(settings.getRenderer());
+        if (version != null) {
             if (first) {
                 GL gl = new LwjglGL();
                 GLExt glext = new LwjglGLExt();

+ 2 - 2
jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwKeyInput.java

@@ -111,8 +111,8 @@ public class GlfwKeyInput implements KeyInput {
 
     @Override
     public String getKeyName(int jmeKey) {
-        int glfwkey = GlfwKeyMap.fromJmeKeyCode(jmeKey);
-        return glfwGetKeyName(glfwkey, 0);
+        int glfwKey = GlfwKeyMap.fromJmeKeyCode(jmeKey);
+        return glfwGetKeyName(glfwKey, 0);
     }
 
     private void initCallbacks() {

+ 9 - 9
jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java

@@ -684,11 +684,11 @@ public class GltfLoader implements AssetLoader {
                 float aspectRatio = getAsFloat(camData, "aspectRation", 1f);
                 Float yfov = getAsFloat(camData, "yfov");
                 assertNotNull(yfov, "No yfov for perspective camera");
-                Float znear = getAsFloat(camData, "znear");
-                assertNotNull(znear, "No znear for perspective camera");
-                Float zfar = getAsFloat(camData, "zfar", znear * 1000f);
+                Float zNear = getAsFloat(camData, "znear");
+                assertNotNull(zNear, "No znear for perspective camera");
+                Float zFar = getAsFloat(camData, "zfar", zNear * 1000f);
 
-                cam.setFrustumPerspective(yfov * FastMath.RAD_TO_DEG, aspectRatio, znear, zfar);
+                cam.setFrustumPerspective(yfov * FastMath.RAD_TO_DEG, aspectRatio, zNear, zFar);
                 cam = customContentManager.readExtensionAndExtras("camera.perspective", camData, cam);
 
             } else {
@@ -696,13 +696,13 @@ public class GltfLoader implements AssetLoader {
                 assertNotNull(xmag, "No xmag for orthographic camera");
                 Float ymag = getAsFloat(camData, "ymag");
                 assertNotNull(ymag, "No ymag for orthographic camera");
-                Float znear = getAsFloat(camData, "znear");
-                assertNotNull(znear, "No znear for orthographic camere");
-                Float zfar = getAsFloat(camData, "zfar", znear * 1000f);
-                assertNotNull(zfar, "No zfar for orthographic camera");
+                Float zNear = getAsFloat(camData, "znear");
+                assertNotNull(zNear, "No znear for orthographic camere");
+                Float zFar = getAsFloat(camData, "zfar", zNear * 1000f);
+                assertNotNull(zFar, "No zfar for orthographic camera");
 
                 cam.setParallelProjection(true);
-                cam.setFrustum(znear, zfar, -xmag, xmag, ymag, -ymag);
+                cam.setFrustum(zNear, zFar, -xmag, xmag, ymag, -ymag);
 
                 cam = customContentManager.readExtensionAndExtras("camera.orthographic", camData, cam);
             }

+ 9 - 9
jme3-terrain/src/main/java/com/jme3/terrain/noise/filter/PerturbFilter.java

@@ -61,25 +61,25 @@ public class PerturbFilter extends AbstractFilter {
 				"Found origSize : " + origSize + " and offset: " + offset + " for workSize : " + workSize + " and magnitude : "
 						+ this.magnitude);
 		float[] retval = new float[workSize * workSize];
-		float[] perturbx = new FractalSum().setOctaves(8).setScale(5f).getBuffer(sx, sy, base, workSize).array();
-		float[] perturby = new FractalSum().setOctaves(8).setScale(5f).getBuffer(sx, sy, base + 1, workSize).array();
+		float[] perturbX = new FractalSum().setOctaves(8).setScale(5f).getBuffer(sx, sy, base, workSize).array();
+		float[] perturbY = new FractalSum().setOctaves(8).setScale(5f).getBuffer(sx, sy, base + 1, workSize).array();
 		for (int y = 0; y < workSize; y++) {
 			for (int x = 0; x < workSize; x++) {
 				// Perturb our coordinates
-				float noisex = perturbx[y * workSize + x];
-				float noisey = perturby[y * workSize + x];
+				float noiseX = perturbX[y * workSize + x];
+				float noiseY = perturbY[y * workSize + x];
 
-				int px = (int) (origSize * noisex * this.magnitude);
-				int py = (int) (origSize * noisey * this.magnitude);
+				int px = (int) (origSize * noiseX * this.magnitude);
+				int py = (int) (origSize * noiseY * this.magnitude);
 
 				float c00 = arr[this.wrap(y - py, workSize) * workSize + this.wrap(x - px, workSize)];
 				float c01 = arr[this.wrap(y - py, workSize) * workSize + this.wrap(x + px, workSize)];
 				float c10 = arr[this.wrap(y + py, workSize) * workSize + this.wrap(x - px, workSize)];
 				float c11 = arr[this.wrap(y + py, workSize) * workSize + this.wrap(x + px, workSize)];
 
-				float c0 = ShaderUtils.mix(c00, c01, noisex);
-				float c1 = ShaderUtils.mix(c10, c11, noisex);
-				retval[y * workSize + x] = ShaderUtils.mix(c0, c1, noisey);
+				float c0 = ShaderUtils.mix(c00, c01, noiseX);
+				float c1 = ShaderUtils.mix(c10, c11, noiseX);
+				retval[y * workSize + x] = ShaderUtils.mix(c0, c1, noiseY);
 			}
 		}
 		return FloatBuffer.wrap(retval);

+ 2 - 2
jme3-vr/src/main/java/com/jme3/input/lwjgl/GlfwKeyInputVR.java

@@ -146,8 +146,8 @@ public class GlfwKeyInputVR implements KeyInput {
 
     @Override
     public String getKeyName(int jmeKey) {
-        int glfwkey = GlfwKeyMap.fromJmeKeyCode(jmeKey);
-        return glfwGetKeyName(glfwkey, 0);
+        int glfwKey = GlfwKeyMap.fromJmeKeyCode(jmeKey);
+        return glfwGetKeyName(glfwKey, 0);
     }
 
 }

+ 10 - 10
jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVRMouseManager.java

@@ -50,29 +50,29 @@ public class LWJGLOpenVRMouseManager extends AbstractVRMouseManager {
     	            tpDelta = getVREnvironment().getVRinput().getAxisDeltaSinceLastCall(inputIndex, VRInputType.ViveTrackpadAxis);            
     	        }
     	        
-    	        float Xamount = (float)Math.pow(Math.abs(tpDelta.x) * getSpeedSensitivity(), getSpeedAcceleration());
-    	        float Yamount = (float)Math.pow(Math.abs(tpDelta.y) * getSpeedSensitivity(), getSpeedAcceleration());
+    	        float xAmount = (float)Math.pow(Math.abs(tpDelta.x) * getSpeedSensitivity(), getSpeedAcceleration());
+    	        float yAmount = (float)Math.pow(Math.abs(tpDelta.y) * getSpeedSensitivity(), getSpeedAcceleration());
     	        
     	        if( tpDelta.x < 0f ){
-    	        	Xamount = -Xamount;
+    	        	xAmount = -xAmount;
     	        }
     	        
     	        if( tpDelta.y < 0f ){
-    	        	Yamount = -Yamount;
+    	        	yAmount = -yAmount;
     	        }
     	        
-    	        Xamount *= getMouseMoveScale(); 
-    	        Yamount *= getMouseMoveScale();
+    	        xAmount *= getMouseMoveScale();
+    	        yAmount *= getMouseMoveScale();
     	        
     	        if( mouseListener != null ) {
-    	            if( tpDelta.x != 0f && mouseXName != null ) mouseListener.onAnalog(mouseXName, Xamount * 0.2f, tpf);
-    	            if( tpDelta.y != 0f && mouseYName != null ) mouseListener.onAnalog(mouseYName, Yamount * 0.2f, tpf);            
+    	            if( tpDelta.x != 0f && mouseXName != null ) mouseListener.onAnalog(mouseXName, xAmount * 0.2f, tpf);
+    	            if( tpDelta.y != 0f && mouseYName != null ) mouseListener.onAnalog(mouseYName, yAmount * 0.2f, tpf);
     	        }
     	        
     	        if( getVREnvironment().getApplication().getInputManager().isCursorVisible() ) {
     	            int index = (avgCounter+1) % AVERAGE_AMNT;
-    	            lastXmv[index] = Xamount * 133f;
-    	            lastYmv[index] = Yamount * 133f;
+    	            lastXmv[index] = xAmount * 133f;
+    	            lastYmv[index] = yAmount * 133f;
     	            cursorPos.x -= avg(lastXmv);
     	            cursorPos.y -= avg(lastYmv);
     	            Vector2f maxsize = getVREnvironment().getVRGUIManager().getCanvasSize();