MackeyK24 Posted January 8, 2018 Share Posted January 8, 2018 6 hours ago, RaananW said: There were no major cannon.js changes in 3.1... Nothing really changed other than the ticker. and the parenting system (which is a general issue, not cannon's). Disposing - dispose the impostor and then the mesh itself. if it doesn't work, please let me know so I can investigate it. Te reason for this is - A mesh and an impostor are loosely coupled. you CAN set mesh.physicsImpostor, but it is certainly not a must. It was mainly done since not only meshes can have a physics impostor. you, as a developer, need to take care of your impostors and dispose them manually. It is like that since 2.3 (If I am not mistaken), has nothing to do with 3.1 changes. Yo @RaananW How can I tell if I still have 200 resisted bodies... What tool or view did you look at to get the registered bodies count ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 8, 2018 Share Posted January 8, 2018 you can always use the physics engine directly or read the number of impostors in the physicsEngine class of Babylon (scene.getPhysicsEnginge().getImpostors()). Unless you disposed NOT using babylon, this should show you the amount of impostors. Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted January 9, 2018 Share Posted January 9, 2018 Yo big thanks to @RaananW and @Deltakosh ... My upcoming 3.2 alpha build of the toolkit fixes all the cannon physics issues and metadata cloning issues. now my Space Game Shooter Demo update is working great with latest 3.2.0 Alpha build of the babylon engine. The toolkit scene component lifecycle properly destroys scene components and any physics imposters then safely disposes the owner object (Mesh, camera or light). I purposely create and destroy every Player Ship, Enemy Ship, Asteroids and the two different laserbolts to stress test the scene component life cycle. It is working great for me with excellent Frame rate on my MacPro using a GTX-770 class video card. All traces of all mesh hierarchy are instantiated via PREFABS and DESTROYED leaving CLEAN scene.meshes list and from what I can tell no leaks or major performance issues. Also using my 'Mesh Instances' system from the toolkit... Even with ALL the asteroids, enemy ships, players ships, multiple laserbolt shots from both the player and enemy ships and the particle systems on both player and enemy ships that can be on the screen at one time never exceeds more that 20 draw calls even all the way thru the third level with many more ships, asteroids and laser bolt shots on the screen. Also... Supports a new Shinny 'Collision Group Filter' setup that can be used in the editor to provide fine tuned physics collision (which HELP GREATLY with the collision MISSES from before): Example Physics State Component attached to the Player Ship Game Object ... Note: Player Ship assigned to FILTER GROUP2 and the Collision Mask only allows collision with GROUP3 (Enemy Ship), GROUP4 (Asteroids) and GROUP6 (Enemy Laserbolts) And Example Enemy Ship Physics State Setup: Its assigned to FILTER GROUP3 and only allows collision with GROUP2 (Player Ship) and GROUP5 (Player Laserbolt) WORKS PREFECT FROM WHAT I CAN TELL Yo @RaananW and @Deltakosh (And really ANYONE who can help)... Can you please try the current Space Shooter Demo Look for those MANY imposter issues you saw before, check the smoothness of the physics movement (everything moves with physics) And use the 'Profiler' to check for ANY performance issues .. especially with the many GAME OVER restarts and YOU WIN restarts which loads a new level each time BUT in the same same DOM... that index host page NEVER actually reloads... Just reload the same level (could be any level though). NOTE: STILL WORKING ON BETTER PARTICLE SYSTEM EXPLOSION EFFECTS NOTE: MOVEMENT IS WAY BETTER USING A XBOX Controller (or basically a GamePad) Anyways... Please Check Out The Demo Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 9, 2018 Share Posted January 9, 2018 This is really good and it works flawlessly on my computer ! Congrats man!! (by the way several people asked for documentation update ;)) 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.