Jelajahi Sumber

delete useless fields and variables

Stephen Gold 4 tahun lalu
induk
melakukan
d6638e0edd
20 mengubah file dengan 27 tambahan dan 84 penghapusan
  1. 0 3
      jme3-android/src/main/java/com/jme3/input/android/AndroidJoystickJoyInput14.java
  2. 2 3
      jme3-android/src/main/java/com/jme3/input/android/AndroidTouchInput.java
  3. 1 5
      jme3-bullet/src/common/java/com/jme3/bullet/animation/DacLinks.java
  4. 1 2
      jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java
  5. 1 3
      jme3-effects/src/main/java/com/jme3/water/ReflectionProcessor.java
  6. 1 2
      jme3-ios/src/main/java/com/jme3/input/ios/IosInputHandler.java
  7. 1 4
      jme3-jogg/src/main/java/com/jme3/audio/plugins/CachedOggStream.java
  8. 1 3
      jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java
  9. 2 4
      jme3-lwjgl3/src/main/java/com/jme3/input/lwjgl/GlfwMouseInput.java
  10. 1 7
      jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpConnector.java
  11. 0 1
      jme3-networking/src/main/java/com/jme3/network/serializing/Serializer.java
  12. 2 3
      jme3-niftygui/src/main/java/com/jme3/niftygui/NiftyJmeDisplay.java
  13. 2 8
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/material/FbxTexture.java
  14. 0 2
      jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxMesh.java
  15. 3 5
      jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GlbLoader.java
  16. 2 6
      jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java
  17. 1 2
      jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/AssetTileLoader.java
  18. 2 5
      jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/ImageTileLoader.java
  19. 2 4
      jme3-terrain/src/main/java/com/jme3/terrain/noise/filter/HydraulicErodeFilter.java
  20. 2 12
      jme3-vr/src/main/java/com/jme3/input/vr/lwjgl_openvr/LWJGLOpenVR.java

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

@@ -63,7 +63,6 @@ import java.util.logging.Logger;
 public class AndroidJoystickJoyInput14 {
     private static final Logger logger = Logger.getLogger(AndroidJoystickJoyInput14.class.getName());
 
-    private boolean loaded = false;
     private AndroidJoyInput joyInput;
     private Map<Integer, AndroidJoystick> joystickIndex = new HashMap<>();
 
@@ -173,8 +172,6 @@ public class AndroidJoystickJoyInput14 {
             }
         }
 
-
-        loaded = true;
         return joysticks;
     }
 

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

@@ -69,7 +69,6 @@ public class AndroidTouchInput implements TouchInput {
     private boolean mouseEventsInvertX = false;
     private boolean mouseEventsInvertY = false;
     private boolean keyboardEventsEnabled = false;
-    private boolean dontSendHistory = false;
 
     protected int numPointers = 0;
     final private HashMap<Integer, Vector2f> lastPositions = new HashMap<>();
@@ -162,7 +161,7 @@ public class AndroidTouchInput implements TouchInput {
         boolean bWasHandled = false;
         TouchEvent touch = null;
         //    System.out.println("native : " + event.getAction());
-        int action = getAction(event);
+        getAction(event);
         int pointerIndex = getPointerIndex(event);
         int pointerId = getPointerId(event);
         Vector2f lastPos = lastPositions.get(pointerId);
@@ -469,7 +468,7 @@ public class AndroidTouchInput implements TouchInput {
 
     @Override
     public void setOmitHistoricEvents(boolean dontSendHistory) {
-        this.dontSendHistory = dontSendHistory;
+        // not implemented
     }
 
 }

+ 1 - 5
jme3-bullet/src/common/java/com/jme3/bullet/animation/DacLinks.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018-2019 jMonkeyEngine
+ * Copyright (c) 2018-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -91,10 +91,6 @@ public class DacLinks
      * local copy of {@link com.jme3.math.Transform#IDENTITY}
      */
     final private static Transform transformIdentity = new Transform();
-    /**
-     * local copy of {@link com.jme3.math.Vector3f#ZERO}
-     */
-    final private static Vector3f translateIdentity = new Vector3f(0f, 0f, 0f);
     // *************************************************************************
     // fields
 

+ 1 - 2
jme3-desktop/src/main/java/com/jme3/system/awt/AwtPanel.java

@@ -80,7 +80,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
     private int newHeight = 1;
     private AtomicBoolean reshapeNeeded = new AtomicBoolean(false);
     private final Object lock = new Object();
-    private AppProfiler prof;
 
     public AwtPanel(PaintMode paintMode) {
         this(paintMode, false);
@@ -338,6 +337,6 @@ public class AwtPanel extends Canvas implements SceneProcessor {
 
     @Override
     public void setProfiler(AppProfiler profiler) {
-        this.prof = profiler;
+        // not implemented
     }
 }

+ 1 - 3
jme3-effects/src/main/java/com/jme3/water/ReflectionProcessor.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -51,7 +51,6 @@ public class ReflectionProcessor implements SceneProcessor {
     private Camera reflectionCam;
     private FrameBuffer reflectionBuffer;
     private Plane reflectionClipPlane;
-    private AppProfiler prof;
 
     /**
      * Creates a ReflectionProcessor
@@ -111,7 +110,6 @@ public class ReflectionProcessor implements SceneProcessor {
 
     @Override
     public void setProfiler(AppProfiler profiler) {
-        this.prof = profiler;
     }
 
     /**

+ 1 - 2
jme3-ios/src/main/java/com/jme3/input/ios/IosInputHandler.java

@@ -22,7 +22,6 @@ public class IosInputHandler implements TouchInput {
     private boolean mouseEventsInvertX = false;
     private boolean mouseEventsInvertY = false;
     private boolean keyboardEventsEnabled = false;
-    private boolean dontSendHistory = false;
 
     // Internal
     private boolean initialized = false;
@@ -114,7 +113,7 @@ public class IosInputHandler implements TouchInput {
 
     @Override
     public void setOmitHistoricEvents(boolean dontSendHistory) {
-        this.dontSendHistory = dontSendHistory;
+        // not implemented
     }
 
     // ----------------

+ 1 - 4
jme3-jogg/src/main/java/com/jme3/audio/plugins/CachedOggStream.java

@@ -53,7 +53,6 @@ public class CachedOggStream implements PhysicalOggStream {
 
     private boolean closed = false;
     private boolean eos = false;
-    private boolean bos = false;
     private InputStream sourceStream;
     private HashMap<Integer, LogicalOggStream> logicalStreams 
             = new HashMap<>();
@@ -130,9 +129,7 @@ public class CachedOggStream implements PhysicalOggStream {
            return -1;
 
        OggPage op = OggPage.create(sourceStream);
-       if (!op.isBos()){
-           bos = true;
-       }
+       op.isBos();
        if (op.isEos()){
            eos = true;
            lastPage = op;

+ 1 - 3
jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/LwjglMouseInput.java

@@ -55,8 +55,6 @@ public class LwjglMouseInput implements MouseInput {
     private LwjglAbstractDisplay context;
 
     private RawInputListener listener;
-
-    private boolean supportHardwareCursor = false;
     private boolean cursorVisible = true;
 
     /**
@@ -79,7 +77,7 @@ public class LwjglMouseInput implements MouseInput {
         try {
             Mouse.create();
             logger.fine("Mouse created.");
-            supportHardwareCursor = (Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) != 0;
+            Cursor.getCapabilities();
 
             // Recall state that was set before initialization
             Mouse.setGrabbed(!cursorVisible);

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

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -130,7 +130,6 @@ public class GlfwMouseInput implements MouseInput {
     private int mouseX;
     private int mouseY;
     private int mouseWheel;
-    private int currentWidth;
     private int currentHeight;
 
     private boolean cursorVisible;
@@ -209,7 +208,7 @@ public class GlfwMouseInput implements MouseInput {
 
             glfwGetWindowSize(window, width, height);
 
-            currentWidth = width.get();
+            width.get();
             currentHeight = height.get();
         }
 
@@ -239,7 +238,6 @@ public class GlfwMouseInput implements MouseInput {
             @Override
             public void invoke(final long window, final int width, final int height) {
                 currentHeight = height;
-                currentWidth = width;
             }
         });
     }

+ 1 - 7
jme3-networking/src/main/java/com/jme3/network/kernel/udp/UdpConnector.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -53,12 +53,6 @@ public class UdpConnector implements Connector
     private byte[] buffer = new byte[65535];
     private AtomicBoolean connected = new AtomicBoolean(false);
 
-    /**
-     *  In order to provide proper available() checking, we
-     *  potentially queue one datagram.
-     */
-    private DatagramPacket pending;
-
     /**
      *  Creates a new UDP connection that send datagrams to the
      *  specified address and port.

+ 0 - 1
jme3-networking/src/main/java/com/jme3/network/serializing/Serializer.java

@@ -64,7 +64,6 @@ public abstract class Serializer {
     private static final List<SerializerRegistration> registrations                 = new ArrayList<SerializerRegistration>();
 
     private static final Serializer                         fieldSerializer         = new FieldSerializer();
-    private static final Serializer                         serializableSerializer  = new SerializableSerializer();
     private static final Serializer                         arraySerializer         = new ArraySerializer();
 
     private static short nextAvailableId = -2; // historically the first ID was always -2

+ 2 - 3
jme3-niftygui/src/main/java/com/jme3/niftygui/NiftyJmeDisplay.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2018 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -70,7 +70,6 @@ public class NiftyJmeDisplay implements SceneProcessor {
     protected ResourceLocationJme resourceLocation;
 
     protected int w, h;
-    private AppProfiler prof;
 
     protected class ResourceLocationJme implements ResourceLocation {
 
@@ -372,7 +371,7 @@ public class NiftyJmeDisplay implements SceneProcessor {
 
     @Override
     public void setProfiler(AppProfiler profiler) {
-        this.prof = profiler;
+        // not implemented
     }
 
 }

+ 2 - 8
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/material/FbxTexture.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2015 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -53,15 +53,9 @@ public class FbxTexture extends FbxObject<Texture> {
         FromTextureIntensity;
     }
     
-    private String type;
     private FbxImage media;
-    
-    // TODO: not currently used.
-    private AlphaSource alphaSource = AlphaSource.FromTextureAlpha;
     private String uvSet;
     private int wrapModeU = 0, wrapModeV = 0;
-    private final Vector2f uvTranslation = new Vector2f(0, 0);
-    private final Vector2f uvScaling = new Vector2f(1, 1);
 
     public FbxTexture(AssetManager assetManager, String sceneFolderName) {
         super(assetManager, sceneFolderName);
@@ -105,7 +99,7 @@ public class FbxTexture extends FbxObject<Texture> {
         if (getSubclassName().equals("")) {
             for (FbxElement e : element.children) {
                 if (e.id.equals("Type")) {
-                    type = (String) e.properties.get(0);
+                    e.properties.get(0);
                 } 
                 /*else if (e.id.equals("FileName")) {
                     filename = (String) e.properties.get(0);

+ 0 - 2
jme3-plugins/src/fbx/java/com/jme3/scene/plugins/fbx/mesh/FbxMesh.java

@@ -60,7 +60,6 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
     private static final Logger logger = Logger.getLogger(FbxMesh.class.getName());
     
     private FbxPolygon[] polygons;
-    private int[] edges;
     private FbxLayerElement[] layerElements;
     private Vector3f[] positions;
     private FbxLayer[] layers;
@@ -167,7 +166,6 @@ public final class FbxMesh extends FbxNodeAttribute<IntMap<Mesh>> {
     }
     
     private void setEdges(int[] edges) {
-        this.edges = edges;
         // TODO: ...
     }
     

+ 3 - 5
jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GlbLoader.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -42,17 +42,15 @@ import java.util.ArrayList;
  */
 public class GlbLoader extends GltfLoader {
 
-    private static final int GLTF_MAGIC = 0x46546C67;
     private static final int JSON_TYPE = 0x4E4F534A;
-    private static final int BIN_TYPE = 0x004E4942;
     private ArrayList<byte[]> data = new ArrayList<>();
 
     @Override
     public Object load(AssetInfo assetInfo) throws IOException {
         data.clear();
         LittleEndien stream = new LittleEndien(new DataInputStream(assetInfo.openStream()));
-        int magic = stream.readInt();
-        int version = stream.readInt();
+        /* magic */ stream.readInt();
+        /* version */ stream.readInt();
         int length = stream.readInt();
 
         byte[] json = null;

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

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -93,10 +93,6 @@ public class GltfLoader implements AssetLoader {
     private static Map<String, MaterialAdapter> defaultMaterialAdapters = new HashMap<>();
     private CustomContentManager customContentManager = new CustomContentManager();
     private boolean useNormalsFlag = false;
-    private Quaternion tmpQuat = new Quaternion();
-    private Transform tmpTransforms = new Transform();
-    private Transform tmpTransforms2 = new Transform();
-    private Matrix4f tmpMat = new Matrix4f();
 
     Map<SkinData, List<Spatial>> skinnedSpatials = new HashMap<>();
     IntMap<SkinBuffers> skinBuffers = new IntMap<>();
@@ -128,7 +124,7 @@ public class GltfLoader implements AssetLoader {
             docRoot = new JsonParser().parse(new JsonReader(new InputStreamReader(stream))).getAsJsonObject();
 
             JsonObject asset = docRoot.getAsJsonObject().get("asset").getAsJsonObject();
-            String generator = getAsString(asset, "generator");
+            getAsString(asset, "generator");
             String version = getAsString(asset, "version");
             String minVersion = getAsString(asset, "minVersion");
             if (!isSupported(version, minVersion)) {

+ 1 - 2
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/AssetTileLoader.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,6 @@ public class AssetTileLoader implements TerrainGridTileLoader {
     private AssetManager manager;
     private String assetPath;
     private String name;
-    private int size;
     private int patchSize;
     private int quadSize;
 

+ 2 - 5
jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/grid/ImageTileLoader.java

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2020 jMonkeyEngine
+ * Copyright (c) 2009-2021 jMonkeyEngine
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,9 +55,6 @@ public class ImageTileLoader implements TerrainGridTileLoader{
     private final Namer namer;
     private int patchSize;
     private int quadSize;
-    private float heightScale = 1;
-    //private int imageType = BufferedImage.TYPE_USHORT_GRAY; // 16 bit grayscale
-    //private ImageHeightmap customImageHeightmap;
 
     public ImageTileLoader(final String textureBase, final String textureExt, AssetManager assetManager) {
         this(assetManager, new Namer() {
@@ -78,7 +75,7 @@ public class ImageTileLoader implements TerrainGridTileLoader{
      * Affects the vertical scale of the terrain when loaded.
      */
     public void setHeightScale(float heightScale) {
-        this.heightScale = heightScale;
+        // not implemented
     }
     
     

+ 2 - 4
jme3-terrain/src/main/java/com/jme3/terrain/noise/filter/HydraulicErodeFilter.java

@@ -34,8 +34,6 @@ import java.nio.FloatBuffer;
 
 public class HydraulicErodeFilter extends AbstractFilter {
 
-	private Basis waterMap;
-	private Basis sedimentMap;
 	private float Kr;
 	private float Ks;
 	private float Ke;
@@ -59,7 +57,7 @@ public class HydraulicErodeFilter extends AbstractFilter {
 	}
 
 	public void setSedimentMap(Basis sedimentMap) {
-		this.sedimentMap = sedimentMap;
+            // not implemented
 	}
 
 	public void setT(float t) {
@@ -67,7 +65,7 @@ public class HydraulicErodeFilter extends AbstractFilter {
 	}
 
 	public void setWaterMap(Basis waterMap) {
-		this.waterMap = waterMap;
+            // not implemented
 	}
 
 	@Override

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

@@ -44,9 +44,6 @@ public class LWJGLOpenVR implements VRAPI {
     private final Quaternion rotStore = new Quaternion();
     private final Vector3f posStore = new Vector3f();
     
-    // for debugging latency
-    private int frames = 0;    
-    
     protected Matrix4f[] poseMatrices;
 
     private final Matrix4f hmdPose = Matrix4f.IDENTITY.clone();
@@ -57,9 +54,6 @@ public class LWJGLOpenVR implements VRAPI {
     
     private Vector3f hmdPoseLeftEyeVec, hmdPoseRightEyeVec, hmdSeatToStand;
     
-    private float vsyncToPhotons;
-    private double timePerFrame, frameCountRun;
-    private long frameCount;
     private LWJGLOpenVRInput VRinput;
     
     
@@ -123,18 +117,14 @@ public class LWJGLOpenVR implements VRAPI {
         return "OpenVR/LWJGL";
     }
     
-    private static long latencyWaitTime = 0;
-    
     @Override
     public void setFlipEyes(boolean set) {
         flipEyes = set;
     }
     
-    private boolean enableDebugLatency = false;
-    
     @Override
     public void printLatencyInfoToConsole(boolean set) {
-        enableDebugLatency = set;
+        // not implemented
     }
 
     @Override
@@ -174,7 +164,7 @@ public class LWJGLOpenVR implements VRAPI {
                 poseMatrices[i] = new Matrix4f();
                 hmdTrackedDevicePoses[i] = trackedDevicePose.get(i);
             }
-            timePerFrame = 1.0 / hmdDisplayFrequency.get(0);
+            hmdDisplayFrequency.get(0);
             TrackedDevicePose.create(VR.k_unMaxTrackedDeviceCount);
             // init controllers for the first time
             VRinput = new LWJGLOpenVRInput(environment);