One thing that annoys me is that when I click using the left mouse button the cursor disappears. I also don’t want to use that button to rotate the world, but I couldn’t fix it without touching the base class because “canRotate” is private. (I override onAction(…) and registerWithInput(…))
So I changed it to protected (also did a bit of cleanup).
Here’s the diff if you guys are interested in adding it.
[patch]# This patch file was generated by NetBeans IDE
It uses platform neutral UTF-8 encoding and n newlines.
— Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -85,7 +85,6 @@
private boolean zooming = false;
private boolean trailing = false;
private boolean chasing = false;
- private boolean canRotate;
private float offsetDistance = 0.002f;
private Vector3f prevPos;
private boolean targetMoves = false;
@@ -96,9 +95,9 @@
private final Vector3f pos = new Vector3f();
protected boolean dragToRotate = true;
protected Vector3f lookAtOffset = null;
- protected boolean invertYaxis=false;
- protected boolean canRotate;
- protected boolean invertYaxis = false;
-
/**
- Constructs the chase camera
-
@param cam the application camera
@@ -137,8 +136,6 @@
}
}
}
-
-
}
boolean zoomin;
@@ -164,7 +161,6 @@
}
zoomin = false;
}
-
}
/**
@@ -175,10 +171,10 @@
String[] inputs = {"toggleRotate", "Down", "Up", "mouseLeft", "mouseRight", "ZoomIn", "ZoomOut"};
this.inputManager = inputManager;
-
if(!invertYaxis){<br />
-
if (!invertYaxis) {<br />
inputManager.addMapping("Down", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
inputManager.addMapping("Up", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
-
}else{<br />
-
} else {<br />
inputManager.addMapping("Down", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
inputManager.addMapping("Up", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
}
@@ -190,8 +186,6 @@
inputManager.addMapping("toggleRotate", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
inputManager.addListener(this, inputs);
-
-
}
private void computePosition() {
@@ -780,15 +774,13 @@
this.invertYaxis = invertYaxis;
inputManager.deleteMapping("Down");
inputManager.deleteMapping("Up");
-
if(!invertYaxis){<br />
-
if (!invertYaxis) {<br />
inputManager.addMapping("Down", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
inputManager.addMapping("Up", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
-
}else{<br />
-
} else {<br />
inputManager.addMapping("Down", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
inputManager.addMapping("Up", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
}
-
inputManager.addListener(this, "Down","Up");<br />
-
inputManager.addListener(this, "Down", "Up");<br />
}
-
-
}
[/patch]