|
@@ -1,13 +1,13 @@
|
|
= jMonkeyEngine 3 Tutorial (5) - Hello Input System - Variation over time key is pressed
|
|
= jMonkeyEngine 3 Tutorial (5) - Hello Input System - Variation over time key is pressed
|
|
-:author:
|
|
|
|
-:revnumber:
|
|
|
|
|
|
+:author:
|
|
|
|
+:revnumber:
|
|
:revdate: 2016/03/17 20:48
|
|
:revdate: 2016/03/17 20:48
|
|
:relfileprefix: ../../../
|
|
:relfileprefix: ../../../
|
|
:imagesdir: ../../..
|
|
:imagesdir: ../../..
|
|
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
ifdef::env-github,env-browser[:outfilesuffix: .adoc]
|
|
|
|
|
|
|
|
|
|
-Parent: <<jme3/beginner/hello_input_system#,jMonkeyEngine 3 Tutorial (5) - Hello Input System>>
|
|
|
|
|
|
+Parent: xref:beginner/hello_input_system.adoc[jMonkeyEngine 3 Tutorial (5) - Hello Input System]
|
|
|
|
|
|
Here is a sample of a program where the camera accelerates if the key is kept pressed.
|
|
Here is a sample of a program where the camera accelerates if the key is kept pressed.
|
|
|
|
|
|
@@ -88,7 +88,7 @@ public class Accelerate extends SimpleApplication implements ActionListener {
|
|
if (left || right || up || down) {
|
|
if (left || right || up || down) {
|
|
// here we increment the speed using the tpf
|
|
// here we increment the speed using the tpf
|
|
camSpeed += tpf * 2;
|
|
camSpeed += tpf * 2;
|
|
- System.out.print("Camera speed " + camSpeed + "; Location:" + cam.getLocation().toString()
|
|
|
|
|
|
+ System.out.print("Camera speed " + camSpeed + "; Location:" + cam.getLocation().toString()
|
|
+ "; direction:"+cam.getDirection()+"walkDirection:" + walkDirection.toString());
|
|
+ "; direction:"+cam.getDirection()+"walkDirection:" + walkDirection.toString());
|
|
}
|
|
}
|
|
Vector3f camDir = cam.getDirection().clone().multLocal(camSpeed);
|
|
Vector3f camDir = cam.getDirection().clone().multLocal(camSpeed);
|