ArcRotateCamera swap rotation with pan

Hi

Is there a way f simply swapping ArcRotationCamera on mobile. To be precise I would like to pan with 1 finger and rotate with 2 finger swipe.

And is there a way to do that on the fly.

Thanks
Peter

you will have to provide your own input control: Customizing Camera Inputs | Babylon.js Documentation (babylonjs.com)

OK.

I’m asking cause I do not want to do that. This process is super complex already looked at this.

Should this not be just a simple mapping? like:

camera.rotationMobileControl = PointerEventTypes.SWIPE;

This is very unintuitive to do it like that. Or can you show a simple example of that in PG? Cause This is a second question that I open about this cause this is super complex, and it’s just a simple “key mapping”.

Regards
Peter

1 Like

I’m afraid pointer events are nothing but just simple key mappings. I have hated mobile for years and from the start (mostly gave it over for others to bother with;) I’ve just spent the entire week struggling with all sorts of mobile issues… just so you know, you’re not the only one:) Though, I’m afraid we cannot put this on BJS. We had issues with mobile since the start and the story continues…

Hi @mawa

You know what I reorganize my whole scene just to add a proper panning limit lately.

There is a lot of functionality that I’m missing for the camera. Like key mapping.

I looked at custom controls and I came to the conclusion “I do not want to touch this”. I tried and the results were horrible from a work and performance perspective.

I came with this and now I just need to swap 1 finger swipe with 2 finger swipe and I’m back to creating custom controls. This is not right. Especially that I will need to switch them back and forward on the go. That will be problematic.

And unfortunately. Yes, this is a simple mapping. But it was not implemented in a way that you can swap it easily and that’s the issue here.

I limited my panning axis and alpha rotation and now it turns out that 2 finger swipe to move around is a terrible experience and single finger swipe is not doing anything anymore. So you got options to turn some functionalities off but after that, you cant remap navigation :expressionless:

I would like to have a PG on how to achieve this cause I can’t figure it out from the docs. I read them but it does not mean I’m an expert in how to do it.

Regards
Peter

Agreed. And so would I.
I’m afraid I do not have the skills to help you with that since I’m kind of struggling with the same kind of topics just now. On top of that, I have other issues with mobile probably all related to different (or an accumulation of) causes;) Did I mention I hate mobile. Now, I did.

Hi @Deltakosh

Any update on this one?

Regards
Peter

What kind of update were you expecting from me? :slight_smile:

Hi @Deltakosh

A pg that switch rotation with panning gesture for mobile and mouse?

I see @mawa is also interested in this.

Regards
Peter

Adding @PolygonalSun our input grand master

Hi @PolygonalSun

Will you be able to help with this? I got a problem that it’s waiting for this a long time now :expressionless:

Would appreciate some help :expressionless:

Regards
Peter

Uh, hang on I did just read a similar topic, I wonder if it could apply here as well…
ok just found it,

I haven’t tested yet (this is straight out of the oven;)… I sort of have a feeling this piece of information could apply… I’ll try give it a test later today. May be on your side,…
Cya later,

https://playground.babylonjs.com/#SRZRWV#514 was the PG linked to the solution of my post.

Trying it on mobile - the pan works great, but rotate, less so, it seems to just pick it up as zoom.

yup, thanks for the info. Should I understand your case is also not ‘entirely’ solved?

Hi @mawa

Yes this is part of the solution.

Like @jdp1g09 says it works for panning, but. is not rotating with 2 fingers on mobile anymore.

For me it still pans with 2 fingers on mobile.

@PolygonalSun “Your our only hope”. But TBH I still would like to have key mapping bindings. You never know how and what will suit what situation. On laptop its maybe ok cause you got mouse, but on touch screen on laptop your in mobile gestures territory again. I just checked. And also 2 fingers are panning when hold in the same distance and zoom when pinching.

So no rotation with this solution.

Regards
Peter

Yes, totally agree. A heavy and complex subject but if any of the ‘automagical’ solution which is a specificity of BJS;) could be found for ‘elegantly’ ease this aspect, I’m sure many (but then many) of us would praise for this solution. It’s not as if the pointer interactions on mobile would be so awesomely great today that we could not find some ‘compromise’ (best-default) solution as an alternative. Here I’m not speaking necessarely BJS, just pointer VS mouse interaction (or default behavior interaction). This part is just soaking-up so much time (and driving so much confusion and frustration) in a cross-platform dev.

Hi @mawa

I actually like the fact that the touch screen laptop behaves like mobile (any other device with touch support) but I need options to configure the touch inputs and mouse inputs how I feel are good for my app.

Regards
Peter

Yes, so do I.

yup, thanks for the info. Should I understand your case is also not ‘entirely’ solved?

For my purposes, it was solved. I simply wanted to have the default laptop/desktop behaviour as pan with left-click and rotate with right, which it works great for.

On mobile, that relates to single finger drag for pan, but the rotate behaviour is lost (not a disaster inn my use case, but naturally, likely to be an issue for most)