Saturday, August 27, 2022
HomeGame DevelopmentBulletphysics in whereas loop very sluggish in machine - Cocos Creator

Bulletphysics in whereas loop very sluggish in machine – Cocos Creator


I’m making a Pool/Billiards recreation in cocos creator.
For AI calculation, I’m operating physics in whereas loop for some iterations and choose finest shot. Subject is all the things works on the spot in browser (<2 seconds for full 30 photographs), however once I run it in simulator or machine (iOS/Android) it takes ~30 seconds of time.
There may be nothing a lot in scene, solely 16 balls (sphere inflexible our bodies), and a Set off to verify if ball is pocketed or not.
I attempted “await nextFrame()” sort of logic after each few iterations inside whereas loop however nothing a lot improved.
I looked for Multithreading in cocos creator however didn’t discover any documentation associated to it.
Please assist me on this.


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments