FCreatureAnimStoreEditorViewportClient::FCreatureAnimStoreEditorViewportClient(const TWeakPtr<class SEditorViewport>& InEditorViewportWidget /*= nullptr*/, UCreatureAnimationClipsStore* EditingAnimStore) :FEditorViewportClient(nullptr, &OwnerScene, InEditorViewportWidget) , EditingStore(EditingAnimStore) { PreviewScene = &OwnerScene; ((FAssetEditorModeManager*)ModeTools)->SetPreviewScene(PreviewScene); DrawHelper.bDrawGrid = true; DrawHelper.bDrawPivot = true; /*SetViewLocation(FVector(0, 30, 0)); SetLookAtLocation(FVector(0, -30, 0));*/ SetRealtime(true); //向PreviewScene添加Component EditingCreatureMesh = NewObject<UCreatureMeshComponent>(); //设置CreatureMesh组件 SetUpEditingCreatureMesh(); PreviewScene->AddComponent(EditingCreatureMesh, FTransform::Identity); EditingCreatureMesh->SetRelativeRotation(FRotator(0, 90, 0)); //设置Camera SetUpCamera(); if (EditingStore->ClipList.Num()!=0) { //默认播放第一个Clip EditingCreatureMesh->SetBluePrintActiveCollectionClip_Name(EditingStore->ClipList[0].ClipName); } }
int main(int argc, const char **argv) { sem_init(&FrameReady, 0, 0); Params myparams; myparams.width=320; myparams.height=180; myparams.quality=85; myparams.wantRaw=0; myparams.timeout=50; SetUpCamera(myparams); pthread_create( &threadFrame, NULL, &WaitFrame, NULL); while(SetFrame()) { // OPENCV CODE. THE IPLIMAGE POINTER TO USE IS "UsableFrame" } }
Renderer::Renderer(LPDIRECT3DDEVICE9 device) { device_ = device; std::cout << "\nTexture manager initialization: "; texture_manager_ = std::make_unique<TextureManager>(); std::cout << "success!"; SetUpCamera(); }
bool CheckersApplication::StartUp() { FlyCamera* pCamera = new FlyCamera(); SetUpCamera(pCamera); m_board = new CheckersBoard(); m_AI = new AI(m_board, 5, 25); m_currentPlayer = PLAYER_ONE; m_currentOpponent = PLAYER_TWO; //m_game = new Game(); tileSelected = false; mandatoryMove = false; return true; }
void FCreatureAnimStoreEditorViewportClient::ReConstructMesh() { if (EditingCreatureMesh!=nullptr) { EditingCreatureMesh->DestroyComponent(true); EditingCreatureMesh = NewObject<UCreatureMeshComponent>(); //设置CreatureMesh组件 SetUpEditingCreatureMesh(); PreviewScene->AddComponent(EditingCreatureMesh, FTransform::Identity); EditingCreatureMesh->SetRelativeRotation(FRotator(0, 90, 0)); //设置Camera SetUpCamera(); if (EditingStore->ClipList.Num() != 0) { //默认播放第一个Clip EditingCreatureMesh->SetBluePrintActiveCollectionClip_Name(EditingStore->ClipList[0].ClipName); } } }
bool CViacamController::Initialize () { bool retval= true; assert (!m_pMainWindow && !m_pCamera && !m_pCaptureThread); SetUpLanguage (); // Create camera object m_pCamera= SetUpCamera(); if (m_pCamera== NULL) retval= false; if (retval) { // TODO: check this!!! assert (!m_pMotionCalibration); m_pMotionCalibration= new CMotionCalibration(); //this); #if defined(__WXGTK__) assert (!m_pAutostart); m_pAutostart = new CAutostart(wxT("eviacam.desktop")); #endif } // Create main window if (retval) { m_pMainWindow = new WViacam( NULL, ID_WVIACAM ); assert (m_pMainWindow); m_pMainWindow->Show (true); } // Create hotkey manager if (retval) { assert (!m_hotKeyManager); m_hotKeyManager= new CHotkeyManager(); } // Create pointer action object if (retval) { assert (!m_pointerAction); m_pointerAction= new CPointerAction(); } // Create and start worker thread if (retval) { m_pCaptureThread = new CCaptureThread (m_pCamera, m_pMainWindow->GetCamWindow(), this, wxTHREAD_JOINABLE ); assert (m_pCaptureThread); if (m_pCaptureThread->Create()!= wxTHREAD_NO_ERROR) retval= false; if (retval) { // Fire thread m_pCaptureThread->SetPriority (WXTHREAD_MAX_PRIORITY); if (m_pCaptureThread->Run() != wxTHREAD_NO_ERROR) retval= false; } } // Register track area if (retval) m_pMainWindow->GetCamWindow()->RegisterControl (m_visionPipeline.GetTrackAreaControl()); // Load configuration if (retval) m_configManager->ReadAll (true); // Enable pointeraction object if (retval) m_pointerAction->SetEnabled(true); // Run the wizard at startup if (retval && m_runWizardAtStartup) StartWizard(); return retval; }