Page 1 of 1

why removing SceneNode is not recommended?

Posted: Wed Dec 10, 2025 6:39 pm
by slapin

hi, all!
why removing SceneNode is not recommended?

Code: Select all

       /** Destroys a SceneNode.

        This allows you to physically delete an individual SceneNode if you want to.
        Note that this is not normally recommended, it's better to allow SceneManager
        to delete the nodes when the scene is cleared.
    */
    virtual void destroySceneNode(SceneNode* sn);

What I have to do instead to remove node and attached stuff?


Re: why removing SceneNode is not recommended?

Posted: Thu Dec 11, 2025 1:45 pm
by sercero

I think that normally you should detach it from the parent so that it is no longer visible.

I don't know why it is not recommended to delete them.


Re: why removing SceneNode is not recommended?

Posted: Thu Dec 11, 2025 2:16 pm
by paroj

the note should rather be "it is not necessary to call this method when destroying a scene."


Re: why removing SceneNode is not recommended?

Posted: Thu Dec 11, 2025 2:38 pm
by slapin

Additionally - what is currently most correct way to delete scene node - via SceneManager or via sceneNode parent?
I did later way but found the way via getCreator() and wonder should I rewrite my code or not?