Browse Source

rename more method arguments for clarity (#1742)

* rename a couple method args

* KinematicRagdollControl: rename "reccount"

* rename 2 method args

* rename method args
Stephen Gold 3 năm trước cách đây
mục cha
commit
c183ff013b

+ 2 - 2
jme3-android/src/main/java/com/jme3/renderer/android/AndroidGL.java

@@ -580,8 +580,8 @@ public class AndroidGL implements GL, GL2, GLES_30, GLExt, GLFbo {
     }
 
     @Override
-    public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations) {
-        GLES31.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations);
+    public void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedSampleLocations) {
+        GLES31.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedSampleLocations);
     }
 
     @Override

+ 5 - 5
jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java

@@ -673,10 +673,10 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
      * @param model the spatial with the model's SkeletonControl (not null)
      * @param bone the bone to be linked (not null)
      * @param parent the body linked to the parent bone (not null)
-     * @param reccount depth of the recursion (≥1)
+     * @param recursionCount depth of the recursion (≥1)
      * @param pointsMap (not null)
      */
-    protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int reccount, Map<Integer, List<Float>> pointsMap) {
+    protected void boneRecursion(Spatial model, Bone bone, PhysicsRigidBody parent, int recursionCount, Map<Integer, List<Float>> pointsMap) {
         PhysicsRigidBody parentShape = parent;
         if (boneList.contains(bone.getName())) {
 
@@ -693,10 +693,10 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
                 shape = RagdollUtils.makeShapeFromVerticeWeights(model, RagdollUtils.getBoneIndices(link.bone, skeleton, boneList), initScale, link.bone.getModelSpacePosition(), weightThreshold);
             }
 
-            PhysicsRigidBody shapeNode = new PhysicsRigidBody(shape, rootMass / reccount);
+            PhysicsRigidBody shapeNode = new PhysicsRigidBody(shape, rootMass / recursionCount);
 
             shapeNode.setKinematic(mode == Mode.Kinematic);
-            totalMass += rootMass / reccount;
+            totalMass += rootMass / recursionCount;
 
             link.rigidBody = shapeNode;
             link.initalWorldRotation = bone.getModelSpaceRotation().clone();
@@ -721,7 +721,7 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
 
         for (Iterator<Bone> it = bone.getChildren().iterator(); it.hasNext();) {
             Bone childBone = it.next();
-            boneRecursion(model, childBone, parentShape, reccount + 1, pointsMap);
+            boneRecursion(model, childBone, parentShape, recursionCount + 1, pointsMap);
         }
     }
 

+ 4 - 4
jme3-core/src/main/java/com/jme3/audio/Environment.java

@@ -94,8 +94,8 @@ public class Environment {
     }
 
     public Environment(float density, float diffusion, float gain, float gainHf,
-                       float decayTime, float decayHf, float reflGain,
-                       float reflDelay, float lateGain, float lateDelay) {
+                       float decayTime, float decayHf, float reflectGain,
+                       float reflectDelay, float lateGain, float lateDelay) {
         this.decayTime = decayTime;
         this.decayHFRatio = decayHf;
         this.density = density;
@@ -104,8 +104,8 @@ public class Environment {
         this.gainHf = gainHf;
         this.lateReverbDelay = lateDelay;
         this.lateReverbGain = lateGain;
-        this.reflectDelay = reflDelay;
-        this.reflectGain = reflGain;
+        this.reflectDelay = reflectDelay;
+        this.reflectGain = reflectGain;
     }
 
     public Environment(float[] e) {

+ 8 - 8
jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java

@@ -935,22 +935,22 @@ public class BoundingBox extends BoundingVolume {
      *
      * @param denom
      *            the denominator of the line segment.
-     * @param numer
+     * @param numerator
      *            the numerator of the line segment.
      * @param t
      *            test values of the plane.
      * @return true if the line segment intersects the plane, false otherwise.
      */
-    private boolean clip(float denom, float numer, float[] t) {
+    private boolean clip(float denom, float numerator, float[] t) {
         // Return value is 'true' if line segment intersects the current test
         // plane. Otherwise, 'false' is returned, in which case the line segment
         // is entirely clipped.
         if (denom > 0.0f) {
             // This is the old if statement...
-            // if (numer > denom * t[1]) {
+            // if (numerator > denom * t[1]) {
             //
             // The problem is that what is actually stored is
-            // numer/denom.  In non-floating point, this math should
+            // numerator/denom.  In non-floating point, this math should
             // work out the same but in floating point there can
             // be subtle math errors.  The multiply will exaggerate
             // errors that may have been introduced when the value
@@ -974,7 +974,7 @@ public class BoundingBox extends BoundingVolume {
             // angles and distances because they fail the bounding box test.
             // Many Bothans died bring you this fix.
             //    -pspeed
-            float newT = numer / denom;
+            float newT = numerator / denom;
             if (newT > t[1]) {
                 return false;
             }
@@ -984,12 +984,12 @@ public class BoundingBox extends BoundingVolume {
             return true;
         } else if (denom < 0.0f) {
             // Old if statement... see above
-            // if (numer > denom * t[0]) {
+            // if (numerator > denom * t[0]) {
             //
             // Note though that denom is always negative in this block.
             // When we move it over to the other side we have to flip
             // the comparison.  Algebra for the win.
-            float newT = numer / denom;
+            float newT = numerator / denom;
             if (newT < t[0]) {
                 return false;
             }
@@ -998,7 +998,7 @@ public class BoundingBox extends BoundingVolume {
             }
             return true;
         } else {
-            return numer <= 0.0;
+            return numerator <= 0.0;
         }
     }
 

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

@@ -390,9 +390,9 @@ public class EnvMapUtils {
 
     //see Lagarde's paper https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf
     //linear roughness
-    public static float getRoughnessFromMip(int miplevel, int miptot) {
+    public static float getRoughnessFromMip(int mipLevel, int miptot) {
         float step = 1f / ((float) miptot - 1);
-        step *= miplevel;
+        step *= mipLevel;
         return step * step;
     }
 

+ 4 - 4
jme3-core/src/main/java/com/jme3/util/mikktspace/MikktspaceTangentGenerator.java

@@ -1164,7 +1164,7 @@ public class MikktspaceTangentGenerator {
     }
 
     static TSpace evalTspace(int face_indices[], final int iFaces, final int piTriListIn[], final TriInfo pTriInfos[],
-            final MikkTSpaceContext mikkTSpace, final int iVertexRepresentitive) {
+            final MikkTSpaceContext mikkTSpace, final int iVertexRepresentative) {
         TSpace res = new TSpace();
         float fAngleSum = 0;        
 
@@ -1175,11 +1175,11 @@ public class MikktspaceTangentGenerator {
             if ((pTriInfos[f].flag & GROUP_WITH_ANY) == 0) {
                 
                 int i = -1;
-                if (piTriListIn[3 * f + 0] == iVertexRepresentitive) {
+                if (piTriListIn[3 * f + 0] == iVertexRepresentative) {
                     i = 0;
-                } else if (piTriListIn[3 * f + 1] == iVertexRepresentitive) {
+                } else if (piTriListIn[3 * f + 1] == iVertexRepresentative) {
                     i = 1;
-                } else if (piTriListIn[3 * f + 2] == iVertexRepresentitive) {
+                } else if (piTriListIn[3 * f + 2] == iVertexRepresentative) {
                     i = 2;
                 }
                 assert (i >= 0 && i < 3);

+ 4 - 4
jme3-desktop/src/main/java/com/jme3/app/state/MjpegFileWriter.java

@@ -109,9 +109,9 @@ public class MjpegFileWriter implements AutoCloseable {
         addImage(writeImageToBytes(image, quality));
     }
 
-    public void addImage(byte[] imagedata) throws Exception {
+    public void addImage(byte[] imageData) throws Exception {
         byte[] fcc = new byte[]{'0', '0', 'd', 'b'};
-        int useLength = imagedata.length;
+        int useLength = imageData.length;
         int extra = (useLength + (int) position) % 4;
         if (extra > 0) {
             useLength = useLength + extra;
@@ -122,7 +122,7 @@ public class MjpegFileWriter implements AutoCloseable {
         ByteArrayOutputStream baos = new ByteArrayOutputStream(fcc.length + 4 + useLength);
         baos.write(fcc);
         baos.write(intBytes(swapInt(useLength)));
-        baos.write(imagedata);
+        baos.write(imageData);
         if (extra > 0) {
             for (int i = 0; i < extra; i++) {
                 baos.write(0);
@@ -130,7 +130,7 @@ public class MjpegFileWriter implements AutoCloseable {
         }
         byte[] data = baos.toByteArray();
         aviOutput.write(data);
-        imagedata = null;
+        imageData = null;
 
         numFrames++; //add a frame
         position += data.length;

+ 61 - 61
jme3-desktop/src/main/java/com/jme3/cursors/plugins/CursorLoader.java

@@ -266,7 +266,7 @@ public class CursorLoader implements AssetLoader {
         return jmeCursor;
     }
 
-    private BufferedImage[] parseICOImage(byte[] icoimage) throws IOException {
+    private BufferedImage[] parseICOImage(byte[] icoImage) throws IOException {
         /*
          * Most of this is original code by Jeff Friesen at
          * http://www.informit.com/articles/article.aspx?p=1186882&seqNum=3
@@ -277,52 +277,52 @@ public class CursorLoader implements AssetLoader {
         int DE_LENGTH = 16; // directory entry length
         int BMIH_LENGTH = 40; // BITMAPINFOHEADER length
 
-        if (icoimage[2] != 1 && icoimage[2] != 2 || icoimage[3] != 0) {
+        if (icoImage[2] != 1 && icoImage[2] != 2 || icoImage[3] != 0) {
             throw new IllegalArgumentException("Bad data in ICO/CUR file. ImageType has to be either 1 or 2.");
         }
 
-        int numImages = ubyte(icoimage[5]);
+        int numImages = ubyte(icoImage[5]);
         numImages <<= 8;
-        numImages |= icoimage[4];
+        numImages |= icoImage[4];
         bi = new BufferedImage[numImages];
         int[] colorCount = new int[numImages];
 
         for (int i = 0; i < numImages; i++) {
-            int width = ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH]);
+            int width = ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH]);
 
-            int height = ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 1]);
+            int height = ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 1]);
 
-            colorCount[i] = ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 2]);
+            colorCount[i] = ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 2]);
 
-            int bytesInRes = ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 11]);
+            int bytesInRes = ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 11]);
             bytesInRes <<= 8;
-            bytesInRes |= ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 10]);
+            bytesInRes |= ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 10]);
             bytesInRes <<= 8;
-            bytesInRes |= ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 9]);
+            bytesInRes |= ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 9]);
             bytesInRes <<= 8;
-            bytesInRes |= ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 8]);
+            bytesInRes |= ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 8]);
 
-            int imageOffset = ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 15]);
+            int imageOffset = ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 15]);
             imageOffset <<= 8;
-            imageOffset |= ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 14]);
+            imageOffset |= ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 14]);
             imageOffset <<= 8;
-            imageOffset |= ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 13]);
+            imageOffset |= ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 13]);
             imageOffset <<= 8;
-            imageOffset |= ubyte(icoimage[FDE_OFFSET + i * DE_LENGTH + 12]);
+            imageOffset |= ubyte(icoImage[FDE_OFFSET + i * DE_LENGTH + 12]);
 
-            if (icoimage[imageOffset] == 40
-                    && icoimage[imageOffset + 1] == 0
-                    && icoimage[imageOffset + 2] == 0
-                    && icoimage[imageOffset + 3] == 0) {
+            if (icoImage[imageOffset] == 40
+                    && icoImage[imageOffset + 1] == 0
+                    && icoImage[imageOffset + 2] == 0
+                    && icoImage[imageOffset + 3] == 0) {
                 // BITMAPINFOHEADER detected
 
-                int _width = ubyte(icoimage[imageOffset + 7]);
+                int _width = ubyte(icoImage[imageOffset + 7]);
                 _width <<= 8;
-                _width |= ubyte(icoimage[imageOffset + 6]);
+                _width |= ubyte(icoImage[imageOffset + 6]);
                 _width <<= 8;
-                _width |= ubyte(icoimage[imageOffset + 5]);
+                _width |= ubyte(icoImage[imageOffset + 5]);
                 _width <<= 8;
-                _width |= ubyte(icoimage[imageOffset + 4]);
+                _width |= ubyte(icoImage[imageOffset + 4]);
 
                 // If width is 0 (for 256 pixels or higher), _width contains
                 // actual width.
@@ -331,13 +331,13 @@ public class CursorLoader implements AssetLoader {
                     width = _width;
                 }
 
-                int _height = ubyte(icoimage[imageOffset + 11]);
+                int _height = ubyte(icoImage[imageOffset + 11]);
                 _height <<= 8;
-                _height |= ubyte(icoimage[imageOffset + 10]);
+                _height |= ubyte(icoImage[imageOffset + 10]);
                 _height <<= 8;
-                _height |= ubyte(icoimage[imageOffset + 9]);
+                _height |= ubyte(icoImage[imageOffset + 9]);
                 _height <<= 8;
-                _height |= ubyte(icoimage[imageOffset + 8]);
+                _height |= ubyte(icoImage[imageOffset + 8]);
 
                 // If height is 0 (for 256 pixels or higher), _height contains
                 // actual height times 2.
@@ -345,13 +345,13 @@ public class CursorLoader implements AssetLoader {
                 if (height == 0) {
                     height = _height >> 1; // Divide by 2.
                 }
-                int planes = ubyte(icoimage[imageOffset + 13]);
+                int planes = ubyte(icoImage[imageOffset + 13]);
                 planes <<= 8;
-                planes |= ubyte(icoimage[imageOffset + 12]);
+                planes |= ubyte(icoImage[imageOffset + 12]);
 
-                int bitCount = ubyte(icoimage[imageOffset + 15]);
+                int bitCount = ubyte(icoImage[imageOffset + 15]);
                 bitCount <<= 8;
-                bitCount |= ubyte(icoimage[imageOffset + 14]);
+                bitCount |= ubyte(icoImage[imageOffset + 14]);
 
                 // If colorCount [i] is 0, the number of colors is determined
                 // from the planes and bitCount values. For example, the number
@@ -392,7 +392,7 @@ public class CursorLoader implements AssetLoader {
                         for (int col = 0; col < width; col++) {
                             int index;
 
-                            if ((ubyte(icoimage[xorImageOffset + row
+                            if ((ubyte(icoImage[xorImageOffset + row
                                     * scanlineBytes + col / 8])
                                     & masks[col % 8]) != 0) {
                                 index = 1;
@@ -401,16 +401,16 @@ public class CursorLoader implements AssetLoader {
                             }
 
                             int rgb = 0;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index * 4
+                            rgb |= (ubyte(icoImage[colorTableOffset + index * 4
                                     + 2]));
                             rgb <<= 8;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index * 4
+                            rgb |= (ubyte(icoImage[colorTableOffset + index * 4
                                     + 1]));
                             rgb <<= 8;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index
+                            rgb |= (ubyte(icoImage[colorTableOffset + index
                                     * 4]));
 
-                            if ((ubyte(icoimage[andImageOffset + row
+                            if ((ubyte(icoImage[andImageOffset + row
                                     * scanlineBytes + col / 8])
                                     & masks[col % 8]) != 0) {
                                 bi[i].setRGB(col, height - 1 - row, rgb);
@@ -433,26 +433,26 @@ public class CursorLoader implements AssetLoader {
                             int index;
                             if ((col & 1) == 0) // even
                             {
-                                index = ubyte(icoimage[xorImageOffset + row
+                                index = ubyte(icoImage[xorImageOffset + row
                                         * scanlineBytes + col / 2]);
                                 index >>= 4;
                             } else {
-                                index = ubyte(icoimage[xorImageOffset + row
+                                index = ubyte(icoImage[xorImageOffset + row
                                         * scanlineBytes + col / 2])
                                         & 15;
                             }
 
                             int rgb = 0;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index * 4
+                            rgb |= (ubyte(icoImage[colorTableOffset + index * 4
                                     + 2]));
                             rgb <<= 8;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index * 4
+                            rgb |= (ubyte(icoImage[colorTableOffset + index * 4
                                     + 1]));
                             rgb <<= 8;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index
+                            rgb |= (ubyte(icoImage[colorTableOffset + index
                                     * 4]));
 
-                            if ((ubyte(icoimage[andImageOffset + row
+                            if ((ubyte(icoImage[andImageOffset + row
                                     * calcScanlineBytes(width, 1)
                                     + col / 8]) & masks[col % 8])
                                     != 0) {
@@ -474,19 +474,19 @@ public class CursorLoader implements AssetLoader {
                     for (int row = 0; row < height; row++) {
                         for (int col = 0; col < width; col++) {
                             int index;
-                            index = ubyte(icoimage[xorImageOffset + row
+                            index = ubyte(icoImage[xorImageOffset + row
                                     * scanlineBytes + col]);
 
                             int rgb = 0;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index * 4
+                            rgb |= (ubyte(icoImage[colorTableOffset + index * 4
                                     + 2]));
                             rgb <<= 8;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index * 4
+                            rgb |= (ubyte(icoImage[colorTableOffset + index * 4
                                     + 1]));
                             rgb <<= 8;
-                            rgb |= (ubyte(icoimage[colorTableOffset + index * 4]));
+                            rgb |= (ubyte(icoImage[colorTableOffset + index * 4]));
 
-                            if ((ubyte(icoimage[andImageOffset + row
+                            if ((ubyte(icoImage[andImageOffset + row
                                     * calcScanlineBytes(width, 1)
                                     + col / 8]) & masks[col % 8])
                                     != 0) {
@@ -502,34 +502,34 @@ public class CursorLoader implements AssetLoader {
 
                     for (int row = 0; row < height; row++) {
                         for (int col = 0; col < width; col++) {
-                            int rgb = ubyte(icoimage[colorTableOffset + row
+                            int rgb = ubyte(icoImage[colorTableOffset + row
                                     * scanlineBytes + col * 4 + 3]);
                             rgb <<= 8;
-                            rgb |= ubyte(icoimage[colorTableOffset + row
+                            rgb |= ubyte(icoImage[colorTableOffset + row
                                     * scanlineBytes + col * 4 + 2]);
                             rgb <<= 8;
-                            rgb |= ubyte(icoimage[colorTableOffset + row
+                            rgb |= ubyte(icoImage[colorTableOffset + row
                                     * scanlineBytes + col * 4 + 1]);
                             rgb <<= 8;
-                            rgb |= ubyte(icoimage[colorTableOffset + row
+                            rgb |= ubyte(icoImage[colorTableOffset + row
                                     * scanlineBytes + col * 4]);
 
                             bi[i].setRGB(col, height - 1 - row, rgb);
                         }
                     }
                 }
-            } else if (ubyte(icoimage[imageOffset]) == 0x89
-                    && icoimage[imageOffset + 1] == 0x50
-                    && icoimage[imageOffset + 2] == 0x4e
-                    && icoimage[imageOffset + 3] == 0x47
-                    && icoimage[imageOffset + 4] == 0x0d
-                    && icoimage[imageOffset + 5] == 0x0a
-                    && icoimage[imageOffset + 6] == 0x1a
-                    && icoimage[imageOffset + 7] == 0x0a) {
+            } else if (ubyte(icoImage[imageOffset]) == 0x89
+                    && icoImage[imageOffset + 1] == 0x50
+                    && icoImage[imageOffset + 2] == 0x4e
+                    && icoImage[imageOffset + 3] == 0x47
+                    && icoImage[imageOffset + 4] == 0x0d
+                    && icoImage[imageOffset + 5] == 0x0a
+                    && icoImage[imageOffset + 6] == 0x1a
+                    && icoImage[imageOffset + 7] == 0x0a) {
                 // PNG detected
 
                 ByteArrayInputStream bais;
-                bais = new ByteArrayInputStream(icoimage, imageOffset,
+                bais = new ByteArrayInputStream(icoImage, imageOffset,
                         bytesInRes);
                 bi[i] = ImageIO.read(bais);
             } else {
@@ -537,7 +537,7 @@ public class CursorLoader implements AssetLoader {
                         + "expected");
             }
         }
-        icoimage = null; // This array can now be garbage collected.
+        icoImage = null; // This array can now be garbage collected.
 
         return bi;
     }

+ 2 - 2
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java

@@ -549,8 +549,8 @@ public class MeshLoader extends DefaultHandler implements AssetLoader {
         levels.add(vb);
     }
 
-    private void startLevelOfDetail(String numlevels) {
-//        numLevels = Integer.parseInt(numlevels);
+    private void startLevelOfDetail(String numLevels) {
+//        numLevels = Integer.parseInt(numLevels);
     }
 
     private void endLevelOfDetail() {