- Timestamp:
- Jul 20, 2010, 9:24:42 PM (14 years ago)
- Location:
- osgVisual
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/bin/visual_master.bat
r69 r70 1 osgVisual.exe - C center -m --window 950 50 600 350 D:/OpenSceneGraph/VPB-Testdatensatz/DB_Small/database.ive -p salzburg.path1 osgVisual.exe --SingleThreaded -C center -m --window 950 50 600 350 D:/OpenSceneGraph/VPB-Testdatensatz/DB_Small/database.ive -p salzburg.path -
osgVisual/bin/visual_slave.bat
r69 r70 1 osgVisual.exe - C center -s --server localhost 12345 --window 950 450 600 350 D:/OpenSceneGraph/VPB-Testdatensatz/DB_Small/database.ive -p salzburg.path1 osgVisual.exe --SingleThreaded -C center -s --server localhost 12345 --window 950 450 600 350 D:/OpenSceneGraph/VPB-Testdatensatz/DB_Small/database.ive -p salzburg.path -
osgVisual/include/dataIO/dataIO_transportContainer.h
r32 r70 34 34 frameID(tC_.frameID), 35 35 viewMatrix(tC_.viewMatrix), 36 projectionMatrix(tC_.projectionMatrix), 36 37 executer(tC_.executer), 37 38 ioSlots(tC_.ioSlots){} … … 48 49 int frameID; 49 50 osg::Matrixd viewMatrix; 51 osg::Matrixd projectionMatrix; 50 52 executerList executer; 51 53 slotList ioSlots; … … 58 60 void setViewMatrix(const osg::Matrixd& viewMatrix_){viewMatrix=viewMatrix_;} 59 61 const osg::Matrixd& getViewMatrix() const {return viewMatrix;} 62 63 void setProjectionMatrix(const osg::Matrixd& projectionMatrix_){projectionMatrix=projectionMatrix_;} 64 const osg::Matrixd& getProjectionMatrix() const {return projectionMatrix;} 60 65 61 66 void setExecuter(const executerList& executer_) {executer=executer_;} -
osgVisual/include/dataIO/visual_dataIO.h
r65 r70 90 90 osg::ref_ptr<dataIO_eventCallback> eventCallback; 91 91 92 93 92 class dataIO_finalDrawCallback : public osg::Camera::DrawCallback 94 93 { -
osgVisual/include/sky_Silverlining/visual_skySilverLining.h
r60 r70 97 97 98 98 /** 99 * \brief This function initializes the sky framework if it's used with the main camera (without any PRE_RENDER camera like the distortion module).100 *101 * @param sceneGraphRoot : osg::Group* which is the rootNode and coordinateSystemNode of the scene.102 */103 void init(osg::CoordinateSystemNode *sceneGraphRoot);104 105 /**106 99 * \brief This function can be called by the updateCallback. If the postInitialization for adding clouds etc. has be called already, this function will skip. 107 100 * -
osgVisual/src/cluster/dataIO_clusterENet.cpp
r69 r70 125 125 sendContainer->setFrameID(viewer->getFrameStamp()->getFrameNumber()); 126 126 sendContainer->setViewMatrix(viewer->getCamera()->getViewMatrix()); 127 sendContainer->setProjectionMatrix(viewer->getCamera()->getProjectionMatrix()); 127 128 128 129 // Writing node to stream … … 134 135 { 135 136 // Send Data via ENet: 136 OSG_NOTIFY( osg::ALWAYS ) << "dataIO_clusterUDP::sendTO_OBJvaluesToSlaves() - Bytes to send: " << myOstream.str().length() << std::endl;137 // sOSG_NOTIFY( osg::ALWAYS ) << "Send: " << myOstream.str() << std::endl;137 //OSG_NOTIFY( osg::ALWAYS ) << "dataIO_clusterUDP::sendTO_OBJvaluesToSlaves() - Bytes to send: " << myOstream.str().length() << std::endl; 138 //OSG_NOTIFY( osg::ALWAYS ) << "Send: " << myOstream.str() << std::endl; 138 139 ENetPacket * packet = enet_packet_create (myOstream.str().c_str(), 139 140 myOstream.str().size(), … … 163 164 if (bytes_received > 0 ) 164 165 { 165 OSG_NOTIFY( osg::ALWAYS ) << "dataIO_clusterENet::readTO_OBJvaluesFromMaster() - Bytes received: " << bytes_received << std::endl;166 //OSG_NOTIFY( osg::ALWAYS ) << "dataIO_clusterENet::readTO_OBJvaluesFromMaster() - Bytes received: " << bytes_received << std::endl; 166 167 //OSG_NOTIFY( osg::ALWAYS ) << "Received: " << std::endl << receivedTransportContainer << std::endl; 167 168 … … 177 178 if (sendContainer) 178 179 { 179 OSG_NOTIFY( osg::ALWAYS ) << "Received:: FrameID is: " << sendContainer->getFrameID() << std::endl;180 // Restore Viewmatrix 180 OSG_NOTIFY( osg::ALWAYS ) << "Received:: Settings Viewmatrix...FrameID is: " << sendContainer->getFrameID() << std::endl; 181 // Restore Viewmatrix / Projectionmatrix 181 182 viewer->getCamera()->setViewMatrix(sendContainer->getViewMatrix()); 183 //viewer->getCamera()->setProjectionMatrix(sendContainer->getProjectionMatrix()); 182 184 } 183 185 else -
osgVisual/src/core/visual_core.cpp
r69 r70 82 82 #else 83 83 OSG_NOTIFY( osg::ALWAYS ) << "Using Sky without distortion." << std::endl; 84 sky->init( rootNode);84 sky->init(NULL, rootNode); 85 85 #endif 86 86 #endif … … 111 111 // next frame please.... 112 112 viewer->advance(); 113 std::cout << "New frame----------------------------" << std::endl; 113 114 114 115 /*double hat, hot, lat, lon, height; … … 117 118 OSG_NOTIFY( osg::ALWAYS ) << "HOT is: " << hot << ", HAT is: " << hat << std::endl;*/ 118 119 120 // perform all queued events 121 viewer->eventTraversal(); 122 119 123 // update the scene by traversing it with the the update visitor which will 120 124 // call all node update callbacks and animations. 121 viewer->eventTraversal();125 122 126 viewer->updateTraversal(); 123 127 -
osgVisual/src/dataIO/dataIO_transportContainer.cpp
r31 r70 27 27 ADD_INT_SERIALIZER( FrameID, 0 ); 28 28 ADD_MATRIXD_SERIALIZER( ViewMatrix, osg::Matrixd() ); 29 ADD_MATRIXD_SERIALIZER( ProjectionMatrix, osg::Matrixd() ); 29 30 ADD_LIST_SERIALIZER( Executer, osgVisual::dataIO_transportContainer::executerList ); 30 31 ADD_LIST_SERIALIZER( IOSlots, osgVisual::dataIO_transportContainer::slotList ); -
osgVisual/src/dataIO/visual_dataIO.cpp
r69 r70 103 103 viewer->getCamera()->setFinalDrawCallback( finalDrawCallback ); 104 104 105 106 105 initialized = true; 107 106 } … … 113 112 OSG_NOTIFY( osg::ALWAYS ) << "Shutdown visual_dataIO..." << std::endl; 114 113 115 viewer->getCamera()->removeEventCallback( NULL);114 viewer->getCamera()->removeEventCallback( eventCallback ); 116 115 eventCallback = NULL; 117 116 viewer->getCamera()->setFinalDrawCallback( NULL ); 118 117 finalDrawCallback = NULL; 118 119 119 viewer = NULL; 120 120 121 121 122 if(cluster.valid()) -
osgVisual/src/distortion/visual_distortion.cpp
r31 r70 162 162 { 163 163 // Copy Main Camera's matrixes to the PRE_RENDER Camera. 164 std::cout << "distortion updatecallback" << std::endl; 164 165 sceneCamera->setViewMatrix( viewer->getCamera()->getViewMatrix() ); 165 166 sceneCamera->setProjectionMatrix( viewer->getCamera()->getProjectionMatrix() ); -
osgVisual/src/sky_Silverlining/visual_skySilverLining.cpp
r64 r70 41 41 void visual_skySilverLining::skyUpdateCallback::operator()(osg::Node* node, osg::NodeVisitor* nv) 42 42 { 43 std::cout << "Sky silverlining update callback" << std::endl; 43 44 // Check if atmosphere is initialized. 44 45 if (!sky->isInitialized()) … … 166 167 skyDrawable = new skySilverLining_skyDrawable(viewer, sceneRoot); 167 168 169 if(distortedRoot) // if distortion used: 170 { 171 int rootKids = distortedRoot->getNumChildren(); 172 for (int i = 0; i < rootKids; i++) 173 { 174 osg::Node *n = distortedRoot->getChild(i); 175 osg::Camera *cam = dynamic_cast<osg::Camera*>(n); 176 if (cam && cam->getRenderOrder() == osg::Camera::PRE_RENDER) 177 sceneCamera = cam; 178 } 179 } 180 else // if no distortion used: 181 sceneCamera = viewer->getCamera(); 182 168 183 osg::Camera *mainCamera = viewer->getCamera(); 169 184 if (!useProjMatrixCallback) … … 175 190 mainCamera->setProjectionMatrixAsPerspective(fovy, aspect, 2, 125000); 176 191 } 177 178 int rootKids = distortedRoot->getNumChildren();179 for (int i = 0; i < rootKids; i++)180 {181 osg::Node *n = distortedRoot->getChild(i);182 osg::Camera *cam = dynamic_cast<osg::Camera*>(n);183 if (cam)184 {185 if (cam->getRenderOrder() == osg::Camera::PRE_RENDER)186 {187 cam->setClearMask(0);188 189 osg::ref_ptr<skySilverLining_atmosphereReference> ar = new skySilverLining_atmosphereReference;190 ar->atmosphere = atmosphere;191 cam->setUserData(ar);192 mainCamera->setUserData(ar);193 sceneCamera = cam;194 195 if (useProjMatrixCallback)196 {197 skySilverLining_projectionMatrixCallback *cb = new skySilverLining_projectionMatrixCallback( atmosphere, viewer->getCamera(), sceneRoot);198 cam->setClampProjectionMatrixCallback(cb);199 cb->setSkyDrawable(skyDrawable);200 }201 }202 }203 }204 205 // Create and install updateCallback (for position etc.)206 updateCallback = new skyUpdateCallback( sceneGraphRoot, sceneCamera, this );207 this->setUpdateCallback( updateCallback );208 209 // Use a RenderBin to enforce that the sky gets drawn first, then the scene, then the clouds210 skyDrawable->getOrCreateStateSet()->setRenderBinDetails(-1, "RenderBin");211 212 // Add the models213 sceneGraphRoot->getOrCreateStateSet()->setRenderBinDetails(1, "RenderBin");214 215 // Add the clouds (note, you need this even if you don't want clouds - it calls216 // Atmosphere::EndFrame() )217 cloudsDrawable = new skySilverLining_cloudsDrawable(viewer);218 cloudsDrawable->getOrCreateStateSet()->setRenderBinDetails(99, "RenderBin");219 220 // Add drawable to this geode to get rendered221 this->addDrawable(skyDrawable);222 this->addDrawable(cloudsDrawable);223 }224 225 void visual_skySilverLining::init(osg::CoordinateSystemNode *sceneGraphRoot)226 {227 sceneRoot = sceneGraphRoot;228 229 // Use projection matrix callback oder fixed Cullsettings?230 bool useProjMatrixCallback = true;231 232 // add Sky to SceneRoot233 sceneGraphRoot->addChild( this );234 235 // Deactivate culling for the sky node (required by the silverlining sky framework)236 this->setCullingActive(false);237 238 // Instantiate an Atmosphere and associate it with this camera. If you have multiple cameras239 // in multiple contexts, be sure to instantiate seperate Atmosphere objects for each.240 // ***IMPORTANT!**** Check that the path to the resources folder for SilverLining in SkyDrawable.cpp241 // SkyDrawable::initializeSilverLining matches with where you installed SilverLining.242 atmosphere = new SilverLining::Atmosphere(SILVERLINING_LICENSEE, SILVERLINING_LICENSE);243 244 // Add the sky (calls Atmosphere::BeginFrame and handles initialization once you're in245 // the rendering thread)246 skyDrawable = new skySilverLining_skyDrawable(viewer, sceneRoot);247 248 if (!useProjMatrixCallback)249 {250 viewer->getCamera()->setClearMask(0);251 viewer->getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);252 double fovy, aspect, zNear, zFar;253 viewer->getCamera()->getProjectionMatrixAsPerspective(fovy, aspect, zNear, zFar);254 viewer->getCamera()->setProjectionMatrixAsPerspective(fovy, aspect, 2, 125000);255 }256 192 else 257 193 { 258 194 cb = new skySilverLining_projectionMatrixCallback( atmosphere, viewer->getCamera(), sceneRoot); 259 viewer->getCamera()->setClampProjectionMatrixCallback(cb);195 sceneCamera->setClampProjectionMatrixCallback(cb); 260 196 cb->setSkyDrawable(skyDrawable); 261 197 } 262 198 263 264 viewer->getCamera()->setClearMask(0); 265 266 osg::ref_ptr<skySilverLining_atmosphereReference> ar = new skySilverLining_atmosphereReference; 199 // append atmosphere pointer to the cameras. 200 sceneCamera->setClearMask(0); 201 osg::ref_ptr<skySilverLining_atmosphereReference> ar = new skySilverLining_atmosphereReference; 267 202 ar->atmosphere = atmosphere; 268 viewer->getCamera()->setUserData(ar); 269 sceneCamera = viewer->getCamera(); 270 271 203 sceneCamera->setUserData(ar); 204 mainCamera->setUserData(ar); 205 272 206 // Create and install updateCallback (for position etc.) 273 207 updateCallback = new skyUpdateCallback( sceneGraphRoot, sceneCamera, this );
Note: See TracChangeset
for help on using the changeset viewer.