collision spherical x ellipsoid

Started by Thomas., December 31, 2010, 10:56:49 PM

Previous topic - Next topic

Thomas.

#15
So, work on collision system for switching rendered objects and objects for check collision is finished, but... when I moving with player method sets for rendered objects visibility(false) and for collision objects visibility(true)... but it has not any affect to check collision time... where could be the problem?

edit: I was looking on fps... improve 2ms when I hide all additional objects from map (12/10ms)

EgonOlsen

Which problem exactly? Collision detection is expensive only if a collision happens. For objects that can be discarded quite early, because they aren't in the translation path, it's pretty cheap. Not checking for these objects doesn't do much. The idea of using special objects for collision is to use a simplified version of them for that. That will improve performance but only if there actually is a collision with that object. The bounding box check that happens before doesn't care about the complexity of the object. Maybe the collision detection with the level geometry itself consumes most of the time?

Thomas.

yes, collision with level geometry takes about 5ms... geometry will splited to many rooms, it could help :)

EgonOlsen

You might want to try to use an octree for collision detection (not for rendering). If that doesn't help, using separate objects won't help either.

Thomas.

geometry is splited, collisions takes 8ms (ellipsoid for player and spherical for gravity)... how to slide with player along a wall?

EgonOlsen

That is part of the collision detection, if you using ellipsoid. Just use an iteration depth larger than 1 and will happen automatically.

Thomas.

higher values are doing problems, camera can go through some objects, stop and oscillate in objects...

EgonOlsen

Try to play around with it the value (it doesn't have to be very high...3-5 should be sufficient) as well as with the threshold setting in Config. Also have a look at the fps example in the desktop distribution.