satguru Posted January 14, 2018 Share Posted January 14, 2018 @jerome I took your original document example https://www.babylonjs-playground.com/#FJNR5#190 and turned on collision and gravity https://www.babylonjs-playground.com/#FJNR5#210 When you move the camera around the fps drops from 60 to around 30 Is there anything which we can do to prevent this? Also camera tends to get stuck from time to time. Quote Link to comment Share on other sites More sharing options...
waverider Posted January 14, 2018 Share Posted January 14, 2018 @satguru i tried it with bjs in-built collision system but the fps drops too, but you can check what i did here : https://www.babylonjs-playground.com/#Z2TKLH using the heightmap coordinate looks more efficient https://www.babylonjs-playground.com/#FJNR5#212 satguru 1 Quote Link to comment Share on other sites More sharing options...
satguru Posted January 15, 2018 Author Share Posted January 15, 2018 nice pg @waverider I am trying to use Dynamic terrain with my Character Controller. Here I have an ArcRotateCamera following a Character. If i turn on checkCollosion on the camera, the FPS drops to 21-25. If I turn it off, FPS goes back up to 60, Weird. The camera does not collide with anything. It just follows the character. The character has collision turned on. You would think collision on the character would make a difference. After all it is the character which is colliding with the terrain But no. It is collision on camera which makes the difference!! Quote Link to comment Share on other sites More sharing options...
jerome Posted January 15, 2018 Share Posted January 15, 2018 the most efficient way to check collisions with a dynamic terrain or any BJS Ground objects (although they aren't the same) keeps to use the methods getHeightAtCoordinates(x, z) and getNormalAtCoordinates(x, z) or getHeithFromMap(x, z) and getNormalFromMap(x, z) depending on the object class https://www.babylonjs-playground.com/#J6FMJ#7 https://github.com/BabylonJS/Extensions/blob/master/DynamicTerrain/documentation/dynamicTerrainExamples.md It's hundreds of times fastest. NasimiAsl 1 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.