Jump to content

ArcCamera virtual joystick


Recommended Posts

I would like to si ArcCamera to have plugin for virtual joystick for rotation. Or optional feature to joystick for move forward backward (which could be enabled or disabled)
But joystick for rotation will be fine to see.

I have some example how arccamera follow ball. I create my own joystick for rotation only (without forward and backward..... options!) (and posibility for forward/backward/left/right joystick which we could attach 3d calulation of object in center of arccamera)

Can anybody add feature for arcCamera rotation pick/touch joystick like VirtualJoysticksCamera have it on the right side?
Maybe you should inharid arcCamera and create ArcVirutalJoystickCamera.

Have anybody any opinion. Maby babylon.js should add this feature in new release.


Link to comment
Share on other sites

Hi Ian.  I began some tests...  http://www.babylonjs-playground.com/#OORFZ#14

IF you don't see cyan-colored VJ rings, momentarily change the URL to #12, browse that, and then return to #14... you should see rings, then.

(I'm still working on WHY it's doing that.  Might be firefox only.)

The VJ only remains ON for 15 secs right now... because testing virtual joysticks in the playground can cause a condition where you can't edit in the editor anymore.  I believe it is caused by a missing .setVjCanvasAtopRenderCanvas() feature.

I "borrowed" part of the virtual joysticks (vj) system... the vj._onPointerMove function (line 37+).  In lines 71-73, I apply the delta values from the joystick... to the arcRotateCam alpha and beta values (its orbit left/right/up/down properties). 

Works ok, huh?  Next, we can try holding control while dragging... to make the arcCamera take other actions... like move its target in/out/left/right. 

After a playground SAVE, you might see a condition where the joystick rings are ON as soon as you hit RUN.  I see it often.  Completely reload the playground, and it might start working correctly again.  I am still fighting with this issue, and not sure why it happens.  MAYBE we need to destroy the old vjCanvas in a scene.onDispose function or something.  Not sure yet.  Talk soon.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...