Author Topic: collision spherical x ellipsoid  (Read 4482 times)

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: collision spherical x ellipsoid
« Reply #15 on: June 11, 2011, 12:22:07 am »
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)
« Last Edit: June 11, 2011, 12:50:53 am by Thomas. »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: collision spherical x ellipsoid
« Reply #16 on: June 11, 2011, 10:42:57 am »
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?

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: collision spherical x ellipsoid
« Reply #17 on: June 11, 2011, 11:26:41 am »
yes, collision with level geometry takes about 5ms... geometry will splited to many rooms, it could help :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: collision spherical x ellipsoid
« Reply #18 on: June 11, 2011, 12:59:36 pm »
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.

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: collision spherical x ellipsoid
« Reply #19 on: June 11, 2011, 04:30:14 pm »
geometry is splited, collisions takes 8ms (ellipsoid for player and spherical for gravity)... how to slide with player along a wall?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: collision spherical x ellipsoid
« Reply #20 on: June 11, 2011, 06:15:01 pm »
That is part of the collision detection, if you using ellipsoid. Just use an iteration depth larger than 1 and will happen automatically.

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: collision spherical x ellipsoid
« Reply #21 on: June 11, 2011, 07:02:49 pm »
higher values are doing problems, camera can go through some objects, stop and oscillate in objects...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: collision spherical x ellipsoid
« Reply #22 on: June 11, 2011, 08:26:30 pm »
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.