Пример #1
0
void ColladaViewerModule::Initialize()
{
    // Getting needed pointers
    TundraLogic::TundraLogicModule* tundra_ = framework_->GetModule<TundraLogic::TundraLogicModule>();
    assetAPI_ = framework_->Asset();
    client_ = tundra_->GetClient().get();
    server_ = tundra_->GetServer().get();


    // Getting remote collada storage url
    if(framework_->HasCommandLineParameter("--remoteColladaStorage"))
    {
        QStringList params = framework_->CommandLineParameters("--remoteColladaStorage");
        if(params.length() > 0)
            remoteStorageUrl = params.at(0).toStdString();
    }


    /// Initializing signal listeners

    // Starts the server process if the module runs on tundra server
    bool check = connect(server_, SIGNAL(ServerStarted()),
                         this, SLOT(serverProcess()), Qt::QueuedConnection);
    Q_ASSERT(check);

    // Starts the client process if the module runs on tundra client
    check = connect(client_, SIGNAL(Connected(UserConnectedResponseData *)),
                    this, SLOT(clientProcess()), Qt::QueuedConnection);
    Q_ASSERT(check);

}
Пример #2
0
 virtual void processDone(
     const Status& status,
     ChannelProcess::shared_pointer const & ChannelProcess)
 {
     PvaClientProcessPtr clientProcess(pvaClientProcess.lock());
     if(!clientProcess) return;
     clientProcess->processDone(status,ChannelProcess);
 }
Пример #3
0
 virtual void channelProcessConnect(
     const Status& status,
     ChannelProcess::shared_pointer const & channelProcess)
 {
     PvaClientProcessPtr clientProcess(pvaClientProcess.lock());
     if(!clientProcess) return;
     clientProcess->channelProcessConnect(status,channelProcess);  
 }
Пример #4
0
// Process a time event and update all sub-processes
void processTimeEvent(S32 elapsedTime)
{
   PROFILE_START(ProcessTimeEvent);

   // If recording a video and not playinb back a journal, override the elapsedTime
   if (VIDCAP->isRecording() && !Journal::IsPlaying())
      elapsedTime = VIDCAP->getMsPerFrame();   
   
   // cap the elapsed time to one second
   // if it's more than that we're probably in a bad catch-up situation
   if(elapsedTime > 1024)
      elapsedTime = 1024;
   
   U32 timeDelta;
   if(ATTS(gTimeAdvance))
      timeDelta = ATTS(gTimeAdvance);
   else
      timeDelta = (U32) (elapsedTime * ATTS(gTimeScale));
   
   Platform::advanceTime(elapsedTime);
   
   // Don't build up more time than a single tick... this makes the sim
   // frame rate dependent but is a useful hack for singleplayer.
   if ( ATTS(gFrameSkip) )
      if ( timeDelta > TickMs )
         timeDelta = TickMs;

   bool tickPass;
   
   PROFILE_START(ServerProcess);
   tickPass = serverProcess(timeDelta);
   PROFILE_END();
   
   PROFILE_START(ServerNetProcess);
   // only send packets if a tick happened
   if(tickPass)
      GNet->processServer();
   // Used to indicate if server was just ticked.
   Con::setBoolVariable( "$pref::hasServerTicked", tickPass );
   PROFILE_END();

   
   PROFILE_START(SimAdvanceTime);
   Sim::advanceTime(timeDelta);
   PROFILE_END();
   
   PROFILE_START(ClientProcess);
   tickPass = clientProcess(timeDelta);
   // Used to indicate if client was just ticked.
   Con::setBoolVariable( "$pref::hasClientTicked", tickPass );
   PROFILE_END_NAMED(ClientProcess);
   
   PROFILE_START(ClientNetProcess);
   if(tickPass)
      GNet->processClient();
   PROFILE_END();
   
   GNet->checkTimeouts();
   
   gFPS.update();

   // Give the texture manager a chance to cleanup any
   // textures that haven't been referenced for a bit.
   if( GFX )
      TEXMGR->cleanupCache( 5 );

   PROFILE_END();
   
   // Update the console time
   Con::setFloatVariable("Sim::Time",F32(Platform::getVirtualMilliseconds()) / 1000);
}
Пример #5
0
 virtual void message(std::string const & message, epics::pvData::MessageType messageType) {
     PvaClientProcessPtr clientProcess(pvaClientProcess.lock());
     if(!clientProcess) return;
     clientProcess->message(message,messageType);
 }
Пример #6
0
 virtual std::string getRequesterName() {
     PvaClientProcessPtr clientProcess(pvaClientProcess.lock());
     if(!clientProcess) return string("clientProcess is null");
     return clientProcess->getRequesterName();
 }