Jump to content

Cameras touch inputs not working


max123
 Share

Recommended Posts

Hi,

Can anyone think of any reasons why cameras would not respond to touch events on a mobile (iPhone) but work perfectly fine with click/drag on a desktop? 
I have PEP loaded, scene.activeCamera.attachControl(this.canvas, false); set, CSS property touch-action: none; applied to canvas... 

I've tried ArcRotate and Universal cameras. 

Thanks

Link to comment
Share on other sites

Hello,

We were using @Deltakosh hand.js pointer events polyfill in the past that was using the CSS property on the DOM element as specified by the W3C spec. But after some discussion with the jQuery foundation, we decided to support their Polyfill and use PEP now by default. PEP needs a HTML attribute on the DOM element like <canvas id="babylonCanvas" touch-action="none"></canvas> to work. They didn't want to use the CSS approach as it requires some hack to download the CSS and reparse it to detect it.

In conclusion:

- if you're using hand.js (deprecated), use touch-action: "none" in CSS or if you're using only IE11/Edge
- if you're using PEP, add an HTML property touch-action="none" rather in the markup or by code like you've done

David

Link to comment
Share on other sites

1 hour ago, davrous said:

Hello,

We were using @Deltakosh hand.js pointer events polyfill in the past that was using the CSS property on the DOM element as specified by the W3C spec. But after some discussion with the jQuery foundation, we decided to support their Polyfill and use PEP now by default. PEP needs a HTML attribute on the DOM element like <canvas id="babylonCanvas" touch-action="none"></canvas> to work. They didn't want to use the CSS approach as it requires some hack to download the CSS and reparse it to detect it.

In conclusion:

- if you're using hand.js (deprecated), use touch-action: "none" in CSS or if you're using only IE11/Edge
- if you're using PEP, add an HTML property touch-action="none" rather in the markup or by code like you've done

David

use pep by default , do you mean we dont need to load pep js file? or we still need to have  pep.js? could u pls share some links for the doc about the touch support?

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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