예제 #1
0
void TSStatic::_updateShouldTick()
{
   bool shouldTick = mPlayAmbient && mAmbientThread;

   if ( isTicking() != shouldTick )
      setProcessTick( shouldTick );
}
예제 #2
0
bool NavPath::finalise()
{
   setProcessTick(false);

   resize();

   return success();
}
예제 #3
0
void PhysicsForce::onRemove()
{
   mWorld = NULL;
   mBody = NULL;
   getProcessList()->preTickSignal().remove( this, &PhysicsForce::_preTick );
   setProcessTick( false );

   Parent::onRemove();
}
예제 #4
0
bool NavPath::planSliced()
{
   bool visited = visitNext();

   if(visited)
      setProcessTick(true);

   return visited;
}
예제 #5
0
bool NavPath::planInstant()
{
   setProcessTick(false);
   visitNext();
   S32 store = mMaxIterations;
   mMaxIterations = INT_MAX;
   while(update());
   mMaxIterations = store;
   return finalise();
}
예제 #6
0
bool GameBase::onAdd()
{
   if ( !Parent::onAdd() )
      return false;

   // Datablock must be initialized on the server.
   // Client datablock are initialized by the initial update.
   if ( isServerObject() && mDataBlock && !onNewDataBlock( mDataBlock, false ) )
      return false;

   setProcessTick( true );

   return true;
}
예제 #7
0
bool PhysicsForce::onAdd()
{
   if ( !Parent::onAdd() )
      return false;

   // Find the physics world we're in.
   if ( PHYSICSMGR )
      mWorld = PHYSICSMGR->getWorld( isServerObject() ? "server" : "client" );

   setProcessTick( true );
   getProcessList()->preTickSignal().notify( this, &PhysicsForce::_preTick );

   return true;
}
예제 #8
0
void VolumetricFog::onRemove()
{
    if (isClientObject())
    {
        if (isTicking())
        {
            setProcessTick(false);
            if (mGlowing != 0)
            {
                mGlowing = 0;
                glowFX->disable();
            }
            _leaveFog(static_cast<ShapeBase*>(conn->getControlObject()));
        }
        VolumetricFogRTManager::getVolumetricFogRTMResizeSignal().remove(this, &VolumetricFog::handleResize);
        GuiCanvas::getCanvasSizeChangeSignal().remove(this, &VolumetricFog::handleCanvasResize);
    }
    removeFromScene();
    VFRTM->DecFogObjects();
    Parent::onRemove();
}
예제 #9
0
bool PxCloth::onAdd()
{
   if ( !Parent::onAdd() )
      return false;

   // Cloth is only created on the client.
   if ( isClientObject() )
   {
      mWorld = dynamic_cast<PxWorld*>( PHYSICSMGR->getWorld( "client" ) );

      if ( !mWorld || !mWorld->getScene() )
      {
         Con::errorf( "PxCloth::onAdd() - PhysXWorld not initialized... cloth disabled!" );
         return true;
      }

      mScene = mWorld->getScene();

      mResetXfm = getTransform();

      _createClothPatch();      

      PhysicsPlugin::getPhysicsResetSignal().notify( this, &PxCloth::onPhysicsReset, 1053.0f );
   }

   // On the server we use the static update
   // to setup the bounds of the cloth.
   if ( isServerObject() )
      _updateStaticCloth();

   addToScene();
   
   // Also the server object never ticks.
   if ( isServerObject() )
      setProcessTick( false );

   return true;
}
예제 #10
0
파일: sun.cpp 프로젝트: AlkexGas/Torque3D
bool Sun::onAdd()
{
   if ( !Parent::onAdd() )
      return false;

   // Register as listener to TimeOfDay update events
   TimeOfDay::getTimeOfDayUpdateSignal().notify( this, &Sun::_updateTimeOfDay );

	// Make this thing have a global bounds so that its 
   // always returned from spatial light queries.
	setGlobalBounds();
	resetWorldBox();
	setRenderTransform( mObjToWorld );
	addToScene();

   _initCorona();

   // Update the light parameters.
   _conformLights();

   setProcessTick( true );

   return true;
}
예제 #11
0
bool NavPath::onAdd()
{
   if(!Parent::onAdd())
      return false;

   if(gEditingMission)
      mNetFlags.set(Ghostable);

   resize();

   addToScene();

   if(isServerObject())
   {
      mQuery = dtAllocNavMeshQuery();
      if(!mQuery)
         return false;
      checkAutoUpdate();
      if(!plan())
         setProcessTick(true);
   }

   return true;
}