autoRotate Camera

Problem: If I click the buttons, or anywhere, auto rotation stops.

I can set this:

camera.autoRotationBehavior.zoomStopsAnimation = false;

which allows the camera to zoom and the auto rotate camera keeps going…

…but I can’t find anything in the API docs about doing the same for other interactions.


I would like to click a button on the GUI to drop a sphere without disrupting the camera’s autoRotationBehavior, while keeping the built-in ArcRotateCamera controls to adjust the camera or zoom in/out if wanted.

Is that possible?

I’ve tried “.idleRotationWaitTime” to zero and everything, I’ve Google’d it, and have actually spent some time researching this to become quite adept with camera settings but this seems to be a deliberate design choice that I can’t figure out.

Playground:

Starting to feel like an interloper here, will someone at least say hello? Is there anything I can do to improve the quality of my post/question? I could do videos and screenshots but seems unnecessary with the included PG.

:cry:

If it is just that click, you can meet the needs by removing PrePointerObserver, which handles pointer down event:

scene.onPrePointerObservable.remove(camera.autoRotationBehavior._onPrePointerObservableObserver)

The full PG:

Maybe we can give them public access or create additional boolean? @PolygonalSun

3 Likes

Huh…Hello :smiley: :grin: Sry, it’s the weekend and also holidays period :beach_umbrella:
I don’t think the wait has been that long (compared to other forums) :hourglass_flowing_sand:
And at least you got THE answer above. Likely the best answer you can get.

That’s a +1 from me (for either one) :+1:

1 Like

@Takemura That’s crazy, just that one line. How the heck did you find that?!?!

Many thanks!

Sorry for being impatient, I did see at the time only 13 people had even read my post. Damn these beers! Thanks for the kind response, Cheers!

You can check out BabylonJS on github. The autoRotationBehavior creates an observer on camera attach to track the pointer down event:

And considers it on evaluation of animation stop (Line 140 > Line 219 > Line 237).

I was gonna ask for more details because

onPrePointerObservableObserver

makes absolutely no sense, LOL

Thank you for the extra info! Researching now…

Based on? I understand it can feel a bit cumbersome (or unconventional) but I think the explanation (or sense) as been given above (or below - quote)

Now, if you are unhappy with this solution/method, I’m sure We (the Team & the Community) and then @PolygonalSun (for more info on pointers)… we all would gladly take your contribution towards improving pointer interactions and camera handling in scene :grin: You can take this as an invitation or… a challenge :joy: The choice is yours and meanwhile, have a great day :sunglasses:

No, no, the explanation/answer was perfect, I’m still learning is all. Thanks again!