Selaa lähdekoodia

clarify some non-javadoc comments (#1712)

* clarify comments

* OSVRViewManager:  comment

* more comments

* ListSort: more comments
Stephen Gold 3 vuotta sitten
vanhempi
commit
8282b107e4
46 muutettua tiedostoa jossa 112 lisäystä ja 112 poistoa
  1. 1 1
      jme3-android/src/main/java/com/jme3/input/android/AndroidGestureProcessor.java
  2. 3 3
      jme3-android/src/main/java/com/jme3/input/android/AndroidJoystickJoyInput14.java
  3. 3 3
      jme3-android/src/main/java/com/jme3/input/android/AndroidTouchInput.java
  4. 1 1
      jme3-android/src/main/java/com/jme3/system/android/AndroidConfigChooser.java
  5. 2 2
      jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java
  6. 2 2
      jme3-bullet/src/common/java/com/jme3/bullet/control/KinematicRagdollControl.java
  7. 1 1
      jme3-core/src/main/java/com/jme3/animation/AnimChannel.java
  8. 2 2
      jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java
  9. 1 1
      jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java
  10. 1 1
      jme3-core/src/main/java/com/jme3/bounding/BoundingBox.java
  11. 4 4
      jme3-core/src/main/java/com/jme3/font/BitmapFont.java
  12. 6 5
      jme3-core/src/main/java/com/jme3/input/ChaseCamera.java
  13. 2 2
      jme3-core/src/main/java/com/jme3/renderer/IDList.java
  14. 2 2
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLImageFormats.java
  15. 1 1
      jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
  16. 1 1
      jme3-core/src/main/java/com/jme3/scene/BatchNode.java
  17. 1 1
      jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java
  18. 2 2
      jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java
  19. 24 24
      jme3-core/src/main/java/com/jme3/util/ListSort.java
  20. 1 1
      jme3-core/src/plugins/java/com/jme3/asset/plugins/HttpZipLocator.java
  21. 1 1
      jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java
  22. 4 4
      jme3-core/src/plugins/java/com/jme3/texture/plugins/ktx/KTXLoader.java
  23. 1 1
      jme3-core/src/test/java/com/jme3/light/LightFilterTest.java
  24. 2 2
      jme3-core/src/tools/java/jme3tools/optimize/GeometryBatchFactory.java
  25. 1 1
      jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglEvent.java
  26. 1 1
      jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java
  27. 3 3
      jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java
  28. 1 1
      jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java
  29. 1 1
      jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java
  30. 4 4
      jme3-networking/src/main/java/com/jme3/network/base/DefaultClient.java
  31. 5 5
      jme3-networking/src/main/java/com/jme3/network/base/DefaultServer.java
  32. 2 2
      jme3-networking/src/main/java/com/jme3/network/base/KernelAdapter.java
  33. 2 2
      jme3-networking/src/main/java/com/jme3/network/base/protocol/GreedyMessageBuffer.java
  34. 4 4
      jme3-networking/src/main/java/com/jme3/network/base/protocol/LazyMessageBuffer.java
  35. 2 3
      jme3-networking/src/main/java/com/jme3/network/service/rmi/ClassInfoRegistry.java
  36. 2 2
      jme3-niftygui/src/main/java/com/jme3/niftygui/InputSystemJme.java
  37. 1 1
      jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java
  38. 4 4
      jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java
  39. 1 1
      jme3-plugins/src/main/java/com/jme3/material/plugin/export/materialdef/J3mdTechniqueDefWriter.java
  40. 1 1
      jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.java
  41. 2 2
      jme3-vr/src/main/java/com/jme3/app/VRApplication.java
  42. 2 2
      jme3-vr/src/main/java/com/jme3/input/vr/AbstractVRViewManager.java
  43. 1 1
      jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java
  44. 1 1
      jme3-vr/src/main/java/com/jme3/input/vr/openvr/OpenVRViewManager.java
  45. 1 1
      jme3-vr/src/main/java/com/jme3/input/vr/osvr/OSVRViewManager.java
  46. 1 1
      jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java

+ 1 - 1
jme3-android/src/main/java/com/jme3/input/android/AndroidGestureProcessor.java

@@ -66,7 +66,7 @@ public class AndroidGestureProcessor implements
 
     @Override
     public boolean onDown(MotionEvent event) {
-        // start of all GestureListeners.  Not really a gesture by itself
+        // The start of all GestureListeners. Not really a gesture by itself,
         // so we don't create an event.
         // However, reset the scaleInProgress here since this is the beginning
         // of a series of gesture events.

+ 3 - 3
jme3-android/src/main/java/com/jme3/input/android/AndroidJoystickJoyInput14.java

@@ -129,9 +129,9 @@ public class AndroidJoystickJoyInput14 {
                 if (!gameControllerDeviceIds.contains(deviceId)) {
                     gameControllerDeviceIds.add(deviceId);
                     logger.log(Level.FINE, "Attempting to create joystick for device: {0}", dev);
-                    // Create an AndroidJoystick and store the InputDevice so we
-                    // can later correspond the input from the InputDevice to the
-                    // appropriate jME Joystick event
+                    // Create an AndroidJoystick and store the InputDevice, so we
+                    // can later convert the input from the InputDevice to the
+                    // appropriate jME Joystick event.
                     AndroidJoystick joystick = new AndroidJoystick(inputManager,
                                                                 joyInput,
                                                                 dev,

+ 3 - 3
jme3-android/src/main/java/com/jme3/input/android/AndroidTouchInput.java

@@ -353,9 +353,9 @@ public class AndroidTouchInput implements TouchInput {
 //            logger.log(Level.FINE, "creating KeyInputEvent: {0}", kie);
         }
 
-        // consume all keys ourself except Volume Up/Down and Menu
+        // Consume all keys ourselves except Volume Up/Down and Menu.
         //   Don't do Menu so that typical Android Menus can be created and used
-        //   by the user in MainActivity
+        //   by the user in MainActivity.
         if ((event.getKeyCode() == KeyEvent.KEYCODE_VOLUME_UP) ||
                 (event.getKeyCode() == KeyEvent.KEYCODE_VOLUME_DOWN) ||
                 (event.getKeyCode() == KeyEvent.KEYCODE_MENU)) {
@@ -369,7 +369,7 @@ public class AndroidTouchInput implements TouchInput {
 
 
 
-        // -----------------------------------------
+    // -----------------------------------------
     // JME3 Input interface
     @Override
     public void initialize() {

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

@@ -88,7 +88,7 @@ public class AndroidConfigChooser implements EGLConfigChooser {
 
         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
+            // failsafe: pick the best config with depth >= 16
             requestedConfig = new Config(0, 0, 0, 0, 16, 0, 0);
             chosenConfig = chooseConfig(egl, display, configs, requestedConfig, true, false, false, true);
         }

+ 2 - 2
jme3-android/src/main/java/com/jme3/system/android/OGLESContext.java

@@ -319,8 +319,8 @@ public class OGLESContext implements JmeContext, GLSurfaceView.Renderer, SoftTex
         }
         // update the application settings with the new resolution
         settings.setResolution(width, height);
-        // reload settings in androidInput so the correct touch event scaling can be
-        // calculated in case the surface resolution is different than the view
+        // Reload settings in androidInput so the correct touch event scaling can be
+        // calculated in case the surface resolution is different than the view.
         androidInput.loadSettings(settings);
         // if the application has already been initialized (ie renderable is set)
         // then call reshape so the app can adjust to the new resolution.

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

@@ -337,8 +337,8 @@ public class KinematicRagdollControl extends AbstractPhysicsControl implements P
                 link.bone.setUserTransformsInModelSpace(position, tmpRot1);
 
             } else {
-                //some bones of the skeleton might not be associated with a collision shape
-                //so we update them recursively
+                // Some bones in the skeleton might not be associated with a collision shape,
+                // so we update them recursively.
                 RagdollUtils.setTransform(link.bone, position, tmpRot1, false, boneList);
             }
         }

+ 1 - 1
jme3-core/src/main/java/com/jme3/animation/AnimChannel.java

@@ -364,7 +364,7 @@ public final class AnimChannel {
         if (animation.getLength() > 0){
             if (!notified && (time >= animation.getLength() || time < 0)) {
                 if (loopMode == LoopMode.DontLoop) {
-                    // Note that this flag has to be set before calling the notify
+                    // Note that this flag has to be set before calling the notify,
                     // since the notify may start a new animation and then unset
                     // the flag.
                     notified = true;

+ 2 - 2
jme3-core/src/main/java/com/jme3/app/state/AppStateManager.java

@@ -92,8 +92,8 @@ public class AppStateManager {
  
     // All of the above lists need to be thread-safe, but access will be
     // synchronized separately.... but always on the states list.  This
-    // is to avoid deadlocking that may occur and the most common use case
-    // is that they are all modified from the same thread anyway.
+    // is to avoid deadlocking. Anyway, the most common use case
+    // is that they are all modified from the same thread.
     
     private final Application app;
 

+ 1 - 1
jme3-core/src/main/java/com/jme3/audio/openal/ALAudioRenderer.java

@@ -768,7 +768,7 @@ public class ALAudioRenderer implements AudioRenderer, Runnable {
         // Reset the stream. Typically happens if it finished playing on 
         // its own and got reclaimed. 
         // Note that AudioNode.stop() already resets the stream
-        // since it might not be in EOF when stopped.
+        // since it might not be at the EOF when stopped.
         if (stream.isEOF()) {
             stream.setTime(0);
         }

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

@@ -943,7 +943,7 @@ public class BoundingBox extends BoundingVolume {
      */
     private boolean clip(float denom, float numer, float[] t) {
         // Return value is 'true' if line segment intersects the current test
-        // plane. Otherwise 'false' is returned, in which case the line segment
+        // plane. Otherwise, 'false' is returned, in which case the line segment
         // is entirely clipped.
         if (denom > 0.0f) {
             // This is the old if statement...

+ 4 - 4
jme3-core/src/main/java/com/jme3/font/BitmapFont.java

@@ -280,7 +280,7 @@ public class BitmapFont implements Savable {
                     if (rightToLeft) {
                         // Ignore offset, so it will be compatible with BitmapText.getLineWidth().
                     } else {
-                        // The first character needs to add in its xOffset but it
+                        // The first character needs to add in its xOffset, but it
                         // is the only one... and negative offsets = positive width
                         // because we're trying to account for the part that hangs
                         // over the left.  So we subtract.
@@ -295,10 +295,10 @@ public class BitmapFont implements Savable {
                 // that we don't care about.
                 if (i == characters.length() - 1 || characters.charAt(i + 1) == '\n') {
                     if (rightToLeft) {
-                        // In RTL text we move the letter x0 by it's xAdvance so
-                        // we should add it to lineWidth
+                        // In RTL text we move the letter x0 by its xAdvance, so
+                        // we should add it to lineWidth.
                         lineWidth += xAdvance;
-                        // Then we move letter by it's xOffset.
+                        // Then we move letter by its xOffset.
                         // Negative offsets = positive width.
                         lineWidth -= c.getXOffset() * sizeScale;
                     } else {

+ 6 - 5
jme3-core/src/main/java/com/jme3/input/ChaseCamera.java

@@ -436,13 +436,13 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control, Jme
 
                 if (trailingEnabled && trailing) {
                     if (targetMoves) {
-                        //computation if the inverted direction of the target
+                        // Compute the reversed direction of the target.
                         Vector3f a = targetDir.negate().normalizeLocal();
-                        //the x unit vector
+                        // the x unit vector
                         Vector3f b = Vector3f.UNIT_X;
                         // 2-D is good enough.
                         a.y = 0;
-                        //computation of the rotation angle between the x axis and the trail
+                        // Compute the angle between the X axis and the trail.
                         if (targetDir.z > 0) {
                             targetRotation = FastMath.TWO_PI - FastMath.acos(a.dot(b));
                         } else {
@@ -452,7 +452,8 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control, Jme
                             targetRotation -= FastMath.TWO_PI;
                         }
 
-                        //if there is an important change in the direction while trailing reset of the lerp factor to avoid jumpy movements
+                        // If there is an important change in the direction while trailing,
+                        // reset the lerp factor to avoid jumpy movements.
                         if (targetRotation != previousTargetRotation && FastMath.abs(targetRotation - previousTargetRotation) > FastMath.PI / 8) {
                             trailingLerpFactor = 0;
                         }
@@ -463,7 +464,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control, Jme
                     //computing rotation by linear interpolation
                     rotation = FastMath.interpolateLinear(trailingLerpFactor, rotation, targetRotation);
 
-                    //if the rotation is near the target rotation we're good, that's over
+                    // If the rotation is near the target rotation, we're good, that's over.
                     if (targetRotation + 0.01f >= rotation && targetRotation - 0.01f <= rotation) {
                         trailing = false;
                         trailingLerpFactor = 0;

+ 2 - 2
jme3-core/src/main/java/com/jme3/renderer/IDList.java

@@ -85,8 +85,8 @@ public class IDList {
         // find idx in oldList, if removed successfully, return true.
         for (int i = 0; i < oldLen; i++) {
             if (oldList[i] == idx) {
-                // found index in slot i
-                // delete index from old list
+                // Found the index in slot i:
+                // delete the index from the old list.
                 oldLen--;
                 for (int j = i; j < oldLen; j++) {
                     oldList[j] = oldList[j + 1];

+ 2 - 2
jme3-core/src/main/java/com/jme3/renderer/opengl/GLImageFormats.java

@@ -238,8 +238,8 @@ public final class GLImageFormats {
             format(formatToGL, Format.RGB111110F,           GLExt.GL_R11F_G11F_B10F_EXT,     GL.GL_RGB,             GLExt.GL_UNSIGNED_INT_10F_11F_11F_REV_EXT);
         }
         
-         // Need to check if Caps.DepthTexture is supported prior to using for textures
-        // But for renderbuffers its OK.
+        // Need to check whether Caps.DepthTexture is supported before using it for textures.
+        // But for render buffers it's OK.
         format(formatToGL, Format.Depth16, GL.GL_DEPTH_COMPONENT16,  GL.GL_DEPTH_COMPONENT, GL.GL_UNSIGNED_SHORT);
         
         // NOTE: OpenGL ES 2.0 does not support DEPTH_COMPONENT as internal format -- fallback to 16-bit depth.

+ 1 - 1
jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java

@@ -2379,7 +2379,7 @@ public final class GLRenderer implements Renderer {
         }
 
         if (caps.contains(Caps.NonPowerOfTwoTextures)) {
-            // Texture is NPOT but it is supported by video hardware.
+            // Texture is NPOT, but it is supported by video hardware.
             return;
         }
 

+ 1 - 1
jme3-core/src/main/java/com/jme3/scene/BatchNode.java

@@ -446,7 +446,7 @@ public class BatchNode extends GeometryGroupNode {
         outMesh.setMode(mode);
         //outMesh.setLineWidth(lineWidth);
         if (totalVerts >= 65536) {
-            // make sure we create an UnsignedInt buffer so we can fit all of the meshes
+            // Make sure we create an UnsignedInt buffer, so we can fit all of the meshes.
             formatForBuf[VertexBuffer.Type.Index.ordinal()] = VertexBuffer.Format.UnsignedInt;
         } else {
             formatForBuf[VertexBuffer.Type.Index.ordinal()] = VertexBuffer.Format.UnsignedShort;

+ 1 - 1
jme3-core/src/main/java/com/jme3/scene/shape/Cylinder.java

@@ -245,7 +245,7 @@ public class Cylinder extends Mesh {
             circlePoints[circlePoint][0] = FastMath.cos(angle);
             circlePoints[circlePoint][1] = FastMath.sin(angle);
         }
-        // Add an additional point for closing the texture around the side of the cylinder.
+        // Add a point to close the texture around the side of the cylinder.
         circlePoints[radialSamples][0] = circlePoints[0][0];
         circlePoints[radialSamples][1] = circlePoints[0][1];
         

+ 2 - 2
jme3-core/src/main/java/com/jme3/shadow/AbstractShadowRenderer.java

@@ -584,8 +584,8 @@ public abstract class AbstractShadowRenderer implements SceneProcessor, Savable,
             setMaterialParameters(mat);
         }
 
-        //At least one material of the receiving geoms does not support the post shadow techniques
-        //so we fall back to the forced material solution (transparent shadows won't be supported for these objects)
+        // At least one material of the receiving geoms does not support the post shadow techniques,
+        // so we fall back to the forced material solution. (Transparent shadows won't be supported for these objects.)
         if (needsfallBackMaterial) {
             setPostShadowParams();
         }

+ 24 - 24
jme3-core/src/main/java/com/jme3/util/ListSort.java

@@ -86,8 +86,8 @@ public class ListSort<T> {
      */
     private int nbRuns = 0;
 
-    /* Try to used a kind of structure like in the original implementation.
-     * Ended up using 2 arrays as done in the java 7 Timsort. 
+    /* Tried to use a struct, as in the original implementation, but
+     * ended up using 2 arrays, like the Java7 Timsort.
      * Original implementation used a struct, but instantiation of this inner
      * class + array was a convoluted pain.
      */
@@ -138,13 +138,13 @@ public class ListSort<T> {
         /*
          * We allocate a temp array of half the size of the array to sort.
          * the original implementation had a 256 maximum size for this and made 
-         * the temp array grow on demand
+         * the temp array grow on demand.
          * 
          * Timsort consumes half the size of the original array to merge at WORST.
-         * But considering we use the same temp array over and over across frames
-         * There is a good chance we stumble upon the worst case scenario one 
-         * moment or another.
-         * So we just always take half of the original array size.
+         * But considering we use the same temp array over and over across frames,
+         * there is a good chance we will stumble upon the worst-case scenario at one
+         * time or another.
+         * So we use half of the original array size.
          */        
         int tmpLen = len >>> 1;
      
@@ -155,7 +155,7 @@ public class ListSort<T> {
         }
 
         /*
-         * this part was taken from java 7 TimSort.
+         * This part was taken from the Java7 TimSort.
          * The original implementation use a stack of length 85, but this seems 
          * to boost performance for mid-sized arrays.
          * I changed the numbers so they fit our MIN_SIZE parameter.
@@ -200,9 +200,9 @@ public class ListSort<T> {
         int remaining = high - low;
 
         /*
-         * If array's size is below min_size we perform a binary insertion sort 
+         * If array's size is below min_size, we perform a binary insertion sort,
          * but first we check if some existing ordered pattern exists to reduce 
-         * the size of data to be sorted
+         * the size of data to be sorted.
          */
         if (remaining < MIN_SIZE) {
             int runLength = getRunLength(array, low, high, comparator);
@@ -211,7 +211,7 @@ public class ListSort<T> {
         }
 
         /*
-         * main iteration : compute minimum run length, then iterate through the
+         * Main iteration: compute minimum run length, then iterate through the
          * array to find runs and merge them until they can be binary sorted 
          * if their length < minLength
          */
@@ -219,8 +219,8 @@ public class ListSort<T> {
         while (remaining != 0) {
             int runLength = getRunLength(array, low, high, comparator);
 
-            /* if run length is below the threshold we binary sort the remaining
-             * elements
+            /* If the run length is below the threshold, binary sort the remaining
+             * elements.
              */
             if (runLength < minLength) {
                 int newLength = remaining <= minLength ? remaining : minLength;
@@ -344,8 +344,8 @@ public class ListSort<T> {
              */
             int nbElems = start - left;
             /*
-             * grabbed from java7 TimSort, the switch is an optimization to 
-             * arraycopy in case there are 1 or 2 elements only to copy
+             * Grabbed from the Java7 TimSort, this switch optimizes
+             * arraycopy() in case there are only 1 or 2 elements to copy.
              */
             switch (nbElems) {
                 case 2:
@@ -514,9 +514,9 @@ public class ListSort<T> {
             while (offset < maxOffset && comparator.compare(key, array[idx + hint + offset]) > 0) {
                 lastOffset = offset;
                 offset = (offset << 1) + 1;
-                /* int overflow. 
-                 * Note : not sure if that can happen but it's here in both 
-                 * original and java 7 TimSort implementation
+                /* int overflow.
+                 * Note: not sure if this can happen, but it's included in both the
+                 * original and Java7 TimSort implementations.
                  */
                 if (offset <= 0) {
                     offset = maxOffset;
@@ -526,7 +526,7 @@ public class ListSort<T> {
                 offset = maxOffset;
             }
 
-            // Translate back to offsets relative to idx. 
+            // Translate back into offsets relative to idx.
             lastOffset += hint;
             offset += hint;
         } else {
@@ -537,9 +537,9 @@ public class ListSort<T> {
             while (offset < maxOffset && comparator.compare(key, array[idx + hint - offset]) <= 0) {
                 lastOffset = offset;
                 offset = (offset << 1) + 1;
-                /* int overflow. 
-                 * Note : not sure if that can happen but it's here in both 
-                 * original and java 7 TimSort implementation
+                /* int overflow.
+                 * Note: not sure if this can happen, but it's included in both the
+                 * original and Java7 TimSort implementations.
                  */
                 if (offset <= 0) {
                     offset = maxOffset;
@@ -606,8 +606,8 @@ public class ListSort<T> {
                 lastOffset = offset;
                 offset = (offset << 1) + 1;
                 /* int overflow. 
-                 * Note : not sure if that can happen but it's here in both 
-                 * original and java 7 TimSort implementation
+                 * Note: not sure if this can happen, but it's included in both
+                 * the original and Java7 TimSort implementations.
                  */
                 if (offset <= 0) {
                     offset = maxOffset;

+ 1 - 1
jme3-core/src/plugins/java/com/jme3/asset/plugins/HttpZipLocator.java

@@ -221,7 +221,7 @@ public class HttpZipLocator implements AssetLocator {
 
         String name = getUTF8String(table, offset + ZipEntry.CENHDR, nameLen);
         if (name.charAt(name.length()-1) == '/'){
-            // ignore this entry, it is directory node
+            // Ignore this entry. It is a directory node
             // or it has no name (?)
             return newOffset;
         }

+ 1 - 1
jme3-core/src/plugins/java/com/jme3/material/plugins/J3MLoader.java

@@ -757,7 +757,7 @@ public class J3MLoader implements AssetLoader {
                 throw new MatParseException("Expected ':', got '{'", materialStat);
             }
             materialDef = new MaterialDef(assetManager, materialName);
-            // NOTE: pass file name for defs so they can be loaded later
+            // NOTE: pass the filename for defs, so they can be loaded later
             materialDef.setAssetName(key.getName());
         }else{
             throw new MatParseException("Cannot use colon in material name/path", materialStat);

+ 4 - 4
jme3-core/src/plugins/java/com/jme3/texture/plugins/ktx/KTXLoader.java

@@ -141,7 +141,7 @@ public class KTXLoader implements AssetLoader {
                 pixelReader = new SrTuRoPixelReader(); 
             }
             
-            //some of the values may be 0 we need them at least to be 1
+            // Some of the values may be 0. We need them to be at least 1.
             pixelDepth = Math.max(1, pixelDepth);
             numberOfArrayElements = Math.max(1, numberOfArrayElements);
             numberOfFaces = Math.max(1, numberOfFaces);
@@ -166,9 +166,9 @@ public class KTXLoader implements AssetLoader {
             int offset = 0;
             //iterate over data
             for (int mipLevel = 0; mipLevel < numberOfMipmapLevels; mipLevel++) {
-                //size of the image in bytes.
-                //this value is bogus in many example, when using mipmaps.
-                //instead we compute the theoretical size and display a warning when it does not match.
+                // Size of the image in bytes.
+                // This value is bogus in many examples when using mipmaps.
+                // We compute the theoretical size and display a warning if it does not match.
                 int fileImageSize = in.readInt();
                 
                 int width = Math.max(1, pixelWidth >> mipLevel);

+ 1 - 1
jme3-core/src/test/java/com/jme3/light/LightFilterTest.java

@@ -171,7 +171,7 @@ public class LightFilterTest {
         pl.setPosition(new Vector3f(0f, 1.4142135f, 1.4142135f).multLocal(1-FastMath.ZERO_TOLERANCE));
         checkFilteredLights(1);
         
-        // it's a point light, also test for the other corner
+        // It's a point light; also test for the other corner.
         pl.setPosition(new Vector3f(0f, -1.4142135f, -1.4142135f).multLocal(1-FastMath.ZERO_TOLERANCE));
         checkFilteredLights(0);
 

+ 2 - 2
jme3-core/src/tools/java/jme3tools/optimize/GeometryBatchFactory.java

@@ -158,8 +158,8 @@ public class GeometryBatchFactory {
         outMesh.setMaxNumWeights(maxWeights);
         outMesh.setMode(mode);
         if (totalVerts >= 65536) {
-            // make sure we create an UnsignedInt buffer so
-            // we can fit all of the meshes
+            // Create an UnsignedInt buffer so
+            // we can fit all of the meshes.
             formatForBuf[Type.Index.ordinal()] = Format.UnsignedInt;
         } else {
             formatForBuf[Type.Index.ordinal()] = Format.UnsignedShort;

+ 1 - 1
jme3-lwjgl/src/main/java/com/jme3/opencl/lwjgl/LwjglEvent.java

@@ -59,7 +59,7 @@ public class LwjglEvent extends Event {
             return;
         }
         CL10.clWaitForEvents(event);
-        release(); //short cut to save resources
+        release(); // shortcut to save resources
     }
 
     @Override

+ 1 - 1
jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglAbstractDisplay.java

@@ -159,7 +159,7 @@ public abstract class LwjglAbstractDisplay extends LwjglContext implements Runna
 
         listener.update();
         
-        // All this does is call swap buffers
+        // All this does is call update().
         // If the canvas is not active, there's no need to waste time
         // doing that.
         if (renderable.get()){

+ 3 - 3
jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglCanvas.java

@@ -125,8 +125,8 @@ public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContex
                 return;
             }
 
-            // We must tell GL context to shutdown and wait for it to
-            // shutdown, otherwise, issues will occur.
+            // We must tell GL context to shut down and wait for it to
+            // shut down. Otherwise, issues will occur.
             logger.log(Level.FINE, "EDT: Telling OGL to destroy display ..");
             synchronized (taskLock){
                 desiredTask = TASK_DESTROY_DISPLAY;
@@ -392,7 +392,7 @@ public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContex
                  * 
                  * Destroying keyboard early prevents the error above, triggered
                  * by destroying keyboard in by Display.destroy() or Display.setParent(null).
-                 * Therefore Keyboard.destroy() should precede any of these calls.
+                 * Therefore, Keyboard.destroy() should precede any of these calls.
                  */
                 if (Keyboard.isCreated()){
                     // Should only happen if called in 

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

@@ -267,7 +267,7 @@ public abstract class LwjglContext implements JmeContext {
                 @Override
                 public void invoke(int jid, int event) {
 
-                    // Invoke the disconnected event before we reload the joysticks or we lose the reference to it.
+                    // Invoke the disconnected event before we reload the joysticks or lose the reference to it.
                     // Invoke the connected event after we reload the joysticks to obtain the reference to it.
 
                     if ( event == GLFW.GLFW_CONNECTED ) {

+ 1 - 1
jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java

@@ -576,7 +576,7 @@ public abstract class LwjglWindow extends LwjglContext implements Runnable {
 
         listener.update();
 
-        // All this does is call swap buffers
+        // All this does is call glfwSwapBuffers().
         // If the canvas is not active, there's no need to waste time
         // doing that.
         if (renderable.get()) {

+ 4 - 4
jme3-networking/src/main/java/com/jme3/network/base/DefaultClient.java

@@ -160,7 +160,7 @@ public class DefaultClient implements Client
         // hurt to reconcile with IP on the server side, though.
         long tempId = System.currentTimeMillis() + System.nanoTime();
 
-        // Set it true here so we can send some messages.
+        // Set it true here, so we can send some messages.
         isRunning = true;        
                 
         ClientRegistrationMessage reg;
@@ -482,8 +482,8 @@ public class DefaultClient implements Client
             }
             return;
         } else if( m instanceof ChannelInfoMessage ) {
-            // This is an interim step in the connection process and
-            // now we need to add a bunch of connections
+            // This is an interim step in the connection process, and
+            // now we need to add a bunch of connections.
             configureChannels( ((ChannelInfoMessage)m).getId(), ((ChannelInfoMessage)m).getPorts() );
             return; 
         } else if( m instanceof DisconnectMessage ) {
@@ -515,7 +515,7 @@ public class DefaultClient implements Client
         public void handleError( Object source, Throwable t )
         {
             // Only doing the DefaultClient.this to make the code
-            // checker happy... it compiles fine without it but I
+            // checker happy... it compiles fine without it, but I
             // don't like red lines in my editor. :P
             DefaultClient.this.handleError( t );   
         }

+ 5 - 5
jme3-networking/src/main/java/com/jme3/network/base/DefaultServer.java

@@ -217,7 +217,7 @@ public class DefaultServer implements Server
             
             isRunning = false;
             
-            // Now terminate all of the services
+            // Now terminate all of the services.
             services.terminate();             
         } catch( InterruptedException e ) {
             throw new RuntimeException( "Interrupted while closing", e );
@@ -368,8 +368,8 @@ public class DefaultServer implements Server
     {
         Connection addedConnection = null;
 
-        // generally this will only be called by one thread but it's        
-        // important enough I won't take chances
+        // Generally this will only be called by one thread, but it's
+        // so important that I won't take chances.
         synchronized( this ) {       
             // Grab the random ID that the client created when creating
             // its two registration messages
@@ -633,8 +633,8 @@ public class DefaultServer implements Server
             // when closeConnection() is called by the
             // connectionClosed() endpoint callback.
             if( channels[CH_RELIABLE] != null ) {
-                // Close with flush so we make sure our
-                // message gets out
+                // Close with flush to ensure our
+                // message gets out.
                 channels[CH_RELIABLE].close(true);
             }
         }

+ 2 - 2
jme3-networking/src/main/java/com/jme3/network/base/KernelAdapter.java

@@ -196,7 +196,7 @@ public class KernelAdapter extends Thread
     protected MessageBuffer getMessageBuffer( Endpoint p )
     {
         if( !reliable ) {
-            // Since UDP comes in packets and they aren't split
+            // Since UDP comes in packets, and they aren't split
             // up, there is no reason to buffer.  In fact, there would
             // be a downside because there is no way for us to reliably
             // clean these up later since we'd create another one for 
@@ -236,7 +236,7 @@ public class KernelAdapter extends Thread
             }                
         }            
         
-        // Should be complete... and maybe we should check but we don't
+        // Should be complete... and maybe we should check, but we don't.
         Message m = null;
         while( (m = protocol.pollMessage()) != null ) {
             m.setReliable(reliable);

+ 2 - 2
jme3-networking/src/main/java/com/jme3/network/base/protocol/GreedyMessageBuffer.java

@@ -110,8 +110,8 @@ public class GreedyMessageBuffer implements MessageBuffer {
                     // byte in it... and in that case we will get an underflow
                     // when attempting to read the short below.
                     
-                    // It has to be 1 or we'd never get here... but one
-                    // isn't enough so we stash it away.
+                    // It has to be 1, or we'd never get here... but one
+                    // isn't enough, so we stash it away.
                     carry = buffer.get();
                     break;
                 } else {

+ 4 - 4
jme3-networking/src/main/java/com/jme3/network/base/protocol/LazyMessageBuffer.java

@@ -108,14 +108,14 @@ public class LazyMessageBuffer implements MessageBuffer {
                     // byte in it... and in that case we will get an underflow
                     // when attempting to read the short below.
                     
-                    // It has to be 1 or we'd never get here... but one
-                    // isn't enough so we stash it away.
+                    // It has to be 1 or we'd never get here. But one
+                    // isn't enough, so we stash it away.
                     carry = buffer.get();
                     break;
                 } else {
-                    // We are not currently reading an object so
+                    // We are not currently reading an object, so
                     // grab the size.
-                    // Note: this is somewhat limiting... int would
+                    // Note: this is somewhat limiting. int would
                     // be better.
                     size = buffer.getShort();
                 }               

+ 2 - 3
jme3-networking/src/main/java/com/jme3/network/service/rmi/ClassInfoRegistry.java

@@ -66,15 +66,14 @@ public class ClassInfoRegistry {
             if( result != null ) {
                 return result;
             }
-            // Else we need to create it and store it... so grab the write
-            // lock
+            // Else we need to create it and store it, so grab the write lock.
             lock.readLock().unlock();
             lock.writeLock().lock();
             try {
                 // Note: it's technically possible that a race with another thread
                 // asking for the same class already created one between our read unlock
                 // and our write lock.  No matter as it's cheap to create one and does
-                // no harm.  Code is simpler without the double-check.
+                // no harm.  Code is simpler without the double check.
                 result = new ClassInfo((short)nextClassId.getAndIncrement(), type);
                 cache.put(type, result);
                 

+ 2 - 2
jme3-niftygui/src/main/java/com/jme3/niftygui/InputSystemJme.java

@@ -155,9 +155,9 @@ public class InputSystemJme implements InputSystem, RawInputListener {
             // 2) You release the mouse button but the mouse down event will not be forwarded to Nifty because it
             //    owned the mouse and the jme mouse cursor is not visible.
             //
-            // Nifty now still thinks that the mouse button is down although it's not. The result is that the next click
+            // Nifty now still thinks that the mouse button is down, but it's not. The result is that the next click
             // on any Nifty element will not be recognized as an initial click by Nifty. So you need an additional click
-            // on the Nifty element to activate it correctly. In case of drag and drop this additional click was quite
+            // on the Nifty element to activate it correctly. In case of drag and drop, this additional click was quite
             // irritating.
             //
             // To fix that we'll now forward the mouse button up event ALWAYS to Nifty regardless of it owning the mouse

+ 1 - 1
jme3-niftygui/src/main/java/com/jme3/niftygui/JmeBatchRenderBackend.java

@@ -394,7 +394,7 @@ public class JmeBatchRenderBackend implements BatchRenderBackend {
             return;
         }
 
-        // all is well, we can execute the modify right away
+        // All is well. We can execute the modify right away.
         renderer.modifyTexture(textureAtlas, image, x, y);
     }
 

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

@@ -202,8 +202,8 @@ public class GltfLoader implements AssetLoader {
 
         for (JsonElement scene : scenes) {
             Node sceneNode = new Node();
-            // specs says that only the default scene should be rendered,
-            // if there are several scenes, they are attached to the rootScene, but they are culled
+            // Specs say that only the default scene should be rendered.
+            // If there are several scenes, they are attached to the rootScene, but they are culled.
             sceneNode.setCullHint(Spatial.CullHint.Always);
 
             sceneNode.setName(getAsString(scene.getAsJsonObject(), "name"));
@@ -248,7 +248,7 @@ public class GltfLoader implements AssetLoader {
 
             // there is a mesh in this node, however gltf
             // can split meshes in primitives (some kind of sub meshes),
-            // We don't have this in JME so we have to make one mesh and one Geometry for each primitive.
+            // We don't have this in JME, so we have to make one Mesh and one Geometry for each primitive.
             Geometry[] primitives = readMeshPrimitives(meshIndex);
             if (primitives.length == 1 && children == null) {
                 // only one geometry, let's not wrap it in another node unless the node has children.
@@ -544,7 +544,7 @@ public class GltfLoader implements AssetLoader {
 
         // target defines ELEMENT_ARRAY_BUFFER or ARRAY_BUFFER,
         // but we already know that since we know we load the index buffer or any other...
-        // not sure it's useful for us, but I guess it's useful when you map data directly to the GPU.
+        // Not sure it's useful for us, but I guess it's useful when you map data directly to the GPU.
         // int target = getAsInteger(bufferView, "target", 0);
 
         byte[] data = readData(bufferIndex);

+ 1 - 1
jme3-plugins/src/main/java/com/jme3/material/plugin/export/materialdef/J3mdTechniqueDefWriter.java

@@ -87,7 +87,7 @@ public class J3mdTechniqueDefWriter {
             writeShaderNodes(techniqueDef, matParams, out);
 
         } else {
-            //When we have ShaderNodes, Defines are handled differently so we don't have to write them.
+            // When we have ShaderNodes, defines are handled differently, so we don't have to write them.
             //Defines
             if (techniqueDef.getDefineNames().length != 0) {
                 writeDefines(techniqueDef, matParams, out);

+ 1 - 1
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/SceneLoader.java

@@ -262,7 +262,7 @@ public class SceneLoader extends DefaultHandler implements AssetLoader {
         }
         float fov = SAXUtil.parseFloat(attribs.getValue("fov"), 45f);
         if (fov < FastMath.PI) { 
-            // XXX: Most likely, it is in radians..
+            // XXX: Most likely it is in radians
             fov = fov * FastMath.RAD_TO_DEG;
         }
         camera.setFrustumPerspective(fov, (float)DEFAULT_CAM_WIDTH / DEFAULT_CAM_HEIGHT, 1, 1000);

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

@@ -1179,8 +1179,8 @@ public abstract class VRApplication implements Application, SystemListener {
         rootNode.updateGeometricState();
 
         if( isInVR() == false || guiManager.getPositioningMode() == VRGUIPositioningMode.MANUAL ) {
-            // only update geometric state here if GUI is in manual mode, or not in VR
-            // it will get updated automatically in the viewmanager update otherwise
+            // Update geometric state here only if GUI is in manual mode, or not in VR.
+            // Otherwise it will get updated automatically in the view-manager update.
             guiNode.updateGeometricState();
         }
 

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

@@ -176,8 +176,8 @@ public abstract class AbstractVRViewManager implements VRViewManager {
                 // add post processors we just made, which are empty
                 getLeftViewPort().addProcessor(getLeftPostProcessor());
                 getRightViewPort().addProcessor(getRightPostProcessor());
-                // go through all of the filters in the processors list
-                // add them to the left viewport processor & clone them to the right
+                // Go through all of the filters in the processors list,
+                // add them to the left viewport processor, and clone them to the right.
                 for(SceneProcessor sceneProcessor : sourceViewport.getProcessors()) {
                     if (sceneProcessor instanceof FilterPostProcessor) {
                         for(Filter f : ((FilterPostProcessor)sceneProcessor).getFilterList() ) {

+ 1 - 1
jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java

@@ -328,7 +328,7 @@ public class OculusViewManager extends AbstractVRViewManager {
                     viewPort.attachScene(spatialIter.next());
                 }
 
-                // The viewbuffer to render into will be set during prerender.
+                // The target view buffer will be set during prerender.
                 return viewPort;
             } else {
                 throw new IllegalStateException("This VR environment is not attached to any application.");

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

@@ -322,7 +322,7 @@ public class OpenVRViewManager extends AbstractVRViewManager {
     private void setupVRScene(){
         if (environment != null){
             if (environment.getApplication() != null){
-                // no special scene to setup if we are doing instancing
+                // no special scene to set up if we are doing instancing
                 if( environment.isInstanceRendering() ) {
                     // distortion has to be done with compositor here... we want only one pass on our end!
                     if( environment.getApplication().getContext().getSettings().isSwapBuffers() ) {

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

@@ -370,7 +370,7 @@ public class OSVRViewManager extends AbstractVRViewManager{
     private void setupVRScene(){
         if (environment != null){
             if (environment.getApplication() != null){
-                // no special scene to setup if we are doing instancing
+                // no special scene to set up if we are doing instancing
                 if( environment.isInstanceRendering() ) {
                     // distortion has to be done with compositor here... we want only one pass on our end!
                     if( environment.getApplication().getContext().getSettings().isSwapBuffers() ) {

+ 1 - 1
jme3-vr/src/main/java/com/jme3/system/lwjgl/LwjglWindowVR.java

@@ -376,7 +376,7 @@ public abstract class LwjglWindowVR extends LwjglContextVR implements Runnable {
 
         listener.update();
 
-        // All this does is call swap buffers
+        // All this does is call glfwSwapBuffers().
         // If the canvas is not active, there's no need to waste time
         // doing that.
         if (renderable.get()) {