I know PCZSM has it's own forum, but since it's still part of the official repository, and since this is clearly a papercut, I decided to post here.
PCZSM implements SceneManager's destroySceneNode(const String& name), but not the direct destroySceneNode(SceneNode* sn).
This is quite annoying, since when you manage your nodes by pointer, you'll have to do pScene->destroySceneNode(pNode->getName()) when you want to destroy one.
And here is the bugtracker entry.
PCZSceneManager is missing destroySceneNode() by pointer
-
- Halfling
- Posts: 75
- Joined: Wed Apr 20, 2011 9:55 pm
- Location: Helsinki, Finland
- x 3
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: PCZSceneManager is missing destroySceneNode() by pointer
Are you building from source? Try making these changes.
In OgrePCZSceneManager.cpp:
In OgrePCZSceneManager.h:
In OgrePCZSceneManager.cpp:
Code: Select all
// Destroy a Scene Node by name.
void PCZSceneManager::destroySceneNode( const String &name )
{
SceneNode * on = ( getSceneNode( name ) );
if ( on != 0 )
{
// destroy the node
destroySceneNode( on );
}
}
// Destroy a scene node
void PCZSceneManager::destroySceneNode(SceneNode* sn)
{
if ( sn != 0 )
{
// remove references to the node from zones
removeSceneNode( sn );
}
// destroy the node
SceneManager::destroySceneNode( sn );
}
Code: Select all
/** Deletes a scene node & corresponding PCZSceneNode */
virtual void destroySceneNode(SceneNode* sn);
-
- Halfling
- Posts: 75
- Joined: Wed Apr 20, 2011 9:55 pm
- Location: Helsinki, Finland
- x 3
Re: PCZSceneManager is missing destroySceneNode() by pointer
Yes, I have actually written the method myself locally, and was thinking of rolling up a patch for the bugtracker entry.masterfalcon wrote:Are you building from source? Try making these changes.
Isn't the null-pointer check pretty pointless, though? I mean in the removeSceneNode part.
-
- Halfling
- Posts: 75
- Joined: Wed Apr 20, 2011 9:55 pm
- Location: Helsinki, Finland
- x 3
Re: PCZSceneManager is missing destroySceneNode() by pointer
So this is fixed now in the 1.8 branch (except for that 0-pointer check). Do changes from the v1-8 branch get periodically merged to the trunk, or how does that work?
-
- OGRE Retired Team Member
- Posts: 4270
- Joined: Sun Feb 25, 2007 4:56 am
- Location: Bloomington, MN
- x 126
Re: PCZSceneManager is missing destroySceneNode() by pointer
I left the null pointer check in there because it is important. But yes, on occasion changes are merged back from 1.8 into trunk.