n5ro / aframe-physics-system

Physics system for A-Frame VR, built on CANNON.js.

Home Page:https://n5ro.github.io/aframe-physics-system/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slight lag when adding dynamic entity to scene and turning camera

NVFedorov opened this issue · comments

Hello,
I'm not sure whether it's a bug or I'm doing something wrong, but when I open a scene on my phone and click on a button to add a dynamic sphere to the scene, there is a slight lag: the whole scene hangs for a noticeable moment before adding the sphere. The thing is when I tap the button and immediately release it, everything seems to be fine, but when I hold a button for like quarter of a second and move my phone, the scene hangs for the same amount of time. Looks like the "hold button" time and lag time are proportional.

I modified the orange cannon example to reproduce this behavior: https://glitch.com/~alkaline-hollow-breakfast
Also I recorded a video: https://youtu.be/lo8ZiCuxa58

Update:
Here is another example, but this one works pretty well. I used a clickable plane to launch spheres:
https://glitch.com/~holly-sparkling-chronometer

But then a question comes: I need a static button which user can tap (not with cursor) and using something like aframe-mouse-cursor-component looks like an overkill. Is there a way to work it around?

Update 2:
I figured out how to work it around:
https://glitch.com/~acute-courageous-bus
But still is it possible to have a smooth scene with non aframe button click?

would be helpful if you opened the chrome performance profiling tools to get more detailed info on what was happening.