Collision Traverser Question [SOLVED]

Panda3D Forum Index -> Scripting Issues Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
piratePanda


Posts: 225

PostPosted: Sun Nov 15, 2009 2:41 pm    Post subject: Collision Traverser Question [SOLVED] Reply with quote
I'm working on setting up some collisions in my game. My intention is to break up the level by region to reduce the number of collision checks necessary each pass. When I was thinking of how to do this, I decided I needed to have my regions overlapping slightly to make sure that potential collisions didn't go undetected at region borders. The problem this presents is that there are times when a character may be in the overlap between two regions, and thus must be checked for collision by objects in both regions.

I had originally thought that I would just parent the objects in a given region to a particular node and feed that node to the traverser. Since a nodepath can only have one parent (I think) it doesn't seem like this is a viable option because of those times when things are in two regions. I was thinking instead that I might make lists of ojbects that correspond to regions, since I can put a nodepath into multiple lists, and then traverse each object in the appropriate lists individually.

My question is, will doing alot of little collision checks be more wasteful of system resources than doing one big collision check? Is that something I should worry about? Is there another way to get around this problem that would be better?
_________________
Yar! Hand ovar tha bamboo, says I!


Last edited by piratePanda on Wed Nov 25, 2009 4:29 pm; edited 1 time in total
ThomasEgi


Posts: 1820
Location: Germany,Koblenz

PostPosted: Sun Nov 15, 2009 2:58 pm    Post subject: Reply with quote
lots of little and one big boil down to the same.. lots and lots of colilsion checks.
the art is. to avoid all unnccessary checks.
that means. structure your nodes that as many checks as possible can be avoided.
quadtree or octree structures are very good for this purpose.
i suggest you search for treeform's octree script. it's very useful to create highly efficient collision geometry from real visible geometry.
_________________
rig: dell inspiron 1720; ubuntu 9.10_64 ;panda 1.7.0
may a catgirl be with you. nyaan nyan~~ ^.^
piratePanda


Posts: 225

PostPosted: Wed Nov 25, 2009 4:29 pm    Post subject: Reply with quote
Unfortunately the egg octree isn't quite what I'm looking for, since I'm using multiple eggs to create a dynamic world instead of a static world in a single egg. You did answer my question though, so thanks. :)
_________________
Yar! Hand ovar tha bamboo, says I!
treeform


Posts: 2027
Location: Seattle

PostPosted: Wed Nov 25, 2009 6:36 pm    Post subject: Reply with quote
There is planty of scripts to do what you want too.

I recommend using the GeomOctree (not written by me).
1 You load your dynamic map.
2 walk your entire scene
3 put all the static goems collisions into your collision octree.
4 use your collision octree for collision form now on

http://github.com/treeform/eggOctree
_________________
Panda3d IRC irc://irc.freenode.net/panda3d | BUGs https://bugs.launchpad.net/panda3d
My MMORTS game: http://aff2aw.com
GitHub: http://github.com/treeform | Twitter: http://twitter.com/treeform
Display posts from previous:   
Post new topic   Reply to topic    Panda3D Forum Index -> Scripting Issues All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group