Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babylon.js FreeCamera default controls not fully working with microscript 2.0 on Apple devices #212

Open
SugarRayLua opened this issue Jan 15, 2024 · 0 comments

Comments

@SugarRayLua
Copy link

SugarRayLua commented Jan 15, 2024

Per the following Babylon.js playground, the following code demonstrates the expected Babylon FreeCamera default controls (with the addition of a mouse.wheel control):

https://playground.Babylonjs.com/#DWPQ9R%231

Using Babylon.js on that demo playground, the following features work on both my Apple desktop and mobile device (iPad Pro w/keyboard/mouse):

Camera rotation: mouse, touch (mobile)
Camera forward/backward: mouse wheel, arrows forward/backward
Camera side to side: trackpad, arrows left/right

But, translating the playground code below to microscript 2.0 and enabling Babylon.js graphics on micro studio:

init = function()
  scene = new BABYLON.Scene()
  camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0,5,-10), scene)
  camera.inputs.addMouseWheel()
  camera.setTarget(BABYLON.Vector3.Zero())
  camera.attachControl(true)
  light = new BABYLON.HemisphericLight("Light", new BABYLON.Vector3(0,1,0), scene)
  light.intensity = 0.7
  sphere = BABYLON.MeshBuilder.CreateSphere("sphere", object diameter=2 segments= 32 end, scene)
  sphere.position.y = 1
  ground = BABYLON.MeshBuilder.CreateGround("ground", object width= 6 height= 6 end, scene)
end

update = function()
end

draw = function()
  screen.render(scene)
end

Only the following features work:

microStudio on Safari (Mac Desktop Sonoma 14.2.1), microStudio app on Mac (latest release)
Camera rotation: mouse
Camera forward/backward: mouse wheel (but arrows don't work)
Camera side to side: (arrows don't work)

microStudio on mobile Safari (iPad Pro with keyboard/trackpad iOS 16.7.2)
Camera rotation: mouse, touch (mobile)
Camera forward/backward: (mouse wheel and arrows forward/backward don't work)
Camera side to side: (trackpad and arrows left/right don't work)

Fyi.
Thanks!

*Addendum,
I apologize; I wasn't previously aware that there was a separate Babylon channel in microStudio discord and now saw that the issue about controls for the camera not working the same in microStudio as in the Babylon.js playground was previously mentioned in that channel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant