Why not expose the scenemanager in Node
Why not expose the scenemanager in Node
I noticed that Node has a private variable for the scenemanager but does not have a getSceneNode method - why is that? - it would be fantastic if i did not have to store the scenemanager with every instance of Node that i make in my game - if i can just say node->getSceneManager(); !!
possibly (i didnt realize it was only protected) - but i still see some cases in my app where i have a handle to node and want to walk the scenemanager tree to find other objects nearby - so it still would be good to expose the scenemanager - since the primary purpose of nodes is to hang on the scenemanager tree it would be nice for apps to be able to climb that tree starting at any node - so i would still ask that it be exposed through a get function while remaining a private variable (i dont think apps should be able to set it - unless there is a plan to allow multiple scenemanagers in the future
Also, getParent() will climb up the tree.
You would probably benefit from making your IrrlichtDevice a global object in your project. It's important enough to want access to it from anywhere. Keless's ICE project sounds like it does something like this for you (I haven't checked it out myself yet). OO conventions are great and all, but don't really ideally fit every programming situation.
You would probably benefit from making your IrrlichtDevice a global object in your project. It's important enough to want access to it from anywhere. Keless's ICE project sounds like it does something like this for you (I haven't checked it out myself yet). OO conventions are great and all, but don't really ideally fit every programming situation.
technically the IrrLicht device is hidden as a member variable of the very base class game_StateHandler, however it is passed down to practically every graphics-related class thereafter, so it may as well be global.
"OO conventions are great and all, but don't really ideally fit every programming situation"
thats true. for instance, my ICE framework has a great state-based core. This works very well for most applications, but if you've got a super-intense engine with a virtual machine sort of concept-- where you actually have a kernal processing 'tasks' (such as Richard Fine's "Enginuity"), ICE wont be the best approach. No one here is doing that sort of thing yet though, as far as I know
"OO conventions are great and all, but don't really ideally fit every programming situation"
thats true. for instance, my ICE framework has a great state-based core. This works very well for most applications, but if you've got a super-intense engine with a virtual machine sort of concept-- where you actually have a kernal processing 'tasks' (such as Richard Fine's "Enginuity"), ICE wont be the best approach. No one here is doing that sort of thing yet though, as far as I know
a screen cap is worth 0x100000 DWORDS
ah, those calls are good for climbing the node tree
i just hate passing around scenemanager as a global AND currently i store a pointer to scenemanager in every object i create - this also seems like a waster because it is already embedded in each node - why not have a get function for something so important?
i use it for instance when i want to tell an object to clone itself - so i need to know the scenemanager and get another copy of the mesh, etc.
it just seems like the scenemanager does a lot of the heavy lifting around nodes and i am trying to limit how much of my code is exposed to irrlicht dependencies - so i dont want a scenemanager global - nor do i want a state object that every object also has to know about to get a handle to the scenemanager - by exposing the scenemanager with a get function i can bury the object manipulation down in my lowest class and never look at it again!
i just hate passing around scenemanager as a global AND currently i store a pointer to scenemanager in every object i create - this also seems like a waster because it is already embedded in each node - why not have a get function for something so important?
i use it for instance when i want to tell an object to clone itself - so i need to know the scenemanager and get another copy of the mesh, etc.
it just seems like the scenemanager does a lot of the heavy lifting around nodes and i am trying to limit how much of my code is exposed to irrlicht dependencies - so i dont want a scenemanager global - nor do i want a state object that every object also has to know about to get a handle to the scenemanager - by exposing the scenemanager with a get function i can bury the object manipulation down in my lowest class and never look at it again!