void ArmyDemoApp::setup() { mSender.bind(); #if ! USE_UDP mSender.connect(); #endif model::Skeleton::sRenderMode = model::Skeleton::RenderMode::CLEANED; mLightPos = vec3(10.0f, 20.0f, 20.0f); mMouseHorizontalPos = 0; mMeshIndex = 0; mParams = params::InterfaceGl( "Parameters", ivec2( 200, 250 ) ); mParams.addParam( "Fps", &mFps, "", true ); mParams.addSeparator(); mDrawMesh = true; mParams.addParam( "Draw Mesh", &mDrawMesh ); mDrawSkeleton = false; mParams.addParam( "Draw Skeleton", &mDrawSkeleton ); mDrawAbsolute = true; mParams.addParam( "Relative/Abolute skeleton", &mDrawAbsolute ); mEnableWireframe = false; mParams.addParam( "Wireframe", &mEnableWireframe ); gl::enableDepthWrite(); gl::enableDepthRead(); gl::enableAlphaBlending(); mSkeletalMesh = model::SkeletalMesh::create( model::AssimpLoader( loadAsset( "maggot3.md5mesh" ) ) ); }
void SimpleMultiThreadedSenderApp::setup() { mSender.bind(); #if ! USE_UDP mSender.connect(); #endif mThread = std::thread( std::bind( []( std::shared_ptr<asio::io_service> &service ){ service->run(); }, mIoService )); }
void SimpleMultiThreadedSenderApp::mouseUp( MouseEvent event ) { osc::Message msg( "/mouseclick/1" ); msg.append( (float)event.getPos().x / getWindowWidth() ); msg.append( (float)event.getPos().y / getWindowHeight() ); mSender.send( msg ); }
void SimpleMultiThreadedSenderApp::mouseMove( cinder::app::MouseEvent event ) { mCurrentMousePositon = event.getPos(); osc::Message msg( "/mousemove/1" ); msg.append( mCurrentMousePositon.x ); msg.append( mCurrentMousePositon.y ); mSender.send( msg ); }
void ArmyDemoApp::mouseDown( MouseEvent event ) { mCamUi.mouseDown( event.getPos() ); osc::Message msg( "/mouseclick/1" ); msg.append( (float)event.getPos().x / getWindowWidth() ); msg.append( (float)event.getPos().y / getWindowHeight() ); mSender.send( msg ); }
void ArmyDemoApp::mouseMove( MouseEvent event ) { mMouseHorizontalPos = float( event.getX() ); mCurrentMousePositon = event.getPos(); osc::Message msg( "/mousemove/1" ); msg.append( mCurrentMousePositon.x ); msg.append( mCurrentMousePositon.y ); mSender.send( msg ); }