void VCameraHandling::DeactivateAllCameras() { // Deactivate all orbit and path cameras. const unsigned int uiNumEntities = VisBaseEntity_cl::ElementManagerGetSize(); for (unsigned int uiElementIndex = 0; uiElementIndex < uiNumEntities; uiElementIndex++) { VisBaseEntity_cl* pEntity = VisBaseEntity_cl::ElementManagerGet(uiElementIndex); if (pEntity == NULL) continue; VFreeCamera* pFreeCamera = vdynamic_cast<VFreeCamera*>(pEntity); VOrbitCamera* pOrbitCamera = pEntity->Components().GetComponentOfBaseType<VOrbitCamera>(); PathCameraEntity* pPathCamera = vdynamic_cast<PathCameraEntity*>(pEntity); if (pFreeCamera != NULL) pFreeCamera->SetThinkFunctionStatus(FALSE); if (pOrbitCamera != NULL) pOrbitCamera->SetEnabled(false); if (pPathCamera != NULL) pPathCamera->Stop(); } }
// Some sample scenes create an automatic path camera, which doesn't work with // our multi-context approach to rendering stereoscopic images, so we'll have to // find and deactivate them. void DeactivatePathCameraEntities() { for (unsigned int i=0;i<VisBaseEntity_cl::ElementManagerGetSize();i++) { VisBaseEntity_cl *pEnt = VisBaseEntity_cl::ElementManagerGet(i); if ( pEnt && pEnt->GetTypeId() == PathCameraEntity::GetClassTypeId() ) { PathCameraEntity* pPathCam = ( PathCameraEntity* ) pEnt; pPathCam->Stop(); } } }