Prevent zoom-in

How do i prevent the zooming in of the camera when you scroll?

Have you tried:

http://hub.jmonkeyengine.org/javadoc/com/jme3/input/FlyByCamera.html#setZoomSpeed(float)



with 0?

that method doesn’t seem to work, its not an suggestion and gives an error when i type it in manually

@ninetailfox97 said:
that method doesn't seem to work, its not an suggestion and gives an error when i type it in manually


Then you are either calling it on the wrong thing or you have not provided enough information.

Show us the code you are using.

You should also be able to remove the inputMapping, check the source code of the fly by camera to what it is. It’s gonna be something like “FLYCAM_Zoom_In” and out. I plan to rewrite the flycam at some point (im rolling with my own one atm but still wanna add more generic features), to make stuff like this easier, to be able to map to different keys for different countries automatically (not everyone useASD). To improve the rotation logic, and add more customisability to it in general (i.e space cam, and a more realistic first person view with constraints in directions, stuff like that). And also to have a PhysicsFlyCam as well, I already tried that once a whole ago (failed bad :P).

To add to pspeed’s post, you want to call it on the flyCam rather then the cam. So what should work is this:



[java]flyCam.setZoomSpeed(0f);[/java]



I suppose you tried cam.setZoomSpeed(0f); before but Camera and the FlyByCamera are 2 different things.

@wezrule said:
You should also be able to remove the inputMapping, check the source code of the fly by camera to what it is. It's gonna be something like "FLYCAM_Zoom_In" and out. I plan to rewrite the flycam at some point (im rolling with my own one atm but still wanna add more generic features), to make stuff like this easier, to be able to map to different keys for different countries automatically (not everyone useASD). To improve the rotation logic, and add more customisability to it in general (i.e space cam, and a more realistic first person view with constraints in directions, stuff like that). And also to have a PhysicsFlyCam as well, I already tried that once a whole ago (failed bad :P).


The thing is... fly cam is ONLY a mapping from input to a camera. Making it too much more complicated than that will make it hard for people to take it and make their own. Also, the reason fly cam's controls are not easily remapped is because InputManager does not make this easy in general. It's not really fly cam's fault. For example, using my InputManager wrapper, my own version of fly cam can be trivially remapped without any special code in the camera... since it has no concept of keys or inputs at all. (Note: my wrapper will be published as a plug-in soon.) At any rate, fly cam or any camera input thing should avoid including key remapping code. Include a standard set of mappings, allow it to be optionally used, and then let the caller map their own using the standard mechanisms if they choose to.

A space cam should be separate. The management of the camera is completely different in a non-fixed-up and there's no reason to pollute the FPS camera with this. I agree that a pitch constraint should be built into the standard cam, though.

More camera options will be good but be careful of polluting fly cam.

in the simpleInitApp method, I typed in “flyCam.” which gave a list of suggestions. The setZoomSpeed method is not within this list:



@ninetailfox97 said:
in the simpleInitApp method, I typed in "flyCam." which gave a list of suggestions. The setZoomSpeed method is not within this list:

http://i.imgur.com/0nSW1.png


What version of JME are you running? Maybe you should update to the latest one, rc2 or whatever.

should i use the nightly repository? i have no update from the stable repo

You don’t need to have the nightly version to see it. But you do need rc2 and you can get it here.

hmm, you should be able to update from the beta, instead of downloading the installer again

@ninetailfox97 said:
hmm, you should be able to update from the beta, instead of downloading the installer again


You could have... if you'd updated to stable. At any rate, you will probably be happier with rc2 because it's a newer and faster netbeans, as I understand it.
@ninetailfox97 said:
hmm, you should be able to update from the beta, instead of downloading the installer again

The actual application is a different one. It cannot be updated through incremental updates. Also this is a "field test" of major releases (3.1, 3.2 etc) which will due to the changes be separate applications with separate settings as well. From rc3 on you will be able to import your settings though.

ah i see, thanks for all the help