Camera lookingat binding click

Hi there!

I would like to process single mouse clicks/ key presses. The binding listener doesn't seem to allow this or am I missing something? Also something that seems very intuitive and handy is a fn to get a vector that tells where the camera is looking at. Are there plans to include such functionality? If not, how can I do it? (some operations with up, left and direction but I have no clue what I should do with those 3 vectors)

what kind of binding listener do you mean, there are many ways to process input in jME.



Camera.getDirection() returns the direction the camera is facing

http://www.jmonkeyengine.com/doc/com/jme/renderer/Camera.html#getDirection()

Oh, right direction works! (I had some other bug :() The thing with register-binding is that it spikes multiple clicks/keys even if to me it seems like a single click so, aside from setting a timer*, is there another way of processing single keystrokes/mouse clicks?





*something like:

onbinding (b v) {

  if (b.equals("Shoot") && timershoot.equals(0)){

    shoot-ball(10);

    timershoot.reset();

}}

i guess it should work with your timeout.



look at other examples like jmetest.TutorialGuide.TestPong to see how input handling can be done.

Oh so you're using it for shooting? In that case, you should have some sort of "shooting rate", like 1 projectile every second for example, then add the "value" you get in the BindingListener event to the time and reset it when it reaches when second.

Thanks for the tip Momoko_Fan. Another thing, last night I was building the current branch of jme3 and I can't seem to run any of the tests.


Exception in thread "LWJGL Renderer Thread" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys
   at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:153)
   at java.lang.Thread.run(Thread.java:636)

Is lwjgl.jar included in the classpath?

Yes it is, but it gave me problems… I add to manually put liblwjgl64.so on the classpath otherwise it was giving:


Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl64 in java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
        at java.lang.Runtime.loadLibrary0(Runtime.java:840)
        at java.lang.System.loadLibrary(System.java:1047)
        at com.jme3.system.Natives.extractNativeLib(Natives.java:43)
        at com.jme3.system.Natives.extractNativeLibs(Natives.java:125)
        at com.jme3.system.JmeSystem.initialize(JmeSystem.java:308)
        at com.jme3.system.JmeSystem.newContext(JmeSystem.java:234)
        at com.jme3.app.Application.start(Application.java:203)
        at com.jme3.app.Application.start(Application.java:186)
        at com.jme3.app.SimplePhysicsApplication.start(SimplePhysicsApplication.java:86)
        at jme3test.bullet.TestPhysicsCar.main(TestPhysicsCar.java:25)



It's weird because it used to extract the necessary files and put them on the appropriated folder.

Maybe you forgot to include lib/lwjgl/jME3-lwjgl-natives.jar in the classpath? There were some changes to the natives-extraction mechanism… it might mean your current setup wont work.

No, it's also there.  :( is there some other information I can provide you to help debug this? I'm completely clueless.



EDIT: now I'm back at square one… can't even solve the "no lwjgl64 in java.library.path"



EDIT2: ok… this is definitely some bug with netbeans because now it works fine grrr.