mese79 / TouchControls

This is a three.js controller which supports touch events and hit-testing.
http://mese79.github.io/TouchControls/
MIT License
68 stars 17 forks source link

hittest cpu #4

Open gushenjie opened 2 years ago

gushenjie commented 2 years ago

After the collision detection is turned on, the FPS on the PC side is only about 30 frames, and on the mobile side, it is only about 6 frames. Is there any suggestion for optimization?

mese79 commented 2 years ago

Do you run the provided example or your own one?
For me, this example works about 60 fps on my laptop and mobile.

gushenjie commented 2 years ago

I directly access the example address you sent, and it is a black screen after clicking to open through WeChat

gushenjie commented 2 years ago

It may be that the number of objects detected by the raycaster is large. I printed the timestamp log on the mobile terminal and found that it took 60ms.

mese79 commented 2 years ago

If you have numerous objects in the scene, then yes, that might slow down the collision detection.