Example #1
0
Dragon::~Dragon()
{
	//We only remove OGRE objects that were created in the Dragon class.
	//The CollidableObject base class will take care of the rest
	Ogre::SceneManager* mSceneManager = Ogre::Root::getSingletonPtr()->getSceneManager("ApplicationSceneManager");
	mSceneManager->destroyEntity(mEntity->getName());
	mSceneManager->destroyParticleSystem(mParticleSystem->getName());
	mSceneNode->removeAndDestroyChild(mParticleNode->getName());
}
void gkOgreParticleObject::destroyInstanceImpl()
{
	if (m_psys)
	{
		Ogre::SceneManager* manager = m_scene->getManager();

		if (!m_scene->isBeingDestroyed())
		{
			if (m_node)
				m_node->detachObject(m_psys);

			manager->destroyParticleSystem(m_psys);
			m_psys = 0;
		}
	}

	gkParticleObject::destroyInstanceImpl();
}