Archived

This topic is now archived and is closed to further replies.

dynamic players in scene graph

This topic is 5670 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Lets say I am doing an outdoor terrain engine with units moving around constantly. I could use an octree or a quadtree. This could represent the root of my schenegraph, basically, the world! There are a couple options to attach dynamic objects. 1) Would I attach dynamic moving units to the root of the scenegraph (much like the world node), and traverse EVERY item culling them, or... 2) attach the units into the world? If I attach it to the world, I would need to dynamically shift them from node to node as they move around. What happens in the case that they are between two nodes? How would I solve this problem efficiently? Are their other alternatives, can anybody provide me with some helpful hints/links? Thank you in advance!

Share this post


Link to post
Share on other sites
Depends on how many units you have. If you don''t have too many units, just use method 1. However, this isn''t scalable, so I''d suggest to do method 2 in the first place.

Yes, you need to dynamically shift them from node to node, but that''s not that hard. Just every time your unit moves, check which node it''s in and traverse down the tree until you get to the smallest one. If the unit is in more then one node there are a number of solutions, but I personally prefer to keep it in both. Just have some kind of a flag for each object so it won''t be processed twice in some cases.

Share this post


Link to post
Share on other sites