Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualturch

Posted 04 February 2013 - 06:37 AM

Don't think of it as a monolithic structure. Keep as many copies of the data as you need. Graphics system needs to cull geometry based on visibility? Keep a quadtree/bsp tree/whatever around. Need to quickly look up certain game objects based on string keys? Keep those in a dictionary. Need a data structure specialized for physics? Have one of those around (if you're going to be using a 3rd party physics api then it will keep it's own copies of the data it cares about).

A general purpose scene probably doesn't need to support parent-child relationships. You only really need that for calculating world transforms (and you've got another class for that right?). If this is the "master list of all game objects" type of scene, then really all it needs to be is an array or some sort of dictionary if you have unique ids.

#1turch

Posted 04 February 2013 - 06:36 AM

Don't think of it as a monolithic structure. Keep as many copies of the data as you need. Graphics system needs to cull geometry based on visibility? Keep a quadtree/bsp tree/whatever around. Need to quickly look up certain game objects based on string keys? Keep those in a dictionary. Need a data structure specialized for physics? Look into those (if you're going to be using a 3rd party physics api then it will keep it's own copies of the data it cares about).

A general purpose scene probably doesn't need to support parent-child relationships. You only really need that for calculating world transforms (and you've got another class for that right?). If this is the "master list of all game objects" type of scene, then really all it needs to be is an array or some sort of dictionary if you have unique ids.

PARTNERS