CharControl constantly colliding with terrain in TestWalkingCharacter even when at rest

Hi All,



Apologies if this is a naive question but I’m fairly new to both jME (using v3) and also to physics and have only recently joined the jME community.



I’m looking to write an app that can load alot of different characters onto screen and have them as physics objects (can walk on the terrain, can bump into each other etc). However, whenever I try to load more that 5-10 models into the same application my framerate goes to zero. Doing some code profiling I found that the collision method in the app is being called all of the time for every model that is standing on the terrain. I went back to TestWalkingCharacter, turned off creation of the wall so the only physics objects I have were the RigidBodyControl (terrain) and the walking character(CharControl) and profiled the code to find that new collisions are being processed constantly for the CharControl colliding with the terrain, even when the character is stood still.



Is this normal and expected behaviour? as if it is I’m not sure the physics solution is going to scale at all. Also are there any other methods of making collidable terrain and objects without using bullet that might be cheaper on CPU/rendering performance?



Thanks



Physinoob

Forgot to say, I am using the nightly build

The behavior is normal, yes. Other way to move across terrain would be doing raychecks downwards and keeping the player at that height, in any instance you have to check collisions each frame…

OK thanks for quick response and clarification normen. I will sort out ray checks as I suppose I can control when they fire (i.e. they don’t need to fire when i am stationary on the ground).

Did you check if it wasn’t mainly the model doing the fps low? Also, try not adding them all at once or set the physics space to non-deterministic to see if you simply have physics overload due to restepping a the beginning (see setDeterministic method javadoc).

OK will do , thanks



The model I used was Oto so I am assuming it wasnt a model problem.

Setting to non-deterministic got completely different results thanks. Fps seems to stay above in the 60 range with up to around 30 models of Oto on screen. Again thanks for your help. And yes I was loading them all at the same time.

Frankly, oto is a problem :wink: Its not a very game-optimized model, we should use “Sinbad” instead. Happy you got it to work.

OK good to know :slight_smile: Thanks for all the help today