Jump to content
  • Advertisement

Archived

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

dynamicman

dynamic players in scene graph

This topic is 5952 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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!