• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ VisBaseEntity_cl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SpawnPlayer

void RPG_GameManager::OnAfterSceneLoaded()
{
  RPG_RendererUtil::StoreViewParams(m_storedViewParams);

  // Set up game view params
  RPG_ViewParams viewParams = m_storedViewParams;
  {
    viewParams.m_projectionType = VIS_PROJECTIONTYPE_PERSPECTIVE;
    viewParams.m_nearClip = 50.f;
    viewParams.m_farClip = 2500.f;
    viewParams.m_fovX = 0.f;
    viewParams.m_fovY = 50.f;
  }

  RPG_RendererUtil::LoadViewParams(viewParams);

  // Local player
  VisBaseEntity_cl* playerEntity = SpawnPlayer("Prefabs\\Demo_Player_Hero.vprefab");

  if(playerEntity)
  {
    RPG_PlayerControllerComponent *const playerController = static_cast<RPG_PlayerControllerComponent*>
      (playerEntity->Components().GetComponentOfBaseType(V_RUNTIME_CLASS(RPG_PlayerControllerComponent)));

    VASSERT(playerController);
    if(playerController)
    {
      RPG_PlayerUI::s_instance.SetController(playerController);
    }
  }
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:31,代码来源:GameManager.cpp


示例2: OnAnimationEvent

void VAnimationEventEffectTrigger::OnAnimationEvent() 
{
  // Get the active event trigger info
  VEventEffectTriggerInfo_t* info = (VEventEffectTriggerInfo_t*) m_pActiveTriggerInfo;

  // Check if effect file is specified
  if (info == NULL || info->m_spEffectFile == NULL)
    return;
  
  // Get bone translation and orientation (if bone ID is 0 no bone has been specified)
  VisBaseEntity_cl* pEntity = (VisBaseEntity_cl *)m_pOwner;
  hkvVec3 vPos = pEntity->GetPosition() + info->m_vPositionOffset;
  hkvVec3 vOri = pEntity->GetOrientation() + info->m_vOrientationOffset;
  if (info->m_iAttachToBone != -1)
  {
    hkvQuat vRot;
    pEntity->GetBoneCurrentWorldSpaceTransformation(info->m_iAttachToBone, vPos, vRot);

    // Add position and orientation offset
    vPos = PositionOffset + vPos;
    hkvQuat vOffsetRot; vOffsetRot.setFromEulerAngles (vOri.data[2], vOri.data[1], vOri.data[0]); 
    vRot = vRot.multiplyReverse (vOffsetRot);

    vRot.getAsEulerAngles (vOri.z, vOri.y, vOri.x);
  }

  // Trigger effect
  VisParticleEffect_cl* pEffectInstance = info->m_spEffectFile->CreateParticleEffectInstance(vPos, vOri);
  pEffectInstance->SetRemoveWhenFinished(true);
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:30,代码来源:VAnimationEventEffectTrigger.cpp


示例3: ResetWorld

// ---------------------------------------------------------------------------------
// Method: ResetWorld
// Notes: This function is used by the LoadGame function to get rid of all
//        serializeable entities.
// ---------------------------------------------------------------------------------
void ResetWorld()
{
  int i;
  int iNumOfAllEntities = VisBaseEntity_cl::ElementManagerGetSize();
  
  // send CLEANUP messages to all the entities that are about to be freed, so
  // that they have a chance of cleaning up whatever is necessary before the
  // world is destroyed
  for (i = 0; i < iNumOfAllEntities; i++)
  {
    VisBaseEntity_cl *pEnt = VisBaseEntity_cl::ElementManagerGet(i);
    if ( pEnt )
    {
      if ( pEnt->IsOfType(SerializeBaseEntity_cl::GetClassTypeId()) )
      {
        Vision::Game.SendMsg(pEnt, MSG_SER_CLEANUP, 0, 0 );
      }
    }
  }

  // now actually free all the serializeable entities
  for (i = 0; i < iNumOfAllEntities; i++)
  {
    VisBaseEntity_cl *pEnt = VisBaseEntity_cl::ElementManagerGet(i);
    if ( pEnt )
    {
      if ( pEnt->IsOfType(SerializeBaseEntity_cl::GetClassTypeId()) )
      {
        pEnt->DisposeObject();
      }
    }
  }
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:38,代码来源:main.cpp


示例4: CreateEntityFromPrefab

VisBaseEntity_cl* MyGameManager::SpawnPlayer(const VString& prefabName, hkvVec3 const& position, hkvVec3 const& orientation)
{
	
    VisBaseEntity_cl* playerEntity = CreateEntityFromPrefab(prefabName, position, orientation);
    playerEntity->InitFunction();
    
    if(playerEntity)
    {
        PlayerComponent *const playerController = static_cast<PlayerComponent*>
        (playerEntity->Components().GetComponentOfBaseType(V_RUNTIME_CLASS(PlayerComponent)));
        
        //VASSERT(playerController);
        if(playerController)
        {
            spGUIContext = new VGUIMainContext(NULL);
            // Create a GUI context
            mDialog = new PlayerDialog(playerController);
            mDialog->InitDialog(spGUIContext, NULL, NULL);
            spGUIContext->ShowDialog(mDialog);
            spGUIContext->SetActivate(true);
        }
        
        m_playerEntity = playerEntity->GetWeakReference();
        //Vision::Message.Add(1, "Spawn");
    }
    
    return playerEntity;
}
开发者ID:KingdomKatie,项目名称:FYP_IOS_2.5,代码行数:28,代码来源:GameManager.cpp


示例5: GetComponentOfBaseType

 inline ComponentType* GetComponentOfBaseType() const 
 { 
   VisBaseEntity_cl* pEntity = GetEntity();
   if (pEntity == NULL)
     return NULL;
   return pEntity->Components().GetComponentOfBaseType<ComponentType>();
 }
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:7,代码来源:VCameraHandling.hpp


示例6: MessageFunction

void VAnimationEventEffectTrigger::MessageFunction( int iID, INT_PTR iParamA, INT_PTR iParamB )
{  
  IVTransitionEventTrigger::MessageFunction(iID, iParamA, iParamB);

#ifdef WIN32
  if (iID == VIS_MSG_EDITOR_GETSTANDARDVALUES)
  {
    // Get bone names
    const char *szKey = (const char *)iParamA;
    if (!strcmp(szKey,"Bone"))
    {
      // Check for model and skeleton
      VisBaseEntity_cl* pEntity = (VisBaseEntity_cl *)m_pOwner;
      if (pEntity == NULL)
        return;
      VDynamicMesh* pMesh = pEntity->GetMesh();
      if (pMesh == NULL)
        return;
      VisSkeleton_cl *pSkeleton = pMesh->GetSkeleton();
      if (pSkeleton == NULL)
        return;

      // Fill list with bone names (first entry is empty)
      VStrList *pDestList = (VStrList*) iParamB;
      pDestList->AddString(" ");
      for (int i = 0; i < pSkeleton->GetBoneCount(); i++)
        pDestList->AddString(pSkeleton->GetBone(i)->m_sBoneName.AsChar());
    }
  }
#endif
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:31,代码来源:VAnimationEventEffectTrigger.cpp


示例7: DeactivateAllCameras

void VCameraHandling::DeactivateAllCameras()
{
  // Deactivate all orbit and path cameras.
  const unsigned int uiNumEntities = VisBaseEntity_cl::ElementManagerGetSize();

  for (unsigned int uiElementIndex = 0; uiElementIndex < uiNumEntities; uiElementIndex++)
  {
    VisBaseEntity_cl* pEntity = VisBaseEntity_cl::ElementManagerGet(uiElementIndex);
    if (pEntity == NULL)
      continue;

    VFreeCamera* pFreeCamera = vdynamic_cast<VFreeCamera*>(pEntity);
    VOrbitCamera* pOrbitCamera = pEntity->Components().GetComponentOfBaseType<VOrbitCamera>();
    PathCameraEntity* pPathCamera = vdynamic_cast<PathCameraEntity*>(pEntity);

    if (pFreeCamera != NULL)
      pFreeCamera->SetThinkFunctionStatus(FALSE);

    if (pOrbitCamera != NULL)
      pOrbitCamera->SetEnabled(false);

    if (pPathCamera != NULL)
      pPathCamera->Stop();
  }
}
开发者ID:Superdenny,项目名称:peggle,代码行数:25,代码来源:VCameraHandling.cpp


示例8: RemoveLast

void IController::RemoveLast(void)
{
    VisBaseEntity_cl *ent = entityStack->pop();
    if (ent != NULL)
    {
        ent->DisposeObject();
    }
}
开发者ID:josh-nitzahn,项目名称:ScenesOfAnarchy,代码行数:8,代码来源:IController.cpp


示例9: CommonInit

bool VAnimationEventEffectTrigger::CommonInit()
{
  // Initialize base component
  if (!IVTransitionEventTrigger::CommonInit())
    return false;
  
  // Get owner entity
  VisBaseEntity_cl *pEntity = (VisBaseEntity_cl *)m_pOwner;
  if (pEntity == NULL)
    return false;

  // Fill the event trigger info
  if (m_iEventTriggerInfoCount <= 0)
  {
    VEventEffectTriggerInfo_t* info = NULL;
    if(m_pActiveTriggerInfo == NULL) //make sure it does not get created more than once
    {
      // Create new list with only one entry and set properties
      info = new VEventEffectTriggerInfo_t();
    }
    else
    {
      info = (VEventEffectTriggerInfo_t*)m_pActiveTriggerInfo;
    }

    info->m_vPositionOffset = PositionOffset;
    info->m_vOrientationOffset= OrientationOffset;


    // Get effect file
    info->m_spEffectFile = VisParticleGroupManager_cl::GlobalManager().LoadFromFile(EffectFilename);
    if (info->m_spEffectFile == NULL || !GetEventTriggerInfoBaseData(info))
    {
      V_SAFE_DELETE(info);
      m_pActiveTriggerInfo = NULL;
      return false;
    }

    // Get Bone Index if specified
    if (!AttachToBone.IsEmpty())
    {
      VDynamicMesh* pMesh = pEntity->GetMesh();
      if (pMesh == NULL)
        return false;
      VisSkeleton_cl *pSkeleton = pMesh->GetSkeleton();
      if (pSkeleton == NULL)
        return false;

      info->m_iAttachToBone = pSkeleton->GetBoneIndexByName(AttachToBone);
    }

    // Set it as the active event trigger info
    m_pActiveTriggerInfo = info;
  }

  return true;
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:57,代码来源:VAnimationEventEffectTrigger.cpp


示例10: hkvVec3

VisBaseEntity_cl* IController::AddCube(float x, float y, float z) {
    VisBaseEntity_cl *ent = Vision::Game.CreateEntity("VisBaseEntity_cl", hkvVec3(x, y, z), "Models\\Misc\\Cube.Model");
    vHavokRigidBody *cube = new vHavokRigidBody();
    cube->Havok_TightFit = true;
    ent->AddComponent(cube);
    //EntityStack stack = *entityStack;
    //stack.push(ent);
    entityStack->push(ent);
    return ent;
}
开发者ID:josh-nitzahn,项目名称:ScenesOfAnarchy,代码行数:10,代码来源:IController.cpp


示例11: FindLevelInfo

/// Finds and stores the level info object.
void RPG_GameManager::FindLevelInfo()
{
  // find the level info object
  VisBaseEntity_cl* levelInfo = Vision::Game.SearchEntity(RPG_LevelInfo::GetStaticKey());

  if(levelInfo &&
    levelInfo->IsOfType(V_RUNTIME_CLASS(RPG_LevelInfo)))
  {
    // store the level info object if we found one
    m_levelInfo = static_cast<RPG_LevelInfo*>(levelInfo);
  }
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:13,代码来源:GameManager.cpp


示例12: DeactivatePathCameraEntities

// Some sample scenes create an automatic path camera, which doesn't work with
// our multi-context approach to rendering stereoscopic images, so we'll have to
// find and deactivate them.
void DeactivatePathCameraEntities()
{
  for (unsigned int i=0;i<VisBaseEntity_cl::ElementManagerGetSize();i++)
  {
    VisBaseEntity_cl *pEnt = VisBaseEntity_cl::ElementManagerGet(i);
    if ( pEnt && pEnt->GetTypeId() == PathCameraEntity::GetClassTypeId() )
    {
      PathCameraEntity* pPathCam = ( PathCameraEntity* ) pEnt;
      pPathCam->Stop();
    }
  }
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:15,代码来源:OculusVR.cpp


示例13:

  EngineInstancePathCamera::EngineInstancePathCamera()
  {
    VisBaseEntity_cl *pEntity = Vision::Game.CreateEntity("PathCameraEntity",hkvVec3(0,0,0));
    Debug::Assert(pEntity!=nullptr,"Could not create Cloth entity!");

    // reference the entity with a weak pointer. This will make sure that we correctly get a null pointer
    // if the entity gets deleted in the engine
    m_pEntityWP = new VWeakPtr<VisBaseEntity_cl>(pEntity->GetWeakReference());

    m_pSpriteTex = Vision::TextureManager.Load2DTexture("textures\\videoCamera.dds",VTM_FLAG_DEFAULT_NON_MIPMAPPED);
    m_pSpriteTex->AddRef();

  }
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:13,代码来源:EngineInstancePathCamera.cpp


示例14: VISION_PROFILE_FUNCTION

// Helper for OnRunGameLoop
// Post-physics loop: posthink & modulesystem-notifications
void VisionApp_cl::RunThink(float fElapsedTime)
{
  const VisEntityCollection_cl &relevantEntities = Vision::Game.GetThinkingEntities();

  VISION_PROFILE_FUNCTION(VIS_PROFILE_GAMELOOP_THINKFUNCTION);

  int &i = relevantEntities.m_iIterator; // use this iterator to keep counter in-sync if collection changes during loop
  for (i=0; i<relevantEntities.GetNumEntries(); i++)
  {
    VisBaseEntity_cl *pEntity = relevantEntities.GetEntry(relevantEntities.m_iIterator);
    VASSERT(pEntity->GetThinkFunctionStatus());

    // entity code postthink
    pEntity->ThinkFunction();
  }
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:18,代码来源:VisionApp.cpp


示例15: GetPosition

///< Spawn the Ai Character and perform any setup we need to of them.
void RPG_AiSpawnPoint::OnSpawn()
{
  // only spawn if we haven't already. @todo: add support for spawning waves of characters.
  if(m_spawned)
  {
    return;
  }

  m_spawned = true;

  bool success = false;

  if(!m_prefabName.IsEmpty())
  {
    VisBaseEntity_cl* entity = RPG_GameManager::s_instance.CreateEntityFromPrefab(m_prefabName, GetPosition(), GetOrientation());
    
    if(entity)
    {
      if(entity->IsOfType(V_RUNTIME_CLASS(RPG_Character)))
      {
        m_character = static_cast<RPG_Character*>(entity);
      }

      success = true;
    }
  }
  else if(!m_spawnScript.IsEmpty())
  {
    VisBaseEntity_cl* entity = RPG_GameManager::s_instance.CreateEntityFromScript(m_spawnScript, GetPosition(), GetOrientation());
    VASSERT(entity);

    if(entity)
    {
      if(entity->IsOfType(V_RUNTIME_CLASS(RPG_Character)))
      {
        m_character = static_cast<RPG_Character*>(entity);
      }

      success = true;
    }
  }

  if(!success)  
  {
    hkvLog::Warning("Ai Spawner has no Prefab defined, and no valid Script definition!");
  }
}
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:48,代码来源:AiSpawnPoint.cpp


示例16: while

void ParticleRainController::RainBalls(int numOfBalls){
	while (ballCount < numOfBalls){
		int randomx = rand() % 6000 - 3255;
		int randomy = rand() % 6000 - 1416;
		VisBaseEntity_cl *ent = Vision::Game.CreateEntity("VisBaseEntity_cl", hkvVec3(randomx, randomy, 3000), "Models\\Misc\\Sphere.Model");
		vHavokRigidBody *ball = new vHavokRigidBody();
		ball->Havok_TightFit = true;
		ball->Havok_Mass = 5.0f;
		ball->Havok_Restitution = 1.0f;
		ball->Shape_Type = ShapeType_SPHERE;
		ent->SetScaling(1.0f);

		ent->AddComponent(ball);
		++ballCount;
	}
	ballCount = 0;
}
开发者ID:ArmandSaro,项目名称:ScenesOfAnarchy,代码行数:17,代码来源:ParticleRainController.cpp


示例17: OnAnimationEvent

void VFmodAnimationEventSoundTrigger::OnAnimationEvent() 
{
  // Get the active event trigger info
  VFmodEventSoundTriggerInfo_t* info = (VFmodEventSoundTriggerInfo_t*) m_pActiveTriggerInfo;

  // Check if effect file is specified
  if (info == NULL || info->m_spSoundResource == NULL)
    return; 
  
  // Get entity position
  VisBaseEntity_cl* pEntity = (VisBaseEntity_cl *)m_pOwner;
  hkvVec3 vPos = pEntity->GetPosition();

  // Trigger sound effect  
  VFmodSoundObject* pSound = info->m_spSoundResource->CreateInstance(vPos, VFMOD_FLAG_NONE);
  if(pSound)
    pSound->Play();
}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:18,代码来源:VFmodAnimationEventSoundTrigger.cpp


示例18: LoadMap

// ---------------------------------------------------------------------------------
// Method: LoadMap
// Notes: 
// ---------------------------------------------------------------------------------
void LoadMap(int iMap, BOOL bLoadEntities)
{
  g_spMap = NULL;

  // load map
  strcpy(g_pszCurrentMap, g_pszMaps[iMap]);
  g_iCurrentMap = iMap;
  spApp->LoadScene(g_pszCurrentMap);

  hkvVec3 vStart;
  // try to find the Player_Start placeholder entity
  VisBaseEntity_cl* pStart = Vision::Game.SearchEntity("Player_Start");
  if (pStart)
    vStart = pStart->GetPosition();
  else
    vStart.set (-350.f, 200.f, 200.f);

  if ( bLoadEntities )
  {
    // create player entity (in case the entities are not loaded from the savegame)
    Vision::Game.CreateEntity("SerializePlayer_cl", vStart);

    // create 3 spotlight entities
    hkvVec3 Placement;
    Placement.set ( -200, 500, 200 );
    Vision::Game.CreateEntity("SerializeSpotlight_cl", Placement );
    Placement.set ( -300, 0, 100 );
    Vision::Game.CreateEntity("SerializeSpotlight_cl", Placement );
    Placement.set ( 40, -600, 100 );
    Vision::Game.CreateEntity("SerializeSpotlight_cl", Placement );
  }

  // create some screen masks
  int w = Vision::Video.GetXRes();
  int h = Vision::Video.GetYRes();

  // set up "current map" screen mask
  g_spMap = new VisScreenMask_cl(g_pszMapIcons[iMap], TEXTURE_LOADING_FLAGS);
  g_spMap->SetPos( w - 48.f - 8.f, (float)h - 48.f - 8.f );
  g_spMap->SetTransparency(VIS_TRANSP_ALPHA);
  g_spMap->SetColor(g_iOverlayColor);
  g_spMap->SetVisible(TRUE);
}
开发者ID:cDoru,项目名称:projectanarchy,代码行数:47,代码来源:main.cpp


示例19: defined

WaterSimulationController::WaterSimulationController(void)
{
	
#if defined(_VISION_ANDROID) //free camera for android (joystick/finger camera)
	VisBaseEntity_cl* pCam = Vision::Game.CreateEntity("VFreeCamera", hkvVec3::ZeroVector());
	pCam->SetPosition(-290, -220, 680); //spawns with same coordinates as windows
	pCam->SetOrientation(20, 67, 19);

#endif
#if defined(WIN32)
	VisBaseEntity_cl *pCamera  = Vision::Game.SearchEntity("tankcamera");
	Vision::Camera.AttachToEntity(pCamera, hkvVec3::ZeroVector());

#endif	
	/*#if defined(_VISION_ANDROID)
	pMod = static_cast<vHavokPhysicsModule*>(vHavokPhysicsModule::GetInstance());
	pMotionInput = (VMotionInputAndroid*)(&VInputManager::GetInputDevice(INPUT_DEVICE_MOTION_SENSOR));
	pMotionInput->SetEnabled(true);
	#endif*/
}
开发者ID:ArmandSaro,项目名称:ScenesOfAnarchy,代码行数:20,代码来源:WaterSimulationController.cpp


示例20: VisTriggerTargetComponent_cl

void GameState::InitFunction()
{
  // Add target component
  VisTriggerTargetComponent_cl *pTargetComp = new VisTriggerTargetComponent_cl();
  AddComponent(pTargetComp);

  // Get trigger box entity
  VisBaseEntity_cl *pTriggerBoxEntity = Vision::Game.SearchEntity("TriggerBox");
  VASSERT(pTriggerBoxEntity);

  // Find source component
  VisTriggerSourceComponent_cl* pSourceComp = vstatic_cast<VisTriggerSourceComponent_cl*>(
    pTriggerBoxEntity->Components().GetComponentOfTypeAndName(VisTriggerSourceComponent_cl::GetClassTypeId(), "OnObjectEnter"));
  VASSERT(pSourceComp != NULL);

  // Link source and target component 
  IVisTriggerBaseComponent_cl::OnLink(pSourceComp, pTargetComp);
  
  m_eState = GAME_STATE_RUN;
}
开发者ID:RexBaribal,项目名称:projectanarchy,代码行数:20,代码来源:GameState.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VisRenderContext_cl类代码示例发布时间:2022-05-31
下一篇:
C++ VirtualRegister类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap