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


C++ V_RUNTIME_CLASS函数代码示例

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


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

示例1: GetLevelInfo

void EntityLODComponent::UpdateLODLevel(int newLevel)
{
  if (m_iCurrentLevel==newLevel)
  {
    return;
  }

  // change the mesh and the animation config used
  int oldLevel = m_iCurrentLevel;
  VLODLevelInfo &newLODInfo = GetLevelInfo(newLevel);
  m_iCurrentLevel=newLevel;
  m_pOwner->SetMesh(newLODInfo.m_spMesh);
  m_pOwner->SetAnimConfig(newLODInfo.m_spAnimConfig);

  // synchronize animation tracks of both LODs
  if (oldLevel>=0 && oldLevel<m_iLevelCount)
  {
	  VLODLevelInfo &oldLODInfo = GetLevelInfo(oldLevel);
	  IVisAnimResultGenerator_cl* oldLODAnimInput = oldLODInfo.m_spAnimConfig->GetFinalResult()->GetSkeletalAnimInput();

	  float currAnimTime = 0.0f;
	  if ( oldLODAnimInput->IsOfType( V_RUNTIME_CLASS(VisSkeletalAnimControl_cl) ) )
	  {
        VisSkeletalAnimControl_cl* oldLODAanimController = static_cast< VisSkeletalAnimControl_cl* >( oldLODAnimInput );
	     currAnimTime = oldLODAanimController->GetCurrentSequenceTime();
	  }

	  IVisAnimResultGenerator_cl* newLODAnimInput = newLODInfo.m_spAnimConfig->GetFinalResult()->GetSkeletalAnimInput();
	  if ( newLODAnimInput->IsOfType( V_RUNTIME_CLASS(VisSkeletalAnimControl_cl) ) )
	  {
	     VisSkeletalAnimControl_cl* newLODAanimController = static_cast< VisSkeletalAnimControl_cl* >( newLODAnimInput );
	     newLODAanimController->SetCurrentSequenceTime( currAnimTime );
	  }
  }
}
开发者ID:Alagong,项目名称:projectanarchy,代码行数:35,代码来源:EntityLODComponent.cpp

示例2: CanAttachToObject

BOOL VBlobShadow::CanAttachToObject(VisTypedEngineObject_cl *pObject, VString &sErrorMsgOut)
{
  if (!IVObjectComponent::CanAttachToObject(pObject, sErrorMsgOut))
    return FALSE;

  if ((!pObject->IsOfType(V_RUNTIME_CLASS(VisObject3D_cl))) && (!pObject->IsOfType(V_RUNTIME_CLASS(VisStaticMeshInstance_cl))))
  {
    sErrorMsgOut = "Component can only be added to instances of VisObject3D_cl and VisStaticMeshInstance_cl or derived classes.";
    return FALSE;
  }
  
  return TRUE;
}
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:13,代码来源:BlobShadow.cpp

示例3: GetPosition

void RPG_Pickup::CheckCharacterContact()
{
  VArray<RPG_Character*> const& characters = RPG_GameManager::s_instance.GetCharacters();

  hkvVec3 const& currentPosition = GetPosition();

  for(int index = 0; index < characters.GetSize(); ++index)
  {
    RPG_Character* character = characters.GetAt(index);

    // only target players
    if(!character->IsOfType(V_RUNTIME_CLASS(RPG_PlayerCharacter)))
    {
      continue;
    }

    hkvVec3 const& targetPosition = character->GetPosition();

    float currentRangeSquared = (currentPosition - targetPosition).getLengthSquared();

    if(currentRangeSquared <= m_pickupRadius * m_pickupRadius)
    {
      // call OnPickup for subclasses
      OnPickup(character);

      // play the pickup effect
      CreateEffect(PKFX_Pickup, GetPosition(), GetOrientation());

      // setup this object for deletion
      DisposeObject();
    }
  }
}
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:33,代码来源:Pickup.cpp

示例4: CanAttachToObject

BOOL VTimeOfDayComponent::CanAttachToObject(VisTypedEngineObject_cl *pObject, VString &sErrorMsgOut)
{
  if (pObject->IsOfType(V_RUNTIME_CLASS(VisObject3D_cl)))
    return TRUE;

  return FALSE;
}
开发者ID:Alagong,项目名称:projectanarchy,代码行数:7,代码来源:VTimeOfDayComponent.cpp

示例5: VASSERT_MSG

void VRendererNodeCommon::UpdateTimeOfDay()
{
  // Update the active sky.
  IVSky* pSky = m_spSky;
  if (pSky == NULL)
  {
    pSky = Vision::World.GetActiveSky();
  }
  if (pSky != NULL)
  {
    pSky->Tick(0);
  }

  // Update Time Of Day handler.
  IVTimeOfDay* pTimeOfDayInterface = Vision::Renderer.GetTimeOfDayHandler();
  if (pTimeOfDayInterface != NULL)
  {
    VASSERT_MSG(pTimeOfDayInterface->IsOfType(V_RUNTIME_CLASS(VTimeOfDay)),
      "Incompatible time of day handler installed - has to be VTimeOfDay or a subclass of it!");
    VTimeOfDay* pTimeOfDay = vstatic_cast<VTimeOfDay*>(pTimeOfDayInterface);
    pTimeOfDay->UpdateFogParameters();

    VColorRef vAmbientColor = pTimeOfDay->GetAmbientColor();
    Vision::Renderer.SetGlobalAmbientColor(vAmbientColor.ToFloat().getAsVec4(1.0f));
  }
  else
  {
    // Set the default global ambient color.
    Vision::Renderer.SetGlobalAmbientColor(Vision::Renderer.GetDefaultGlobalAmbientColor());
  }
}
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:31,代码来源:VRendererNodeCommon.cpp

示例6: IsValidEntity

/// Checks if this is a valid entity for triggering.
bool RPG_Trigger::IsValidEntity(VisBaseEntity_cl* entity) const
{
  if(!entity)
  {
    return false;
  }

  // make sure this entity isn't Entering again before leaving.
  if(m_insideEntities.Find(entity) > -1)
  {
    //VASSERT_MSG(false, "RPG_Trigger::IsValidEntity - Entity is trying to Enter more than once before Leaving!");
    return false;
  }


  bool canTrigger = false;

  if(m_acceptOnlyPlayers)
  {
    // make sure this is a player
    if(entity->Components().GetComponentOfBaseType(V_RUNTIME_CLASS(RPG_PlayerControllerComponent)))
    {
      canTrigger = true;
    }
  }
  else
  {
    // go ahead if we have no restrictions
    canTrigger = true;
  }

  return canTrigger;
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:34,代码来源:Trigger.cpp

示例7: 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

示例8: SetOwner

void VTimeOfDayComponent::SetOwner(VisTypedEngineObject_cl *pOwner)
{
  IVObjectComponent::SetOwner(pOwner);
  m_bIsLightClass = pOwner!=NULL && pOwner->IsOfType(V_RUNTIME_CLASS(VisLightSource_cl));
  if (m_bIsLightClass)
    m_iColor = ((VisLightSource_cl*)pOwner)->GetColor();
}
开发者ID:Alagong,项目名称:projectanarchy,代码行数:7,代码来源:VTimeOfDayComponent.cpp

示例9: EnsureLoaded

BOOL VPrefab::Instantiate(VPrefabInstanceInfo &info)
{
  EnsureLoaded();
  if (!IsLoaded())
    return FALSE;

  // serialize from memory block (class VPrefabShapesArchive provides with transformation)
  VMemBlockWrapperStream inStream(m_BinaryBlock.GetBuffer(), m_iSize);
  VPrefabShapesArchive ar(&inStream, info);
  ar.SetLoadingVersion(m_Header.m_iArchiveVersion);

  if (info.m_bOutputInstances)
    info.m_Instances.EnsureSize(m_Header.m_iRootObjectCount);

  info.m_iInstanceCount = m_Header.m_iRootObjectCount;
  for (int i=0;i<m_Header.m_iRootObjectCount;i++)
  {
    VTypedObject *pObj = ar.ReadObject(NULL);
    if (info.m_bOutputInstances)
      info.m_Instances[i] = pObj;
    if (info.m_pParentObject!=NULL && pObj!=NULL && pObj->IsOfType(V_RUNTIME_CLASS(VisObject3D_cl)))
    {
      VisObject3D_cl *pObj3D = (VisObject3D_cl *)pObj;
      if (pObj3D->GetParent()==NULL) // this is how we identify the root elements
        pObj3D->AttachToParent(info.m_pParentObject);
    }
  }

  ar.Close();

  return TRUE;
}
开发者ID:guozanhua,项目名称:projectanarchy,代码行数:32,代码来源:VPrefab.cpp

示例10: 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

示例11: CommonDeinit

// ----------------------------------------------------------------------------
void vHavokChainAnimation::CommonInit()
{
  CommonDeinit();

  if (!m_pOwner || !m_pOwner->IsOfType(V_RUNTIME_CLASS(VisBaseEntity_cl)))
    return;

  Vision::Callbacks.OnUpdateSceneFinished += this;

  m_pOwnerEntity = static_cast<VisBaseEntity_cl*>(m_pOwner);
  VisAnimConfig_cl *pAnimConfig = m_pOwnerEntity->GetAnimConfig();

  // If there is no AnimConfig, but we can get a skeleton, create the AnimConfig.
  if (!pAnimConfig)
  {
    VDynamicMesh *pMesh = m_pOwnerEntity->GetMesh();
    VisSkeleton_cl *pSkeleton = pMesh ? pMesh->GetSkeleton() : NULL;
    if (pSkeleton)
    {
      VisAnimFinalSkeletalResult_cl* pFinalSkeletalResult;
      pAnimConfig = VisAnimConfig_cl::CreateSkeletalConfig(pMesh, &pFinalSkeletalResult);
      m_pOwnerEntity->SetAnimConfig(pAnimConfig);
    }
  }
}
开发者ID:Alagong,项目名称:projectanarchy,代码行数:26,代码来源:vHavokChainAnimation.cpp

示例12: 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

示例13: VASSERT

void PlayerUIDialog::ContinueMeleeAttack(RPG_Character* characterEntity, RPG_DamageableEntity * const targetEntity)
{
  VASSERT(characterEntity);
  const bool hitHighlightable = targetEntity->Components().GetComponentOfBaseType(V_RUNTIME_CLASS(RPG_HighlightableComponent));
  const bool hitAttackable = targetEntity->Components().GetComponentOfBaseType(V_RUNTIME_CLASS(RPG_AttackableComponent));
  //@debug: test log output
  //Vision::Error.Warning(hitEntity->GetMesh()->GetFilename());

  if (hitHighlightable || hitAttackable)
  {
    if (hitHighlightable)  //"(RPG) Highlightable"
    {
      //Vision::Error.Warning("(RPG) Highlightable");

#ifdef _DEBUG
      if (m_debugUI)
      {
        Vision::Message.DrawMessage3D("(RPG) Highlightable", targetEntity->GetPosition());
      }
#endif
    }

    if (hitAttackable)  //"(RPG) Attackable"
    {
      // if player's holding down primary action input on an existing attack action, this sets its continue flag to true.
      if (characterEntity->GetActionHandler().IsPerformingAction(AT_MeleeAttack))
      {
        characterEntity->GetActionHandler().SetActiveActionFlags(1);
      }

#ifdef _DEBUG
      if (m_debugUI)
      {
        Vision::Message.DrawMessage3D("(RPG) Attackable", targetEntity->GetPosition() + hkvVec3(0.0f, 0.0f, 16.0f)); // (@hack: offset a little to avoid overwriting other component messages)
      }
#endif
    }
  }
  else
  {
    if(!characterEntity->IsAttacking())
    {
      // fall back to the move if the entity we hit wasn't a highlightable or attackable.
      RequestMove(characterEntity, false);
    }
  }
}
开发者ID:Bewolf2,项目名称:projectanarchy,代码行数:47,代码来源:PlayerUIDialog.cpp

示例14: SetPathObject

bool VPathRenderingData::SetPathObject(VTypedObject* pObject)
{
  if (!pObject->IsOfType(V_RUNTIME_CLASS(VisPath_cl)))
    return false;

  m_spPathObject = (VisPath_cl*)pObject;
  return true;
}
开发者ID:Arpit007,项目名称:projectanarchy,代码行数:8,代码来源:VPathRenderingData.cpp

示例15: SetPathObject

bool vHavokConstraintChainRenderingData::SetPathObject(VTypedObject* pObject)
{
    if (!pObject->IsOfType(V_RUNTIME_CLASS(vHavokConstraintChain)))
        return false;

    m_spPathObject = (vHavokConstraintChain*)pObject;
    return true;
}
开发者ID:bgarrels,项目名称:projectanarchy,代码行数:8,代码来源:vHavokConstraintChainRenderingData.cpp


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