当前位置: 首页>>代码示例>>C++>>正文


C++ VisBaseEntity_cl::EditorThinkFunction方法代码示例

本文整理汇总了C++中VisBaseEntity_cl::EditorThinkFunction方法的典型用法代码示例。如果您正苦于以下问题:C++ VisBaseEntity_cl::EditorThinkFunction方法的具体用法?C++ VisBaseEntity_cl::EditorThinkFunction怎么用?C++ VisBaseEntity_cl::EditorThinkFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VisBaseEntity_cl的用法示例。


在下文中一共展示了VisBaseEntity_cl::EditorThinkFunction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnUpdateScene

// Game loop that updates the scene
void VisionApp_cl::OnUpdateScene()
{
  VISION_PROFILE_FUNCTION(VIS_PROFILE_GAMELOOP);

  IVisSceneManager_cl *pSceneManager = Vision::GetSceneManager();
  VASSERT(pSceneManager);

  // Check whether we should use async physics
  IVisPhysicsModule_cl *pPhysicsModule = Vision::GetApplication()->GetPhysicsModule();
  bool bAsyncPhysics;
  if (pPhysicsModule != NULL && pPhysicsModule->GetUseAsynchronousPhysics())
    bAsyncPhysics = true;
  else
    bAsyncPhysics = false; 

  //Timer is not longer updated here, because it needs to be updated right after the frame flip
  float fElapsedTime = Vision::GetTimer()->GetTimeDifference();

  // Advance the scene update counter
  Vision::Game.SetUpdateSceneCount( Vision::Game.GetUpdateSceneCount() + 1 );

  Vision::Callbacks.OnUpdateSceneBegin.TriggerCallbacks();


  //Send any queued messages before we remove entities
  Vision::Game.ProcessMessageQueue();

  // Delete "dead" entities from previous frame
  {
    VISION_PROFILE_FUNCTION( VIS_PROFILE_GAMELOOP_UPDATELOOP );
    Vision::Game.FreeRemovedEntities();
  }

  // Run the pre-physics loop: statistics, prethink, events & animations
  if ( Vision::Editor.IsPlaying() )
    RunPreThink(fElapsedTime);

  //Process animation messages after processing animations
  Vision::Game.ProcessMessageQueue();

  // Run the physics simulation (if physics simulation is set to synchronous)
  if ( Vision::Editor.IsPlaying() && !bAsyncPhysics)
  {
    RunPhysics(fElapsedTime);
    FetchPhysicsResults();
  }

  // Run the post-physics loop: posthink
  if ( Vision::Editor.IsPlaying() )
    RunThink(fElapsedTime);

  // for the editor, we call the EditorThinkFunction function in every mode for every entity:
  if (Vision::Editor.IsInEditor())
  {
    const int iCount = VisBaseEntity_cl::ElementManagerGetSize();
    for (int i=0;i<iCount;i++)
    {
      VisBaseEntity_cl *pEntity = VisBaseEntity_cl::ElementManagerGet(i);
      if (pEntity)
        pEntity->EditorThinkFunction();
    }
  }

  // handle the lightsources (e.g. color animation)
  if (Vision::Editor.IsAnimatingOrPlaying())
    VisLightSource_cl::HandleAllLightSources(fElapsedTime);

  // update the core engine and module system
  RunUpdateLoop();
  Vision::Game.ResetUpdatedEntitiesList();

  // Kick off asynchronous physics simulation
  if ( Vision::Editor.IsPlaying() && bAsyncPhysics )
  {
    RunPhysics(fElapsedTime);
  }

  // Handle portal/visibility zone transitions
  VisObject3DVisData_cl::HandleAllNodeTransitions();

  //Handle render contexts
  VisRenderContext_cl::HandleAllRenderContexts(fElapsedTime);

  //Animate textures (in animate mode)
  VisTextureAnimInstance_cl::HandleAllAnims(Vision::Editor.IsAnimatingOrPlaying() ? fElapsedTime : 0.f);

  // scroll sky only when animating scene
  IVSky *pSky = Vision::World.GetActiveSky();
  if (pSky != NULL && Vision::Editor.IsAnimatingOrPlaying())
    pSky->Tick(fElapsedTime);

  Vision::Callbacks.OnUpdateSceneFinished.TriggerCallbacks();
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:94,代码来源:VisionApp.cpp


注:本文中的VisBaseEntity_cl::EditorThinkFunction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。