本文整理汇总了C++中CActor::GetBoneTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ CActor::GetBoneTransform方法的具体用法?C++ CActor::GetBoneTransform怎么用?C++ CActor::GetBoneTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActor
的用法示例。
在下文中一共展示了CActor::GetBoneTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
const Vec3& CTacticalManager::GetTacticalIconWorldPos(const EntityId tacticalEntityId, IEntity* pTacticalEntity, bool& inOutIsHeadBone)
{
CRY_ASSERT(tacticalEntityId != 0);
CRY_ASSERT(pTacticalEntity != NULL);
if (pTacticalEntity == NULL)
{
return m_tempVec3.Set(0.0f,0.0f,0.0f);
}
// Try to get pos from headbone if don't have an override pos
TTacticalEntityToOverrideEntities::const_iterator iter = m_tacEntityToOverrideEntities.find(tacticalEntityId);
if (iter == m_tacEntityToOverrideEntities.end())
{
static IEntityClass* s_pTurretEntityClass = gEnv->pEntitySystem->GetClassRegistry()->FindClass("Turret");
IEntityClass* pEntityClass = pTacticalEntity->GetClass();
if (pEntityClass != NULL && pEntityClass == s_pTurretEntityClass)
{
ICharacterInstance* pCharacterInstance = pTacticalEntity->GetCharacter(0);
if (pCharacterInstance != NULL)
{
ICharacterModelSkeleton* pICharacterModelSkeleton = pCharacterInstance->GetICharacterModel()->GetICharacterModelSkeleton();
ISkeletonPose* pSkeletonPose = pCharacterInstance->GetISkeletonPose();
CRY_ASSERT(pSkeletonPose != NULL);
const int16 jointId = pICharacterModelSkeleton->GetJointIDByName("arcjoint");
if (0 <= jointId)
{
QuatT boneLocation = pSkeletonPose->GetAbsJointByID(jointId);
m_tempVec3 = pTacticalEntity->GetWorldTM().TransformPoint(boneLocation.t);
return m_tempVec3;
}
}
}
CUICVars* pCVars = g_pGame->GetUI()->GetCVars();
if (pCVars->hud_InterestPointsAtActorsHeads == 1)
{
CActor* pActor = static_cast<CActor*>(g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(tacticalEntityId)); // Only want units to go from headbone, since vehicles have headbone as well
if(pActor)
{
if(pActor->HasBoneID(BONE_HEAD))
{
QuatT boneLocation = pActor->GetBoneTransform(BONE_HEAD);
m_tempVec3 = pTacticalEntity->GetWorldTM().TransformPoint(boneLocation.t) + Vec3(0.0f, 0.0f, 0.25f);
inOutIsHeadBone = true;
return m_tempVec3;
}
else if(pActor->HasBoneID(BONE_SPINE))
{
QuatT boneLocation = pActor->GetBoneTransform(BONE_SPINE);
m_tempVec3 = pTacticalEntity->GetWorldTM().TransformPoint(boneLocation.t);
return m_tempVec3;
}
}
}
return GetTacticalIconCenterBBoxWorldPos(pTacticalEntity);
}
else // Override entity exists so it determines position
{
IEntity* pOverrideEntity = gEnv->pEntitySystem->GetEntity(iter->second);
if (pOverrideEntity)
{
m_tempVec3 = pOverrideEntity->GetWorldPos();
return m_tempVec3;
}
else
{
GameWarning("CTacticalManager::GetTacticalIconWorldPos: ID exists in mapping but failed to find entity, defaulting to center bounding box position");
return GetTacticalIconCenterBBoxWorldPos(pTacticalEntity);
}
}
}