瀏覽代碼

FlyByCamera rise/fall behaviour (issue #617)

Changed riseCamera to use the up vector set with 'setUpVector(Vector3f upVec)' when pressing Q and Z which should make it go up/down.
JESTERRRRRR 7 年之前
父節點
當前提交
7095ad10e0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      jme3-core/src/main/java/com/jme3/input/FlyByCamera.java

+ 1 - 1
jme3-core/src/main/java/com/jme3/input/FlyByCamera.java

@@ -412,7 +412,7 @@ public class FlyByCamera implements AnalogListener, ActionListener {
      * @param value translation amount
      */
     protected void riseCamera(float value){
-        Vector3f vel = new Vector3f(0, value * moveSpeed, 0);
+        Vector3f vel = initialUpVec.mult(value * moveSpeed);
         Vector3f pos = cam.getLocation().clone();
 
         if (motionAllowed != null)