コード例 #1
0
void Renderer::cleanScene() {

    std::cout << "cleaning scene." << std::endl;
    Scene scene = config.GetScene();
    scene.DeleteLight("dummy");
    scene.DeleteObject("subject");
    for(std::vector<std::string>::const_iterator it = env_objects.begin(); it != env_objects.end(); it++){
        scene.DeleteObject(*it);
    }
    env_objects.clear();
    for(std::vector<std::string>::const_iterator it = env_lights.begin(); it != env_lights.end(); it++){
        scene.DeleteLight(*it);
    }
    env_lights.clear();
    scene.RemoveUnusedMeshes();
}
コード例 #2
0
BOOL PlatformManager::RemoveAllPlatform( )
{
__ENTER_FUNCTION

	Scene *pScene;
	Obj_Platform *pPlatform;
	UINT i,uCount,uMaxCount,uLength;

	pScene		= GetScene();
	uCount		= 0;
	uMaxCount	= GetCount();
	uLength	= GetLength();

	for ( i = 0; i <uLength; i++ )
	{
		pPlatform = (Obj_Platform*)(GetObjByIndex( 0 ));
		if ( pPlatform != NULL )
		{
			pPlatform->SetActiveFlag( FALSE );
			pPlatform->CleanUp();
			pScene->DeleteObject( pPlatform );
			uCount++;
			if (uCount >=uMaxCount )
				break;
		}
	}

	return TRUE ;

__LEAVE_FUNCTION

	return FALSE ;
}
コード例 #3
0
BOOL PetManager::RemovePet( ObjID_t idObj )
{
__ENTER_FUNCTION

	Scene* pScene = GetScene();
	if (pScene)
	{
		Obj* pPet = pScene->GetPetManager()->GetPet(idObj);
		if (pPet && pPet->GetObjType() == Obj::OBJ_TYPE_PET)
		{
			pPet->SetActiveFlag( FALSE );
			pPet->CleanUp();
			pScene->DeleteObject( pPet );
		}
	}

	return TRUE;
__LEAVE_FUNCTION
	return TRUE;
}