ChaseCam Vertical Movement

the chaseCam’s vertical mouse movements are not in the way i want.I want to invert them. How to do it?



I want the camers to go up when I move the mouse up and vice-versa.

I have to submit my project within 30 hour, So, some code rather then guidance would help me greatly. :frowning:



I know that I need to replace the trigger parts in the inputManager.addMapping() lines with variables, and load different sets of trigger objects when the game starts…But, i dont get how to code it.



[java] inputManager.deleteMapping("Up");
inputManager.deleteMapping("Down");
inputManager.addMapping("Down", new MouseAxisTrigger(0, true));
inputManager.addMapping("Up", new MouseAxisTrigger(1, false));[/java]

I started with removing Up and Down mappings and remapped then.

Now do I need to write

[java]private AnalogListener analogListener = new AnalogListener() {
public void onAnalog(String name, float keyPressed, float tpf) {
if (name.equals("Up")) {
vRotateCamera(value);
} else if (name.equals("Down")) {
vRotateCamera(-value);
}
};[/java]

It looks like I have to drag a huge amount of fields and methods from the ChaseCam.java.

Is it the correct way?
iamcreasy said:
I have to submit my project within 30 hour, So, some code rather then guidance would help me greatly.

If you're betting your projects on other people giving you code then you are not doing it right.

I am just asking for a small part of it, and only because, I am about to hit a deadline. Most of the time I try to figure out the solution by myself.

in onAnalog:

[java]} else if (name.equals("Up")) {

vRotateCamera(-value);

} else if (name.equals("Down")) {

vRotateCamera(value);

[/java]



and in registerWithInput:

[java]

inputManager.addMapping("Down", new MouseAxisTrigger(1, true));

inputManager.addMapping("Up", new MouseAxisTrigger(1, false));

[/java]



Is this the behavior you want?

Is this the behavior you want?


yes, just inverting the up down motion of mouse..but, vRotateCamera(value), these things are gonna bring in a whole lot of fields and methods in my code from ChaseCamera.java.Do I need to find the values of the constant, and replace it to make it clean.

Is this the way it should be?

Or you could have Extend the chase camera for your own purpose and just override the registerWithInput methods to match the behavior you want.

Remember the Object Oriented thing…?



Pushing people is usually not the way to get the best out of them.



Anyway, because i’m too kind, and because this feature should be asked a fair amount of time, update to last svn and use chaseCam.setInvertYAxis(true); and you’ll get the behavior you want.

Or you could have Extend the chase camera for your own purpose and just override the registerWithInput methods to match the behavior you want.
Remember the Object Oriented thing…?


yes, actually, I am doing all the tasks,started form concept, to modeling, to UV, to rigging, to animating, to programming, to testing and etc etc stuff and I am not good at any of those...others team mates are doing nothing, so I am a little pissed of about this whole deadline thingy. I apologies to asking directly.

Anyway, because i’m too kind, and because this feature should be asked a fair amount of time, update to last svn and use chaseCam.setInvertYAxis(true); and you’ll get the behavior you want.


I dont know what to say, Thanks a Lot. :)