void BasePlayerImplementation::setNextCameraMode() { if ( _cameraMode == Spheric ) setCameraMode( Ego ); else setCameraMode( Spheric ); }
void CameraManager::switchCameraMode(){ if(mCameraMode == SIMPLE) setCameraMode(SIMPLE); else if(mCameraMode == OCULUS) setCameraMode(OCULUS); }
void ObjectRenderer::toggleCameraMode() { int mode = int(getCameraMode()); mode++; if(mode > VisualizationParameterSet::PRESENTATION) mode = VisualizationParameterSet::TARGETCAM; setCameraMode(VisualizationParameterSet::CameraMode(mode)); }
Gource::Gource(std::string logfile) { this->logfile = logfile; commitlog = 0; fontlarge = fontmanager.grab("FreeSans.ttf", 42); fontlarge.dropShadow(true); fontlarge.roundCoordinates(true); fontmedium = fontmanager.grab("FreeSans.ttf", 16); fontmedium.dropShadow(true); fontmedium.roundCoordinates(false); font = fontmanager.grab("FreeSans.ttf", 14); font.dropShadow(true); font.roundCoordinates(true); start_position = 0.0; paused = false; first_read = true; draw_loading = true; mousemoved = false; mouseclicked = false; splash = -1.0; debug = false; trace_debug = false; dirNodeTree = 0; userTree = 0; selectedFile = 0; hoverFile = 0; selectedUser = 0; hoverUser = 0; date_x_offset = 0; camera = ZoomCamera(vec3f(0,0, -300), vec3f(0.0, 0.0, 0.0), 250.0, 5000.0); setCameraMode(false); root = 0; background_colour = vec3f(0.25, 0.25, 0.25); findUserImages(); reset(); }
void Pipeline::captureImage() { if(currentMode == MODE_VIDEO) setCameraMode(); currentFile = nextFileName(); emit savedFileNameChanged(currentFile); // set next file name g_object_set(camerabin, "filename", currentFile.toUtf8().constData(), NULL); // write image metadata writeMetadata(); g_signal_emit_by_name(camerabin, "capture-start", 0); }
void SimObjectRenderer::toggleCameraMode() { setCameraMode(cameraMode == SimRobotCore2::Renderer::targetCam ? SimRobotCore2::Renderer::freeCam : SimRobotCore2::Renderer::targetCam); }
void Gource::toggleCameraMode() { setCameraMode(!track_users); }
Gource::Gource(std::string logfile) { this->logfile = logfile; commitlog = 0; fontlarge = fontmanager.grab("FreeSans.ttf", 42); fontlarge.dropShadow(true); fontlarge.roundCoordinates(true); fontmedium = fontmanager.grab("FreeSans.ttf", 16); fontmedium.dropShadow(true); fontmedium.roundCoordinates(false); font = fontmanager.grab("FreeSans.ttf", 14); font.dropShadow(true); font.roundCoordinates(true); bloomtex = texturemanager.grab("bloom.tga"); beamtex = texturemanager.grab("beam.png"); start_position = 0.0; stop_position = 0.0; stop_on_idle=false; stop_position_reached=false; stop_at_end=false; paused = false; first_read = true; draw_loading = true; mousemoved = false; mouseclicked = false; splash = -1.0; debug = false; trace_debug = false; frameExporter = 0; dirNodeTree = 0; userTree = 0; selectedFile = 0; hoverFile = 0; selectedUser = 0; hoverUser = 0; date_x_offset = 0; camera = ZoomCamera(vec3f(0,0, -300), vec3f(0.0, 0.0, 0.0), 250.0, 5000.0); setCameraMode(false); root = 0; background_colour = vec3f(0.0, 0.0, 0.0); //min phsyics rate 60fps (ie maximum allowed delta 1.0/60) max_tick_rate = 1.0 / 60.0; runtime = 0.0f; frameskip = 0; framecount = 0; findUserImages(); reset(); }
void PlayerImplClient::postInitialize() { log_info << " setup player implementation Client ..." << std::endl; // local client specific setup if ( !_isRemoteClient ) { // set us as local player entity in player utility; other entities may need us vrc::gameutils::PlayerUtils::get()->setLocalPlayer( getPlayerEntity() ); // attach camera entity { log_debug << " - searching for camera entity '" << PLAYER_CAMERA_ENTITIY_NAME << "'..." << std::endl; // get camera entity _p_camera = dynamic_cast< EnCamera* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_CAMERA, PLAYER_CAMERA_ENTITIY_NAME ) ); assert( _p_camera && "could not find the camera entity!" ); log_debug << " - camera entity successfully attached" << std::endl; } // attach physics entity { log_debug << " - searching for physics entity '" << _playerAttributes._physicsEntity << "' ..." << std::endl; // find and attach physics component _p_playerPhysics = dynamic_cast< EnPlayerPhysics* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLPHYS, _playerAttributes._physicsEntity ) ); assert( _p_playerPhysics && "given instance name does not belong to a EnPlayerPhysics entity type, or entity is missing!" ); _p_playerPhysics->setPlayer( this ); log_debug << " - physics entity successfully attached" << std::endl; } // attach sound entity { log_debug << " - searching for sound entity '" << _playerAttributes._soundEntity << "' ..." << std::endl; // find and attach sound component, tollerate missing sound for now _p_playerSound = dynamic_cast< EnPlayerSound* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLSOUND, _playerAttributes._soundEntity ) ); if ( !_p_playerSound ) log_error << " *** could not find sound entity '" << _playerAttributes._soundEntity << "' of type PlayerSound. player sound deactivated" << std::endl; else { _p_playerSound->setPlayer( this ); log_debug << " - sound entity successfully attached" << std::endl; } } // attach animation entity { log_debug << " - searching for animation entity '" << _playerAttributes._animationEntity << "' ..." << std::endl; // find and attach animation component _p_playerAnimation = dynamic_cast< EnPlayerAnimation* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLANIM, _playerAttributes._animationEntity ) ); assert( _p_playerAnimation && "given instance name does not belong to a EnPlayerAnimation entity type, or entity is missing!" ); _p_playerAnimation->setPlayer( this ); } log_debug << " - animation entity successfully attached" << std::endl; if ( _cameraMode == Ego ) // in ego mode we won't render our character { _p_playerAnimation->enableRendering( false ); } else // if in spheric mode disable the mouse pointer { gameutils::GuiUtils::get()->showMousePointer( false ); } // create the chat manager if ( !createChatManager() ) { log_error << " - could not create chat system" << std::endl; } // create a new input handler for this player _p_inputHandler = new PlayerIHCharacterCameraCtrl< PlayerImplClient >( this, _p_player ); _p_inputHandler->setMenuEnabled( false ); // setup camera mode setCameraMode( _cameraMode ); } else // setup remote client ( note, the remote instance names have a postfix ) { // set us as remote player entity in player utility vrc::gameutils::PlayerUtils::get()->addRemotePlayer( getPlayerEntity() ); // attach physics entity { log_debug << " - searching for physics entity '" << _playerAttributes._physicsEntity + _loadingPostFix << "' ..." << std::endl; // find and attach physics component _p_playerPhysics = dynamic_cast< EnPlayerPhysics* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLPHYS, _playerAttributes._physicsEntity + _loadingPostFix ) ); assert( _p_playerPhysics && "given instance name does not belong to a EnPlayerPhysics entity type, or entity is missing!" ); _p_playerPhysics->setPlayer( this ); log_debug << " - physics entity successfully attached" << std::endl; } // attach sound entity { log_debug << " - searching for sound entity '" << _playerAttributes._soundEntity + _loadingPostFix << "' ..." << std::endl; // find and attach sound component, tollerate missing sound for now _p_playerSound = dynamic_cast< EnPlayerSound* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLSOUND, _playerAttributes._soundEntity + _loadingPostFix ) ); if ( !_p_playerSound ) log_error << " *** could not find sound entity '" << _playerAttributes._soundEntity + _loadingPostFix << "' of type PlayerSound. player sound deactivated" << std::endl; else { _p_playerSound->setPlayer( this ); log_debug << " - sound entity successfully attached" << std::endl; } } // attach animation entity { log_debug << " - searching for animation entity '" << _playerAttributes._animationEntity + _loadingPostFix << "' ..." << std::endl; // find and attach animation component _p_playerAnimation = dynamic_cast< EnPlayerAnimation* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLANIM, _playerAttributes._animationEntity + _loadingPostFix ) ); assert( _p_playerAnimation && "given instance name does not belong to a EnPlayerAnimation entity type, or entity is missing!" ); _p_playerAnimation->setPlayer( this ); // enable rendering for remote clients _p_playerAnimation->enableRendering( true ); _p_playerAnimation->setAnimation( EnPlayerAnimation::eIdle ); log_debug << " - animation entity successfully attached" << std::endl; } } log_info << " player implementation successfully initialized" << std::endl; }
void OpenGLSceneViewCore::mouseDown(NSPoint point, bool alt) { _lastPoint = point; _isPainting = false; if (alt) { _isManipulating = _isSelecting = false; return; } if (_highlightCameraMode) { switch (_cameraMode) { case CameraMode::Top: setCameraMode(CameraMode::Bottom); break; case CameraMode::Bottom: setCameraMode(CameraMode::Top); break; case CameraMode::Left: setCameraMode(CameraMode::Right); break; case CameraMode::Right: setCameraMode(CameraMode::Left); break; case CameraMode::Front: setCameraMode(CameraMode::Back); break; case CameraMode::Back: setCameraMode(CameraMode::Front); break; default: break; } } else if (_delegate->texturePaintEnabled()) { _isPainting = true; //[self paintOnTextureWithFirstPoint:lastPoint secondPoint:lastPoint]; return; } else if (_delegate->vertexToolEnabled()) { Vector3D position = addVertexPositionFromPoint(point); _delegate->vertexAddOrConnect(position, _camera); } else if (_manipulated != NULL && _manipulated->selectedCount() > 0 && _currentManipulator->selectedIndex < UINT_MAX) { if (_currentManipulator == _translationManipulator) { _selectionOffset = translationFromPoint(_lastPoint); _selectionOffset -= _manipulated->selectionCenter(); _isManipulating = true; } else if (_currentManipulator == _rotationManipulator) { rotationFromPoint(_lastPoint, _selectionOffset); _isManipulating = true; } else if (_currentManipulator == _scaleManipulator) { scaleFromPoint(_lastPoint, _selectionOffset); _isManipulating = true; } if (_isManipulating) _delegate->manipulationStarted(); } else { _isSelecting = true; } }
void Gource::setCameraMode(const std::string& mode) { setCameraMode(mode == "track"); }
Gource::Gource(FrameExporter* exporter) { this->logfile = gGourceSettings.path; commitlog = 0; fontlarge = fontmanager.grab("FreeSans.ttf", 42); fontlarge.dropShadow(true); fontlarge.roundCoordinates(true); fontmedium = fontmanager.grab("FreeSans.ttf", gGourceSettings.font_size); fontmedium.dropShadow(true); fontmedium.roundCoordinates(false); font = fontmanager.grab("FreeSans.ttf", 14); font.dropShadow(true); font.roundCoordinates(true); //only use bloom with alpha channel if transparent due to artifacts on some video cards std::string bloom_tga = gGourceSettings.transparent ? "bloom_alpha.tga" : "bloom.tga"; bloomtex = texturemanager.grab(bloom_tga); beamtex = texturemanager.grab("beam.png"); logotex = 0; backgroundtex = 0; //load logo if(gGourceSettings.logo.size() > 0) { logotex = texturemanager.grabFile(gGourceSettings.logo); } //load background image if(gGourceSettings.background_image.size() > 0) { backgroundtex = texturemanager.grabFile(gGourceSettings.background_image); } stop_position_reached=false; paused = false; first_read = true; draw_loading = true; grab_mouse = false; mousemoved = false; mousedragged = false; mouseclicked = false; if(1) { cursor.setCursorTexture(texturemanager.grab("cursor.png")); cursor.useSystemCursor(false); } if(gGourceSettings.hide_mouse) { cursor.showCursor(false); } splash = -1.0; debug = false; trace_debug = false; frameExporter = 0; dirNodeTree = 0; userTree = 0; selectedFile = 0; hoverFile = 0; selectedUser = 0; hoverUser = 0; date_x_offset = 0; camera = ZoomCamera(vec3f(0,0, -300), vec3f(0.0, 0.0, 0.0), 250.0, 5000.0); setCameraMode(gGourceSettings.camera_mode); root = 0; //min phsyics rate 60fps (ie maximum allowed delta 1.0/60) max_tick_rate = 1.0 / 60.0; runtime = 0.0f; frameskip = 0; framecount = 0; reset(); if(exporter!=0) setFrameExporter(exporter, gGourceSettings.output_framerate); //if recording a video or in demo mode, or multiple repos, the slider is initially hidden if(exporter==0 && gGourceSettings.repo_count==1) slider.show(); }
void PlayerImplStandalone::postInitialize() { log_info << " setup player implementation Standalone ..." << std::endl; // attach camera entity log_debug << " - searching for camera entity '" << PLAYER_CAMERA_ENTITIY_NAME << "'..." << std::endl; // get camera entity _p_camera = dynamic_cast< EnCamera* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_CAMERA, PLAYER_CAMERA_ENTITIY_NAME ) ); if ( _p_camera ) { log_debug << " - camera entity successfully attached" << std::endl; } else { log_error << " could not attach player camera entity" << std::endl; } // attach physics entity log_debug << " - searching for physics entity '" << _playerAttributes._physicsEntity << "' ..." << std::endl; // find and attach physics component _p_playerPhysics = dynamic_cast< EnPlayerPhysics* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLPHYS, _playerAttributes._physicsEntity ) ); if ( _p_playerPhysics ) { _p_playerPhysics->setPlayer( this ); _p_playerPhysics->initializePhysics( _currentPos, _currentRot ); log_debug << " - physics entity successfully attached" << std::endl; } else { log_error << " could not attach player physics entity" << std::endl; } // attach animation entity log_debug << " - searching for animation entity '" << _playerAttributes._animationEntity << "' ..." << std::endl; // find and attach animation component _p_playerAnimation = dynamic_cast< EnPlayerAnimation* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLANIM, _playerAttributes._animationEntity ) ); if ( _p_playerAnimation ) { _p_playerAnimation->setPlayer( this ); log_debug << " - animation entity successfully attached" << std::endl; if ( _cameraMode == Ego ) // in ego mode we won't render our character { removeFromSceneGraph(); } else // if in spheric mode disable the mouse pointer { gameutils::GuiUtils::get()->showMousePointer( false ); } } else { log_error << " could not attach player animation entity" << std::endl; } // attach sound entity log_debug << " - searching for sound entity '" << _playerAttributes._soundEntity << "' ..." << std::endl; // find and attach sound component, tollerate missing sound for now _p_playerSound = dynamic_cast< EnPlayerSound* >( yaf3d::EntityManager::get()->findEntity( ENTITY_NAME_PLSOUND, _playerAttributes._soundEntity ) ); if ( !_p_playerSound ) log_error << " could not find sound entity '" << _playerAttributes._soundEntity << "' of type PlayerSound. player sound deactivated" << std::endl; else { _p_playerSound->setPlayer( this ); log_debug << " - sound entity successfully attached" << std::endl; } // setup camera mode setCameraMode( _cameraMode ); // create the chat manager if ( !createChatManager() ) { log_error << " - could not create chat system" << std::endl; } log_info << " player implementation successfully initialized" << std::endl; // create only the input handler when animation and physics are attached if ( _p_playerAnimation && _p_playerPhysics ) { // create a new input handler for this player _p_inputHandler = new PlayerIHCharacterCameraCtrl< PlayerImplStandalone >( this, getPlayerEntity() ); _p_inputHandler->setMenuEnabled( false ); // get configuration settings getConfiguration(); } // set initial camera transformation if ( _p_camera ) _p_camera->setCameraTransformation( getPlayerPosition(), getPlayerRotation() ); }
int Scenegraph::setCameraMode(int mode) { return setCameraMode(currentcamera, mode); }