Original Post
I was just woundering what the community thought of my implementation of my scene graph:
Points of interest: 1) The scene graph will be wrapped by a "Resource Manager Service" that will handle them maintenance of the scene graph. The root node will be a list of nodes really so there can be independent aspects of the graph. So here it shows how a 2D HUD has it's elements hooked into the scene graph as well as all the 3D elements. 2) These are the 2D HUD elements. Guess they didn't need a point of their own here... 3) This is the initial translation node that will, as far as I can see ALWAYS be there. It represents the initial camera translation. I guess there will always be a rotation node, but forgot to add that in the pic. 4) This engine is BSP Tree based. So the camera will be located in one of the BSP Leaves. When the camera changes leaves the "Resource Manager Service" will take the new Leaf node and hook it in as the node right under the initial translation and rotation nodes. This point I think bares some more explanation. With the BSP Tree of course comes the Potentially Visible Sets (PVS). For those who don't know these are other leaves that could possibly be seen from the current leaf the camera is in. So what this means for our scene graph is our main leaf node will have sibling (or child, haven’t decided yet, probably child) nodes for each leaf in it's PVS. 5) Each leaf node will contain children of course of every entity that is spatially located inside that leaf's bounding box. Again the "Resource Manager Service" will handle moving entities to the proper nodes and such. 6) These are just the other BSP Leaves in the PVS in a child configuration under the main Leaf. I've been planning on traversing this using the visitor pattern but considering the number of different nodes there can be in the future I was thinking the visitor class could get massive... Maybe I should just have each node handle it's operations it's self in a simple recursive fashion? It would make adding new node types easier since you would not have to create 1 new class and edit another (The visitor). So tell me what you think please! [Edited by - Wavesonics on August 25, 2006 1:21:38 PM]
Points of interest: 1) The scene graph will be wrapped by a "Resource Manager Service" that will handle them maintenance of the scene graph. The root node will be a list of nodes really so there can be independent aspects of the graph. So here it shows how a 2D HUD has it's elements hooked into the scene graph as well as all the 3D elements. 2) These are the 2D HUD elements. Guess they didn't need a point of their own here... 3) This is the initial translation node that will, as far as I can see ALWAYS be there. It represents the initial camera translation. I guess there will always be a rotation node, but forgot to add that in the pic. 4) This engine is BSP Tree based. So the camera will be located in one of the BSP Leaves. When the camera changes leaves the "Resource Manager Service" will take the new Leaf node and hook it in as the node right under the initial translation and rotation nodes. This point I think bares some more explanation. With the BSP Tree of course comes the Potentially Visible Sets (PVS). For those who don't know these are other leaves that could possibly be seen from the current leaf the camera is in. So what this means for our scene graph is our main leaf node will have sibling (or child, haven’t decided yet, probably child) nodes for each leaf in it's PVS. 5) Each leaf node will contain children of course of every entity that is spatially located inside that leaf's bounding box. Again the "Resource Manager Service" will handle moving entities to the proper nodes and such. 6) These are just the other BSP Leaves in the PVS in a child configuration under the main Leaf. I've been planning on traversing this using the visitor pattern but considering the number of different nodes there can be in the future I was thinking the visitor class could get massive... Maybe I should just have each node handle it's operations it's self in a simple recursive fashion? It would make adding new node types easier since you would not have to create 1 new class and edit another (The visitor). So tell me what you think please! [Edited by - Wavesonics on August 25, 2006 1:21:38 PM]