Переглянути джерело

rename local variables for clarity

Stephen Gold 3 роки тому
батько
коміт
8976bac61a
31 змінених файлів з 175 додано та 175 видалено
  1. 3 3
      jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/RagdollUtils.java
  2. 3 3
      jme3-core/src/main/java/com/jme3/collision/SweepSphere.java
  3. 8 8
      jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
  4. 5 5
      jme3-core/src/main/java/com/jme3/light/SpotLight.java
  5. 2 2
      jme3-core/src/main/java/com/jme3/math/FastMath.java
  6. 2 2
      jme3-core/src/main/java/com/jme3/scene/shape/PQTorus.java
  7. 3 3
      jme3-core/src/main/java/com/jme3/shadow/ShadowUtil.java
  8. 2 2
      jme3-core/src/main/java/com/jme3/util/IntMap.java
  9. 6 6
      jme3-core/src/test/java/com/jme3/scene/shape/ShapeBoundsTest.java
  10. 3 3
      jme3-core/src/tools/java/jme3tools/shader/ShaderDebug.java
  11. 6 6
      jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java
  12. 7 7
      jme3-examples/src/main/java/jme3test/bullet/PhysicsTestHelper.java
  13. 6 6
      jme3-examples/src/main/java/jme3test/bullet/TestBoneRagdoll.java
  14. 15 15
      jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java
  15. 17 17
      jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java
  16. 19 19
      jme3-examples/src/main/java/jme3test/bullet/TestCcd.java
  17. 9 9
      jme3-examples/src/main/java/jme3test/bullet/TestRagdollCharacter.java
  18. 13 13
      jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java
  19. 3 3
      jme3-examples/src/main/java/jme3test/helloworld/HelloPhysics.java
  20. 2 2
      jme3-examples/src/main/java/jme3test/input/TestJoystick.java
  21. 2 2
      jme3-examples/src/main/java/jme3test/material/TestShaderNodes.java
  22. 1 1
      jme3-examples/src/main/java/jme3test/model/anim/TestAnimationFactory.java
  23. 8 8
      jme3-examples/src/main/java/jme3test/post/TestPostFiltersCompositing.java
  24. 2 2
      jme3-examples/src/main/java/jme3test/renderer/TestDepthFuncChange.java
  25. 2 2
      jme3-jbullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java
  26. 3 3
      jme3-vr/src/main/java/com/jme3/app/VRApplication.java
  27. 3 3
      jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java
  28. 4 4
      jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVRInput.java
  29. 10 10
      jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRMouseManager.java
  30. 3 3
      jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java
  31. 3 3
      jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java

+ 3 - 3
jme3-bullet/src/common/java/com/jme3/bullet/control/ragdoll/RagdollUtils.java

@@ -197,9 +197,9 @@ public class RagdollUtils {
             list.add(skeleton.getBoneIndex(bone));
         } else {
             list.add(skeleton.getBoneIndex(bone));
-            for (Bone chilBone : bone.getChildren()) {
-                if (!boneList.contains(chilBone.getName())) {
-                    list.addAll(getBoneIndices(chilBone, skeleton, boneList));
+            for (Bone childBone : bone.getChildren()) {
+                if (!boneList.contains(childBone.getName())) {
+                    list.addAll(getBoneIndices(childBone, skeleton, boneList));
                 }
             }
         }

+ 3 - 3
jme3-core/src/main/java/com/jme3/collision/SweepSphere.java

@@ -119,9 +119,9 @@ class SweepSphere implements Collidable {
             return Float.NaN;
         }
 
-        float sqrtd = FastMath.sqrt(determinant);
-        float r1 = (-b - sqrtd) / (2f * a);
-        float r2 = (-b + sqrtd) / (2f * a);
+        float sqrtDet = FastMath.sqrt(determinant);
+        float r1 = (-b - sqrtDet) / (2f * a);
+        float r2 = (-b + sqrtDet) / (2f * a);
 
         if (r1 > r2){
             float temp = r2;

+ 8 - 8
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java

@@ -436,7 +436,7 @@ public class JoystickCompatibilityMappings {
         final String BUTTON_LABEL = "button";
 
         float[] range;
-        int lBrackIndex, rBrackIndex, commaIndex;
+        int lBracketIndex, rBracketIndex, commaIndex;
 
         for (Map.Entry<Object, Object> e : p.entrySet()) {
             range = null;
@@ -471,21 +471,21 @@ public class JoystickCompatibilityMappings {
                 // It's a name remapping
                 addJoystickNameRegex(value, stick);
             }
-            if ((lBrackIndex = value.indexOf('[')) > 0) {
+            if ((lBracketIndex = value.indexOf('[')) > 0) {
                 /*
                  * This means that there is an axis range.
                  */
                 range = new float[2];
-                rBrackIndex = value.indexOf(']');
+                rBracketIndex = value.indexOf(']');
                 commaIndex = value.indexOf(',');
-                if (rBrackIndex > -1 && commaIndex > -1) {
+                if (rBracketIndex > -1 && commaIndex > -1) {
                     try {
-                        range[0] = Float.parseFloat(value.substring(lBrackIndex + 1, commaIndex).trim());
-                        range[1] = Float.parseFloat(value.substring(commaIndex + 1, rBrackIndex).trim());
-                        value = value.substring(0, lBrackIndex).trim();
+                        range[0] = Float.parseFloat(value.substring(lBracketIndex + 1, commaIndex).trim());
+                        range[1] = Float.parseFloat(value.substring(commaIndex + 1, rBracketIndex).trim());
+                        value = value.substring(0, lBracketIndex).trim();
                         type = AXIS_LABEL;
                     } catch (NumberFormatException nfe) {
-                        logger.log(Level.SEVERE, "Could not parse axis range \"" + value.substring(lBrackIndex) + "\"", nfe);
+                        logger.log(Level.SEVERE, "Could not parse axis range \"" + value.substring(lBracketIndex) + "\"", nfe);
                     }
                 }
             }

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

@@ -244,16 +244,16 @@ public class SpotLight extends Light {
         Vector3f U = position.subtract(E, vars.vect2);
         Vector3f D = sphere.getCenter().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 = sphere.getCenter().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;
             }

+ 2 - 2
jme3-core/src/main/java/com/jme3/math/FastMath.java

@@ -628,11 +628,11 @@ final public class FastMath {
      * @return an approximate value for 1/sqrt(x)
      */
     public static float fastInvSqrt(float x) {
-        float xhalf = 0.5f * x;
+        float halfX = 0.5f * x;
         int i = Float.floatToIntBits(x); // get bits for floating value
         i = 0x5f375a86 - (i >> 1); // gives initial guess y0
         x = Float.intBitsToFloat(i); // convert bits back to float
-        x = x * (1.5f - xhalf * x * x); // Newton step, repeating increases accuracy
+        x = x * (1.5f - halfX * x * x); // Newton step, repeating increases accuracy
         return x;
     }
 

+ 2 - 2
jme3-core/src/main/java/com/jme3/scene/shape/PQTorus.java

@@ -136,7 +136,7 @@ public class PQTorus extends Mesh {
         Vector3f pointB, T, N, B;
         Vector3f tempNorm = new Vector3f();
         float r, x, y, z, theta = 0.0f, beta;
-        int nvertex = 0;
+        int nVertex = 0;
 
         // Move along the length of the pq torus
         for (int i = 0; i < steps; i++) {
@@ -167,7 +167,7 @@ public class PQTorus extends Mesh {
             N = N.normalize();
             B = B.normalize();
             beta = 0.0f;
-            for (int j = 0; j < radialSamples; j++, nvertex++) {
+            for (int j = 0; j < radialSamples; j++, nVertex++) {
                 beta += betaStep;
                 float cx = FastMath.cos(beta) * width;
                 float cy = FastMath.sin(beta) * width;

+ 3 - 3
jme3-core/src/main/java/com/jme3/shadow/ShadowUtil.java

@@ -186,16 +186,16 @@ public class ShadowUtil {
      */
     public static BoundingBox computeUnionBound(GeometryList list, Transform transform) {
         BoundingBox bbox = new BoundingBox();
-        TempVars tempv = TempVars.get();
+        TempVars tempVars = TempVars.get();
         for (int i = 0; i < list.size(); i++) {
             BoundingVolume vol = list.get(i).getWorldBound();
-            BoundingVolume newVol = vol.transform(transform, tempv.bbox);
+            BoundingVolume newVol = vol.transform(transform, tempVars.bbox);
             //Nehon : prevent NaN and infinity values to screw the final bounding box
             if (!Float.isNaN(newVol.getCenter().x) && !Float.isInfinite(newVol.getCenter().x)) {
                 bbox.mergeLocal(newVol);
             }
         }
-        tempv.release();
+        tempVars.release();
         return bbox;
     }
 

+ 2 - 2
jme3-core/src/main/java/com/jme3/util/IntMap.java

@@ -167,14 +167,14 @@ public final class IntMap<T> implements Iterable<Entry<T>>, Cloneable, JmeClonea
             int newCapacity = 2 * capacity;
             Entry[] newTable = new Entry[newCapacity];
             Entry[] src = table;
-            int bucketmask = newCapacity - 1;
+            int bucketMask = newCapacity - 1;
             for (int j = 0; j < src.length; j++){
                 Entry e = src[j];
                 if (e != null){
                     src[j] = null;
                     do{
                         Entry next = e.next;
-                        index = e.key & bucketmask;
+                        index = e.key & bucketMask;
                         e.next = newTable[index];
                         newTable[index] = e;
                         e = next;

+ 6 - 6
jme3-core/src/test/java/com/jme3/scene/shape/ShapeBoundsTest.java

@@ -58,12 +58,12 @@ public class ShapeBoundsTest {
 
     @Test
     public void testCurve() {
-        Vector3f[] controlp = new Vector3f[4];
-        controlp[0] = new Vector3f(0, 0, 0);
-        controlp[1] = new Vector3f(1, 1, 1);
-        controlp[2] = new Vector3f(2, 1, 1);
-        controlp[3] = new Vector3f(3, 2, 1);
-        Curve shape = new Curve(controlp, 32);
+        Vector3f[] controlPoints = new Vector3f[4];
+        controlPoints[0] = new Vector3f(0, 0, 0);
+        controlPoints[1] = new Vector3f(1, 1, 1);
+        controlPoints[2] = new Vector3f(2, 1, 1);
+        controlPoints[3] = new Vector3f(3, 2, 1);
+        Curve shape = new Curve(controlPoints, 32);
         Geometry geometry = new Geometry("geom", shape);
         testBounds(geometry);
     }

+ 3 - 3
jme3-core/src/tools/java/jme3tools/shader/ShaderDebug.java

@@ -50,11 +50,11 @@ public class ShaderDebug {
      */
     public static String formatShaderSource(String source) {      
         String[] sourceLines = source.split("\n");
-        int nblines = 0;
+        int lineNumber = 0;
         StringBuilder out = new StringBuilder();       
         for (String string : sourceLines) {
-            nblines++;
-            out.append(nblines).append("\t").append(string).append("\n");
+            lineNumber++;
+            out.append(lineNumber).append("\t").append(string).append("\n");
         }
         return out.toString();
     }

+ 6 - 6
jme3-examples/src/main/java/jme3test/batching/TestBatchNodeTower.java

@@ -142,15 +142,15 @@ public class TestBatchNodeTower extends SimpleApplication {
         @Override
         public void onAction(String name, boolean keyPressed, float tpf) {
             if (name.equals("shoot") && !keyPressed) {
-                Geometry bulletg = new Geometry("bullet", bullet);
-                bulletg.setMaterial(mat2);
-                bulletg.setShadowMode(ShadowMode.CastAndReceive);
-                bulletg.setLocalTranslation(cam.getLocation());
+                Geometry bulletGeometry = new Geometry("bullet", bullet);
+                bulletGeometry.setMaterial(mat2);
+                bulletGeometry.setShadowMode(ShadowMode.CastAndReceive);
+                bulletGeometry.setLocalTranslation(cam.getLocation());
                 RigidBodyControl bulletNode = new BombControl(assetManager, bulletCollisionShape, 1);
 //                RigidBodyControl bulletNode = new RigidBodyControl(bulletCollisionShape, 1);
                 bulletNode.setLinearVelocity(cam.getDirection().mult(25));
-                bulletg.addControl(bulletNode);
-                rootNode.attachChild(bulletg);
+                bulletGeometry.addControl(bulletNode);
+                rootNode.attachChild(bulletGeometry);
                 getPhysicsSpace().add(bulletNode);
             }
         }

+ 7 - 7
jme3-examples/src/main/java/jme3test/bullet/PhysicsTestHelper.java

@@ -240,15 +240,15 @@ public class PhysicsTestHelper {
                 Texture tex2 = app.getAssetManager().loadTexture(key2);
                 mat2.setTexture("ColorMap", tex2);
                 if (name.equals("shoot") && !keyPressed) {
-                    Geometry bulletg = new Geometry("bullet", bullet);
-                    bulletg.setMaterial(mat2);
-                    bulletg.setShadowMode(ShadowMode.CastAndReceive);
-                    bulletg.setLocalTranslation(app.getCamera().getLocation());
+                    Geometry bulletGeometry = new Geometry("bullet", bullet);
+                    bulletGeometry.setMaterial(mat2);
+                    bulletGeometry.setShadowMode(ShadowMode.CastAndReceive);
+                    bulletGeometry.setLocalTranslation(app.getCamera().getLocation());
                     RigidBodyControl bulletControl = new RigidBodyControl(10);
-                    bulletg.addControl(bulletControl);
+                    bulletGeometry.addControl(bulletControl);
                     bulletControl.setLinearVelocity(app.getCamera().getDirection().mult(25));
-                    bulletg.addControl(bulletControl);
-                    rootNode.attachChild(bulletg);
+                    bulletGeometry.addControl(bulletControl);
+                    rootNode.attachChild(bulletGeometry);
                     space.add(bulletControl);
                 }
             }

+ 6 - 6
jme3-examples/src/main/java/jme3test/bullet/TestBoneRagdoll.java

@@ -91,18 +91,18 @@ public class TestBoneRagdoll
     @Override
     public void onAction(String name, boolean isPressed, float tpf) {
         if (name.equals("boom") && !isPressed) {
-            Geometry bulletg = new Geometry("bullet", bullet);
-            bulletg.setMaterial(matBullet);
-            bulletg.setLocalTranslation(cam.getLocation());
-            bulletg.setLocalScale(bulletSize);
+            Geometry bulletGeometry = new Geometry("bullet", bullet);
+            bulletGeometry.setMaterial(matBullet);
+            bulletGeometry.setLocalTranslation(cam.getLocation());
+            bulletGeometry.setLocalScale(bulletSize);
             bulletCollisionShape = new SphereCollisionShape(bulletSize);
             BombControl bulletNode = new BombControl(assetManager, bulletCollisionShape, 1f);
             bulletNode.setForceFactor(8f);
             bulletNode.setExplosionRadius(20f);
             bulletNode.setCcdMotionThreshold(0.001f);
             bulletNode.setLinearVelocity(cam.getDirection().mult(180f));
-            bulletg.addControl(bulletNode);
-            rootNode.attachChild(bulletg);
+            bulletGeometry.addControl(bulletNode);
+            rootNode.attachChild(bulletGeometry);
             physicsSpace.add(bulletNode);
         }
         if (name.equals("bullet+") && isPressed) {

+ 15 - 15
jme3-examples/src/main/java/jme3test/bullet/TestBrickTower.java

@@ -144,15 +144,15 @@ public class TestBrickTower extends SimpleApplication {
         @Override
         public void onAction(String name, boolean keyPressed, float tpf) {
             if (name.equals("shoot") && !keyPressed) {
-                Geometry bulletg = new Geometry("bullet", bullet);
-                bulletg.setMaterial(mat2);
-                bulletg.setShadowMode(ShadowMode.CastAndReceive);
-                bulletg.setLocalTranslation(cam.getLocation());
+                Geometry bulletGeometry = new Geometry("bullet", bullet);
+                bulletGeometry.setMaterial(mat2);
+                bulletGeometry.setShadowMode(ShadowMode.CastAndReceive);
+                bulletGeometry.setLocalTranslation(cam.getLocation());
                 RigidBodyControl bulletNode = new BombControl(assetManager, bulletCollisionShape, 1);
 //                RigidBodyControl bulletNode = new RigidBodyControl(bulletCollisionShape, 1);
                 bulletNode.setLinearVelocity(cam.getDirection().mult(25));
-                bulletg.addControl(bulletNode);
-                rootNode.attachChild(bulletg);
+                bulletGeometry.addControl(bulletNode);
+                rootNode.attachChild(bulletGeometry);
                 getPhysicsSpace().add(bulletNode);
             }
         }
@@ -227,15 +227,15 @@ public class TestBrickTower extends SimpleApplication {
     }
 
     public void addBrick(Vector3f ori) {
-        Geometry reBoxg = new Geometry("brick", brick);
-        reBoxg.setMaterial(mat);
-        reBoxg.setLocalTranslation(ori);
-        reBoxg.rotate(0f, (float)Math.toRadians(angle) , 0f );
-        reBoxg.addControl(new RigidBodyControl(1.5f));
-        reBoxg.setShadowMode(ShadowMode.CastAndReceive);
-        reBoxg.getControl(RigidBodyControl.class).setFriction(1.6f);
-        this.rootNode.attachChild(reBoxg);
-        this.getPhysicsSpace().add(reBoxg);
+        Geometry brickGeometry = new Geometry("brick", brick);
+        brickGeometry.setMaterial(mat);
+        brickGeometry.setLocalTranslation(ori);
+        brickGeometry.rotate(0f, (float)Math.toRadians(angle) , 0f );
+        brickGeometry.addControl(new RigidBodyControl(1.5f));
+        brickGeometry.setShadowMode(ShadowMode.CastAndReceive);
+        brickGeometry.getControl(RigidBodyControl.class).setFriction(1.6f);
+        this.rootNode.attachChild(brickGeometry);
+        this.getPhysicsSpace().add(brickGeometry);
     }
 
     protected void initCrossHairs() {

+ 17 - 17
jme3-examples/src/main/java/jme3test/bullet/TestBrickWall.java

@@ -112,17 +112,17 @@ public class TestBrickWall extends SimpleApplication {
         @Override
         public void onAction(String name, boolean keyPressed, float tpf) {
             if (name.equals("shoot") && !keyPressed) {
-                Geometry bulletg = new Geometry("bullet", bullet);
-                bulletg.setMaterial(mat2);
-                bulletg.setShadowMode(ShadowMode.CastAndReceive);
-                bulletg.setLocalTranslation(cam.getLocation());
+                Geometry bulletGeometry = new Geometry("bullet", bullet);
+                bulletGeometry.setMaterial(mat2);
+                bulletGeometry.setShadowMode(ShadowMode.CastAndReceive);
+                bulletGeometry.setLocalTranslation(cam.getLocation());
                 
                 SphereCollisionShape bulletCollisionShape = new SphereCollisionShape(0.4f);
                 RigidBodyControl bulletNode = new BombControl(assetManager, bulletCollisionShape, 1);
 //                RigidBodyControl bulletNode = new RigidBodyControl(bulletCollisionShape, 1);
                 bulletNode.setLinearVelocity(cam.getDirection().mult(25));
-                bulletg.addControl(bulletNode);
-                rootNode.attachChild(bulletg);
+                bulletGeometry.addControl(bulletNode);
+                rootNode.attachChild(bulletGeometry);
                 getPhysicsSpace().add(bulletNode);
             }
             if (name.equals("gc") && !keyPressed) {
@@ -132,14 +132,14 @@ public class TestBrickWall extends SimpleApplication {
     };
 
     public void initWall() {
-        float startpt = bLength / 4;
+        float startX = bLength / 4;
         float height = 0;
         for (int j = 0; j < 15; j++) {
             for (int i = 0; i < 4; i++) {
-                Vector3f vt = new Vector3f(i * bLength * 2 + startpt, bHeight + height, 0);
+                Vector3f vt = new Vector3f(i * bLength * 2 + startX, bHeight + height, 0);
                 addBrick(vt);
             }
-            startpt = -startpt;
+            startX = -startX;
             height += 2 * bHeight;
         }
     }
@@ -180,15 +180,15 @@ public class TestBrickWall extends SimpleApplication {
 
     public void addBrick(Vector3f ori) {
 
-        Geometry reBoxg = new Geometry("brick", brick);
-        reBoxg.setMaterial(mat);
-        reBoxg.setLocalTranslation(ori);
+        Geometry brickGeometry = new Geometry("brick", brick);
+        brickGeometry.setMaterial(mat);
+        brickGeometry.setLocalTranslation(ori);
         //for geometry with sphere mesh the physics system automatically uses a sphere collision shape
-        reBoxg.addControl(new RigidBodyControl(1.5f));
-        reBoxg.setShadowMode(ShadowMode.CastAndReceive);
-        reBoxg.getControl(RigidBodyControl.class).setFriction(0.6f);
-        this.rootNode.attachChild(reBoxg);
-        this.getPhysicsSpace().add(reBoxg);
+        brickGeometry.addControl(new RigidBodyControl(1.5f));
+        brickGeometry.setShadowMode(ShadowMode.CastAndReceive);
+        brickGeometry.getControl(RigidBodyControl.class).setFriction(0.6f);
+        this.rootNode.attachChild(brickGeometry);
+        this.getPhysicsSpace().add(brickGeometry);
     }
 
     protected void initCrossHairs() {

+ 19 - 19
jme3-examples/src/main/java/jme3test/bullet/TestCcd.java

@@ -128,26 +128,26 @@ public class TestCcd extends SimpleApplication implements ActionListener {
     @Override
     public void onAction(String binding, boolean value, float tpf) {
         if (binding.equals("shoot") && !value) {
-            Geometry bulletg = new Geometry("bullet", bullet);
-            bulletg.setMaterial(mat);
-            bulletg.setName("bullet");
-            bulletg.setLocalTranslation(cam.getLocation());
-            bulletg.setShadowMode(ShadowMode.CastAndReceive);
-            bulletg.addControl(new RigidBodyControl(bulletCollisionShape, 1));
-            bulletg.getControl(RigidBodyControl.class).setCcdMotionThreshold(0.1f);
-            bulletg.getControl(RigidBodyControl.class).setLinearVelocity(cam.getDirection().mult(40));
-            rootNode.attachChild(bulletg);
-            getPhysicsSpace().add(bulletg);
+            Geometry bulletGeometry = new Geometry("bullet", bullet);
+            bulletGeometry.setMaterial(mat);
+            bulletGeometry.setName("bullet");
+            bulletGeometry.setLocalTranslation(cam.getLocation());
+            bulletGeometry.setShadowMode(ShadowMode.CastAndReceive);
+            bulletGeometry.addControl(new RigidBodyControl(bulletCollisionShape, 1));
+            bulletGeometry.getControl(RigidBodyControl.class).setCcdMotionThreshold(0.1f);
+            bulletGeometry.getControl(RigidBodyControl.class).setLinearVelocity(cam.getDirection().mult(40));
+            rootNode.attachChild(bulletGeometry);
+            getPhysicsSpace().add(bulletGeometry);
         } else if (binding.equals("shoot2") && !value) {
-            Geometry bulletg = new Geometry("bullet", bullet);
-            bulletg.setMaterial(mat2);
-            bulletg.setName("bullet");
-            bulletg.setLocalTranslation(cam.getLocation());
-            bulletg.setShadowMode(ShadowMode.CastAndReceive);
-            bulletg.addControl(new RigidBodyControl(bulletCollisionShape, 1));
-            bulletg.getControl(RigidBodyControl.class).setLinearVelocity(cam.getDirection().mult(40));
-            rootNode.attachChild(bulletg);
-            getPhysicsSpace().add(bulletg);
+            Geometry bulletGeometry = new Geometry("bullet", bullet);
+            bulletGeometry.setMaterial(mat2);
+            bulletGeometry.setName("bullet");
+            bulletGeometry.setLocalTranslation(cam.getLocation());
+            bulletGeometry.setShadowMode(ShadowMode.CastAndReceive);
+            bulletGeometry.addControl(new RigidBodyControl(bulletCollisionShape, 1));
+            bulletGeometry.getControl(RigidBodyControl.class).setLinearVelocity(cam.getDirection().mult(40));
+            rootNode.attachChild(bulletGeometry);
+            getPhysicsSpace().add(bulletGeometry);
         }
     }
 }

+ 9 - 9
jme3-examples/src/main/java/jme3test/bullet/TestRagdollCharacter.java

@@ -205,15 +205,15 @@ public class TestRagdollCharacter
         for (int j = 0; j < 15; j++) {
             for (int i = 0; i < 4; i++) {
                 Vector3f ori = new Vector3f(i * bLength * 2f + startpt, bHeight + height, -10f);
-                Geometry reBoxg = new Geometry("brick", brick);
-                reBoxg.setMaterial(mat2);
-                reBoxg.setLocalTranslation(ori);
-                //for geometry with sphere mesh the physics system automatically uses a sphere collision shape
-                reBoxg.addControl(new RigidBodyControl(1.5f));
-                reBoxg.setShadowMode(ShadowMode.CastAndReceive);
-                reBoxg.getControl(RigidBodyControl.class).setFriction(0.6f);
-                this.rootNode.attachChild(reBoxg);
-                physicsSpace.add(reBoxg);
+                Geometry brickGeometry = new Geometry("brick", brick);
+                brickGeometry.setMaterial(mat2);
+                brickGeometry.setLocalTranslation(ori);
+                // for geometry with sphere mesh the physics system automatically uses a sphere collision shape
+                brickGeometry.addControl(new RigidBodyControl(1.5f));
+                brickGeometry.setShadowMode(ShadowMode.CastAndReceive);
+                brickGeometry.getControl(RigidBodyControl.class).setFriction(0.6f);
+                this.rootNode.attachChild(brickGeometry);
+                physicsSpace.add(brickGeometry);
             }
             startpt = -startpt;
             height += 2f * bHeight;

+ 13 - 13
jme3-examples/src/main/java/jme3test/bullet/TestWalkingChar.java

@@ -179,13 +179,13 @@ public class TestWalkingChar extends SimpleApplication
     }
 
     private void addBrick(Vector3f ori) {
-        Geometry reBoxg = new Geometry("brick", brick);
-        reBoxg.setMaterial(matBullet);
-        reBoxg.setLocalTranslation(ori);
-        reBoxg.addControl(new RigidBodyControl(1.5f));
-        reBoxg.setShadowMode(ShadowMode.CastAndReceive);
-        this.rootNode.attachChild(reBoxg);
-        this.getPhysicsSpace().add(reBoxg);
+        Geometry brickGeometry = new Geometry("brick", brick);
+        brickGeometry.setMaterial(matBullet);
+        brickGeometry.setLocalTranslation(ori);
+        brickGeometry.addControl(new RigidBodyControl(1.5f));
+        brickGeometry.setShadowMode(ShadowMode.CastAndReceive);
+        this.rootNode.attachChild(brickGeometry);
+        this.getPhysicsSpace().add(brickGeometry);
     }
 
     private void prepareBullet() {
@@ -421,15 +421,15 @@ public class TestWalkingChar extends SimpleApplication
     private void bulletControl() {
         composer.setCurrentAction("shootOnce", "shootingLayer");
 
-        Geometry bulletg = new Geometry("bullet", bullet);
-        bulletg.setMaterial(matBullet);
-        bulletg.setShadowMode(ShadowMode.CastAndReceive);
-        bulletg.setLocalTranslation(character.getPhysicsLocation().add(cam.getDirection().mult(5)));
+        Geometry bulletGeometry = new Geometry("bullet", bullet);
+        bulletGeometry.setMaterial(matBullet);
+        bulletGeometry.setShadowMode(ShadowMode.CastAndReceive);
+        bulletGeometry.setLocalTranslation(character.getPhysicsLocation().add(cam.getDirection().mult(5)));
         RigidBodyControl bulletControl = new BombControl(bulletCollisionShape, 1);
         bulletControl.setCcdMotionThreshold(0.1f);
         bulletControl.setLinearVelocity(cam.getDirection().mult(80));
-        bulletg.addControl(bulletControl);
-        rootNode.attachChild(bulletg);
+        bulletGeometry.addControl(bulletControl);
+        rootNode.attachChild(bulletGeometry);
         getPhysicsSpace().add(bulletControl);
     }
 

+ 3 - 3
jme3-examples/src/main/java/jme3test/helloworld/HelloPhysics.java

@@ -163,15 +163,15 @@ public class HelloPhysics extends SimpleApplication {
 
   /** This loop builds a wall out of individual bricks. */
   public void initWall() {
-    float startpt = brickLength / 4;
+    float startX = brickLength / 4;
     float height = 0;
     for (int j = 0; j < 15; j++) {
       for (int i = 0; i < 6; i++) {
         Vector3f vt =
-         new Vector3f(i * brickLength * 2 + startpt, brickHeight + height, 0);
+         new Vector3f(i * brickLength * 2 + startX, brickHeight + height, 0);
         makeBrick(vt);
       }
-      startpt = -startpt;
+      startX = -startX;
       height += 2 * brickHeight;
     }
   }

+ 2 - 2
jme3-examples/src/main/java/jme3test/input/TestJoystick.java

@@ -465,8 +465,8 @@ public class TestJoystick extends SimpleApplication {
     
     private void pickGamePad(Vector2f mouseLoc){
         if (lastButton != null) {
-            CollisionResults cresults = pick(cam, mouseLoc, gamepad);
-            for (CollisionResult cr : cresults) {
+            CollisionResults results = pick(cam, mouseLoc, gamepad);
+            for (CollisionResult cr : results) {
                 Node n = cr.getGeometry().getParent();
                 if (n != null && (n instanceof ButtonView)) {
                     String b = n.getName().substring("Button:".length());

+ 2 - 2
jme3-examples/src/main/java/jme3test/material/TestShaderNodes.java

@@ -23,8 +23,8 @@ public class TestShaderNodes extends SimpleApplication {
     public void simpleInitApp() {
         flyCam.setMoveSpeed(20);
         Logger.getLogger("com.jme3").setLevel(Level.WARNING);
-        Box boxshape1 = new Box(1f, 1f, 1f);
-        Geometry cube_tex = new Geometry("A Textured Box", boxshape1);
+        Box boxShape1 = new Box(1f, 1f, 1f);
+        Geometry cube_tex = new Geometry("A Textured Box", boxShape1);
         Texture tex = assetManager.loadTexture("Interface/Logo/Monkey.jpg");
 
         Material mat = new Material(assetManager, "Common/MatDefs/Misc/UnshadedNodes.j3md");

+ 1 - 1
jme3-examples/src/main/java/jme3test/model/anim/TestAnimationFactory.java

@@ -41,7 +41,7 @@ public class TestAnimationFactory extends SimpleApplication {
         Box child = new Box(0.5f, 0.5f, 0.5f);
         Geometry childGeom = new Geometry("box", child);
         childGeom.setMaterial(assetManager.loadMaterial("Textures/Terrain/BrickWall/BrickWall.j3m"));
-        Node childModel = new Node("childmodel");
+        Node childModel = new Node("child model");
         childModel.setLocalTranslation(2, 2, 2);
         childModel.attachChild(childGeom);
         model.attachChild(childModel);

+ 8 - 8
jme3-examples/src/main/java/jme3test/post/TestPostFiltersCompositing.java

@@ -85,15 +85,15 @@ public class TestPostFiltersCompositing extends SimpleApplication {
 
         viewPort.setOutputFrameBuffer(mainVPFrameBuffer);
 
-        //creating the post processor for the gui viewport
-        final FilterPostProcessor guifpp = new FilterPostProcessor(assetManager);
-        guifpp.setFrameBufferFormat(Image.Format.RGBA8);
-        guifpp.addFilter(new ColorOverlayFilter(ColorRGBA.Red));
-        //this will compose the main viewport texture with the guiviewport back buffer.
-        //Note that you can switch the order of the filters so that guiviewport filters are applied or not to the main viewport texture
-        guifpp.addFilter(new ComposeFilter(mainVPTexture));
+        // Create the post processor for the GUI viewport.
+        final FilterPostProcessor guiFpp = new FilterPostProcessor(assetManager);
+        guiFpp.setFrameBufferFormat(Image.Format.RGBA8);
+        guiFpp.addFilter(new ColorOverlayFilter(ColorRGBA.Red));
+        // This will compose the main viewport texture with the GUI-viewport back buffer.
+        // Note that you can switch the order of the filters so that GUI-viewport filters are applied or not to the main viewport texture
+        guiFpp.addFilter(new ComposeFilter(mainVPTexture));
 
-        guiViewPort.addProcessor(guifpp);
+        guiViewPort.addProcessor(guiFpp);
         
         // Compositing is done by mixing texture depending on the alpha channel, so
         // it's important that the GUI-viewport clear-color alpha value is set to 0.

+ 2 - 2
jme3-examples/src/main/java/jme3test/renderer/TestDepthFuncChange.java

@@ -57,8 +57,8 @@ public class TestDepthFuncChange extends SimpleApplication {
         //2 cubes, a blue and a red. the red cube is offset by 0.2 WU to the right   
         //the red cube is put in the transparent bucket to be sure it's rendered after the blue one (but there is no transparency involved).
         //You should see a small part of the blue cube on the left and the whole red cube
-        Box boxshape1 = new Box(1f, 1f, 1f);
-        Geometry cube1 = new Geometry("box", boxshape1);
+        Box boxShape1 = new Box(1f, 1f, 1f);
+        Geometry cube1 = new Geometry("box", boxShape1);
         Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
         mat.setColor("Color", ColorRGBA.Blue);
         

+ 2 - 2
jme3-jbullet/src/main/java/com/jme3/bullet/joints/SixDofJoint.java

@@ -122,8 +122,8 @@ public class SixDofJoint extends PhysicsJoint {
 
     private void gatherMotors() {
         for (int i = 0; i < 3; i++) {
-            RotationalLimitMotor rmot = new RotationalLimitMotor(((Generic6DofConstraint) constraint).getRotationalLimitMotor(i));
-            rotationalMotors.add(rmot);
+            RotationalLimitMotor rMotor = new RotationalLimitMotor(((Generic6DofConstraint) constraint).getRotationalLimitMotor(i));
+            rotationalMotors.add(rMotor);
         }
         translationalMotor = new TranslationalLimitMotor(((Generic6DofConstraint) constraint).getTranslationalLimitMotor());
     }

+ 3 - 3
jme3-vr/src/main/java/com/jme3/app/VRApplication.java

@@ -717,10 +717,10 @@ public abstract class VRApplication implements Application, SystemListener {
                 settings.setDepthBits(24);
                 settings.setVSync(true);
                 // try and read resolution from file in local dir
-                File resfile = new File("resolution.txt");
-                if( resfile.exists() ) {
+                File resFile = new File("resolution.txt");
+                if( resFile.exists() ) {
                     try {
-                        BufferedReader br = new BufferedReader(new FileReader(resfile));
+                        BufferedReader br = new BufferedReader(new FileReader(resFile));
                         settings.setWidth(Integer.parseInt(br.readLine()));
                         settings.setHeight(Integer.parseInt(br.readLine()));
                         try {

+ 3 - 3
jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java

@@ -349,9 +349,9 @@ public class LWJGLOpenVR implements VRAPI {
 
             HmdMatrix34 mat = HmdMatrix34.create();
             VRSystem.VRSystem_GetSeatedZeroPoseToStandingAbsoluteTrackingPose(mat);
-            Matrix4f tempmat = new Matrix4f();
-            convertSteamVRMatrix3ToMatrix4f(mat, tempmat);
-            tempmat.toTranslationVector(hmdSeatToStand);
+            Matrix4f tempMatrix = new Matrix4f();
+            convertSteamVRMatrix3ToMatrix4f(mat, tempMatrix);
+            tempMatrix.toTranslationVector(hmdSeatToStand);
         }
         return hmdSeatToStand;
     }

+ 4 - 4
jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusVRInput.java

@@ -135,14 +135,14 @@ public class OculusVRInput implements VRInputAPI {
         OculusViewManager vrvm = (OculusViewManager) hardware.getEnvironment().getVRViewManager();
 
         Object obs = env.getObserver();
-        Quaternion tempq = new Quaternion(); // TODO move to class scope?
+        Quaternion tempQuaternion = new Quaternion(); // TODO move to class scope?
         if (obs instanceof Camera) {
-            tempq.set(((Camera) obs).getRotation());
+            tempQuaternion.set(((Camera) obs).getRotation());
         } else {
-            tempq.set(((Spatial) obs).getWorldRotation());
+            tempQuaternion.set(((Spatial) obs).getWorldRotation());
         }
 
-        return tempq.multLocal(getOrientation(index));
+        return tempQuaternion.multLocal(getOrientation(index));
     }
 
     @Override

+ 10 - 10
jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRMouseManager.java

@@ -47,29 +47,29 @@ public class OpenVRMouseManager 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();

+ 3 - 3
jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java

@@ -539,9 +539,9 @@ public class OpenVRViewManager extends AbstractVRViewManager {
     private ViewPort setupMirrorBuffers(Camera cam, Texture tex, boolean expand) {
         if (environment != null){
             if (environment.getApplication() != null){
-                Camera clonecam = cam.clone();
-                ViewPort viewPort = environment.getApplication().getRenderManager().createPostView("MirrorView", clonecam);
-                clonecam.setParallelProjection(true);
+                Camera cloneCam = cam.clone();
+                ViewPort viewPort = environment.getApplication().getRenderManager().createPostView("MirrorView", cloneCam);
+                cloneCam.setParallelProjection(true);
                 viewPort.setClearFlags(true, true, true);
                 viewPort.setBackgroundColor(ColorRGBA.Black);
                 Picture pic = new Picture("fullscene");

+ 3 - 3
jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java

@@ -668,9 +668,9 @@ public class OSVRViewManager extends AbstractVRViewManager{
     private ViewPort setupMirrorBuffers(Camera cam, Texture tex, boolean expand) {
         if (environment != null){
             if (environment.getApplication() != null){
-                Camera clonecam = cam.clone();
-                ViewPort viewPort = environment.getApplication().getRenderManager().createPostView("MirrorView", clonecam);
-                clonecam.setParallelProjection(true);
+                Camera cloneCam = cam.clone();
+                ViewPort viewPort = environment.getApplication().getRenderManager().createPostView("MirrorView", cloneCam);
+                cloneCam.setParallelProjection(true);
                 viewPort.setClearFlags(true, true, true);
                 viewPort.setBackgroundColor(ColorRGBA.Black);
                 Picture pic = new Picture("fullscene");