Ignore:
Timestamp:
Jul 20, 2010, 10:44:13 AM (14 years ago)
Author:
Torben Dannhauer
Message:

Network sync:
now works:

  • serialization of transport container
  • transport via ENet UDP
  • de-serialization of the transport container.
  • transport of viewmatrix and framenumber to the slave.

ToDo?: apply viewmatrix on slave still do not work.

Location:
osgVisual/include/cluster
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/include/cluster/dataIO_cluster.h

    r67 r69  
    1616*/
    1717
    18 #include "osg/referenced"
     18#include <osg/referenced>
     19#include <osgViewer/Viewer>
    1920
    2021#include "dataIO_slot.h"
     
    5960         *
    6061         */
    61         virtual void init( osg::ArgumentParser& arguments_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ ) = 0;
     62        virtual void init( osg::ArgumentParser& arguments_, osgViewer::Viewer* viewer_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ ) = 0;
    6263
     64        void enableHardSync(bool hardSync_){hardSync=hardSync_;};
     65       
     66        bool isHardSyncEnabled(){return hardSync;};
    6367
    6468        virtual void shutdown() = 0;
     
    117121
    118122protected:
    119         osgVisual::dataIO_cluster::clustermode clusterMode;     // This variable only mirrors the variable of dataIO. willbe set during initialize.
     123        osgVisual::dataIO_cluster::clustermode clusterMode;     // This variable only mirrors the variable of dataIO. will be set during initialize.
    120124        bool initialized;
    121125        int port;
     126        bool hardSync;
    122127
    123         osg::ref_ptr<osgVisual::dataIO_transportContainer> sendContainer;
     128        /**
     129         * Referenced Pointer to the applications viewer.
     130         */
     131        osg::ref_ptr<osgViewer::Viewer> viewer;
     132
     133        osg::ref_ptr<osgVisual::dataIO_transportContainer> sendContainer;       // Points to the send container of dataIO.
     134        std::string receivedTransportContainer;
    124135};
    125136
  • osgVisual/include/cluster/dataIO_clusterENet.h

    r67 r69  
    1818#include <osg/notify>
    1919#include <osg/ArgumentParser>
     20#include <osgDB/Registry>
     21#include <osgDB/ReaderWriter>
     22#include <iostream>
    2023
    2124#include <dataIO_cluster.h>
     
    3942        virtual ~dataIO_clusterENet(void);
    4043
    41         void init( osg::ArgumentParser& arguments_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ );
     44        void init( osg::ArgumentParser& arguments_, osgViewer::Viewer* viewer_, clustermode clusterMode_, osgVisual::dataIO_transportContainer* sendContainer_, bool compressionEnabled_, bool asAscii_ );
    4245        void shutdown();
    4346
     
    5457        std::string serverToConnect;
    5558        osgVisual::dataIO_cluster::clustermode clusterMode;
     59        std::string receivedTransportContainer;
     60
     61        osg::ref_ptr<osgDB::Options> readOptions;
     62        osg::ref_ptr<osgDB::Options> writeOptions;
     63        osg::ref_ptr<osgDB::ReaderWriter> rw;
    5664};
    5765
  • osgVisual/include/cluster/dataIO_clusterENet_implementation.h

    r68 r69  
    2929{
    3030public:
    31         dataIO_clusterENet_implementation();
     31        dataIO_clusterENet_implementation(std::string& receivedTransportContainer_);
    3232        ~dataIO_clusterENet_implementation();
    3333
     
    5454        std::vector<ENetPeer*> peerList;        // client: only one peer to server,    Server: multiple peers for all clients
    5555        ENetEvent event;
     56        std::string& receivedTransportContainer;
    5657};
    5758
Note: See TracChangeset for help on using the changeset viewer.