why removing SceneNode is not recommended? Topic is solved

Problems building or running the engine, queries about how to use features etc.
slapin
Bronze Sponsor
Bronze Sponsor
Posts: 339
Joined: Fri May 23, 2025 5:04 pm
x 24

why removing SceneNode is not recommended?

Post 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?

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 544
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 200

Re: why removing SceneNode is not recommended?

Post 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.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2274
Joined: Sun Mar 30, 2014 2:51 pm
x 1239

Re: why removing SceneNode is not recommended?

Post by paroj »

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

slapin
Bronze Sponsor
Bronze Sponsor
Posts: 339
Joined: Fri May 23, 2025 5:04 pm
x 24

Re: why removing SceneNode is not recommended?

Post 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?