getRootSceneNode() vs RootSceneNode


30-08-2008 16:13:12

Hi all,
I'm new here, and a total beginner at both Python and Ogre.

The tutorials on the wiki are great, and I'm quite impressed with Python-Ogre.

I was wondering:
In tutorial one sceneManager.getRootScenenode() is used, while another tutorial uses sceneManager.RootScenenode.
(and I even found sceneManager.rootScenenode to work)

Which should I preferrably use? (and why?)


30-08-2008 18:13:55

With the current version of ogre, both syntaxes refer to the same ressource but you should preferabily use sceneManager.getRootScenenode().

Some day, due to some API change, sceneManager.rootScenenode might disappear. However sceneManager.getRootScenenode() will always be implemented so that it return a SceneNode.

Generally speaking, in object-programming, you should:
  1. - whenever possible use public member functions,
    - avoid using attributes directly.[/list:u]

    Hope this helps,


30-08-2008 22:25:08

Hope this helps,

It certainly does, thanks!