Sign in to follow this  

Scene graph suggestions?

Recommended Posts

Hello :)

I'm trying to create a re-usable scene graph (nothing too complex), to replace a quite purpose specific one I did for a pet game project I'm working on. Basically, I figured since i'm only doing this for fun I might as well try and build one which might be useful for me in the future as well.

So here's my question. I want to be able to have the ability to reuse objects(ie. not having duplicate data). Which I did with a purpose specific "factory" node in my purpose specific one. I'm currently playing around with a implementation which have:

* vector space node
* geometry node
* renderable node (these nodes holds positional data)

So, for example, if I have

RoomSpace -> ObjectGeometry -> Object1 AND Object2 (the renderables)

The problem is, if i simply want one object I would need (since the Geometry node in itself doesn't keep positional data and doesn't render):

RoomSpace -> ObjectGeometry -> Object1

While this works, it seems a bit stupid. But i'm really struggling to come up with a better alternative. So, I thought I would try and throw the question out to some experienced people (you lot! :D). How do you all implement this?

* Note, I'm using C++ , but I don't want to use virtual functions for this set of classes(im using void pointers, type identifiers and some helper classes with static member functions to emulate polymorphism). So if you could keep that in mind when/if giving me suggestions

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this