Mouse movement of the camera around the scene

Good day. I’m trying to implement the view as in the RTS. That is, so that the cursor can move the camera around the scene (by swiping to the side, the position and the target of the camera move). You can do this with the right mouse button with this camera, but it doesn’t quite work, so I’m trying to come up with :slight_smile:

While the implementation looks like this, there are three confusing points:

  1. I don’t understand how to smoothly move the camera, at the moment it teleports to the desired point (although this is not scary)
  2. I can’t combine movement with rotation, my attempts can be seen in the commented out lines. For example: the focus point and position have moved, then with the mouse we rotate the scene along the axis and again try to move the focus point and camera position.
  3. How can the conditions BABYLON.PointerEventTypes.POINTERDOWN be separated
    and
    BABYLON.PointerEventTypes.POINTERTAP?
    When using POINTERTAP - POINTERDOWN is applied anyway, two places with the log are also commented out in the attached site, in order to understand what I mean.

I am completely new to javascript, so I will gladly accept any comments, corrections and suggestions for optimization.
https://playground.babylonjs.com/#1VU7V5

oh no, my sketches (commented out) have not survived… Now I will add
https://playground.babylonjs.com/#1VU7V5#3

@PolygonalSun might provide some tricks here and if you did not check it yet Customizing Camera Inputs | Babylon.js Documentation

I read this article several times, and unfortunately it didn’t help me, or I just don’t understand how it can be used in what I want to get. For a free camera, you can use the left / right / up / down buttons to move the camera around the scene, but I don’t know how this can be redone to do the same with the mouse held down with swipes, including the oblique swipe.

@syntheticmagus might have some tricks.

But here you first need to detect swipes :slight_smile: