Mouse move settings for First-person cam (universal camera)

Dears,

This will be my first project using a first-person camera and it looks like I’m struggling a little finding some of the parameters I would expect for mouse (move) input.
Being a gamer, there are two parameters for mouse movement I always set in an FPS.

Those are:

  1. Independant horizontal and vertical mouse sensitivity/sensibility.
  2. Mouse acceleration.

Now, I find mouse acceleration to work only with the follow cam and I’m used to set ‘angularSensibilityX’ and ‘angularSensibilityY’ on the arcRotateCamera.

But then, these don’t seem to apply to the universalCamera. I would have expected to be able to set these parameters as I find them to be kind of common (not to say basic) in the games I play.
Or I should set them elsewhere?

Thanks in advance for your help and meanwhile, have a great day :sunglasses:

I found this uncompleted example of a UniversalCamera
VIRTUALJOYSTICK GUI | Babylon.js Playground (babylonjs.com)

I hope it helps a bit

var createCamera=function(scene){
BABYLON.Vector3.Zero(), scene);
     camera = new BABYLON.UniversalCamera
    ("camera1", new BABYLON.Vector3(0, 5, -10), scene);
    camera.setTarget(BABYLON.Vector3.Zero());

    // This attaches the camera to the canvas
    camera.attachControl(canvas, true);
    camera.inputs.add(camera.inputs.attached.touch);
    camera.speed = 0;

    camera.touchAngularSensibility = 12000;
    camera.inputs.addMouseWheel();
    camera.touchMoveSensibility=500;
    camera.pinchPrecision = 80;
    //camera.panningSensibility = 80;
    camera.useNaturalPinchZoom = true;

    camera.inputs.attached.mousewheel.wheelPrecisionX = 0.2;
    camera.inputs.attached.mousewheel.wheelPrecisionY = 0.2;
    camera.inputs.attached.mousewheel.wheelPrecisionZ = 0.2;

    camera.inputs.checkInputs = false;
}

Thanks for trying but no, not this time :hugs:
My question really is just for:
A separate sensitivity/sensibility on the vertical and horizontal move and if it somehow exists,
A mouse acceleration (factor) for the mouse movement.
And then eventually for touch also.
I (sort of) know about the other parameters.
But again, thanks a lot for taking the time to have a look and reply and have a great day :sunglasses:

At least I pushed your request to the top! :crazy_face:

cc @PolygonalSun

Hey @mawa,
AFAIK, the UniversalCamera uses the FreeCamera inputs which only have the single variable angularSensibility. The input could be changed to have separate axis values. I could also see creating a new input that extends FreeCameraMouseInput and just overrides the attachControl function.

Here’s a sort of hacky way to do what I described above: Separate Axes | Babylon.js Playground (babylonjs.com)

2 Likes

Thanks so much for your reply and the quick go-around ‘hack’. Not sure if I will use it; I’m not making an FPS so it’s not absolute necessity for me just now.
May be others will still want to have the ‘less hacky’ solution? :thinking: We’ll see.
Right now, I’m good just like that so I think we could just leave it here for now.
Thanks again and have a great day :sunglasses: