gzlock Posted April 13, 2018 Share Posted April 13, 2018 I am not good at english, very sorry about that. Use the pc chrome emulated any touch devices open: https://www.babylonjs-playground.com/#0ZQ985#9 Runtime Environment: Highly customized environment of the phone app. Only touchstart/move/end events. No PointerEvent object. So, I did: Create the custom PointerEvent object. Create and use the ArcRotateCameraTouchInput object(use the scene.simulatePointerDown/Move/Up methods). Let the _onPointerDown/_onPointerMove/_onPointerUp of the Babylon.Scene properties listen to the canvas touchstart/move/end events. Already successful: Rotate the camera Interact with OnPickUpTrigger of the blue sphere. Interact with mesh ui button. Problems: Touch any position alway trigger the full screen ui button event. The Panning/Pinch control of the camera. Cannot trigger the OnPickTrigger event of the red sphere. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 13, 2018 Share Posted April 13, 2018 Hello, can you remind me why you need that? Why not using jQuery PEP suffice? Quote Link to comment Share on other sites More sharing options...
gzlock Posted April 14, 2018 Author Share Posted April 14, 2018 14 hours ago, Deltakosh said: Hello, can you remind me why you need that? Why not using jQuery PEP suffice? Because the runtime env is not a normal html env, that is more like run at the Node.Js. The runtime env just exposed the "game.js" file entry and GameGlobal/wx/canvas three global objects to the developer, no window/document objects, no Html DOM system. And it bind a touch events like that(need to fake a event system to trigger the canvas listened events): wx.onTouchStart(()=>{}) wx.onTouchMove(()=>{}) wx.onTouchEnd(()=>{}) wx.onTouchCancel(()=>{}) I think the touch event cycle is : When touch, the Android/iOS native app will trigger the wx object touch series events. My friend make a module to fake the window/document objects and Babylon.js runs successfully (just has simulate the touchstart/touchmove/touchend events, no simulate the pointer series events) I tried the jQuery pep not work, I think the jQuery pep module just can work on the normal html env. So I want to keep to use the touch events, and just solved the three problems then It's perfect. Quote Link to comment Share on other sites More sharing options...
Guest Posted April 16, 2018 Share Posted April 16, 2018 ok makes sense! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.