本文整理汇总了C++中IStatObj::GetHelperTM方法的典型用法代码示例。如果您正苦于以下问题:C++ IStatObj::GetHelperTM方法的具体用法?C++ IStatObj::GetHelperTM怎么用?C++ IStatObj::GetHelperTM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStatObj
的用法示例。
在下文中一共展示了IStatObj::GetHelperTM方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//------------------------------------------------------------------------
const Matrix33 &CItem::GetSlotHelperRotation(int slot, const char *helper, bool worldSpace, bool relative)
{
static Matrix33 rotation;
rotation.SetIdentity();
IEntity* pEntity = GetEntity();
if(!pEntity)
return rotation;
SEntitySlotInfo info;
if (pEntity->GetSlotInfo(slot, info))
{
if (info.pStatObj)
{
IStatObj *pStatObj = info.pStatObj;
rotation = Matrix33(pStatObj->GetHelperTM(helper));
rotation.OrthonormalizeFast();
rotation = Matrix33(GetEntity()->GetSlotLocalTM(slot, false))*rotation;
}
else if (info.pCharacter)
{
ICharacterInstance *pCharacter = info.pCharacter;
if(!pCharacter)
return rotation;
IAttachment* pAttachment = pCharacter->GetIAttachmentManager()->GetInterfaceByName(helper);
if(pAttachment)
{
rotation = Matrix33(worldSpace ? pAttachment->GetAttWorldAbsolute().q : pAttachment->GetAttModelRelative().q);
return rotation;
}
else
{
ICharacterModelSkeleton* pICharacterModelSkeleton = pCharacter->GetICharacterModel()->GetICharacterModelSkeleton();
ISkeletonPose* pSkeletonPose = pCharacter->GetISkeletonPose();
int16 id = pICharacterModelSkeleton->GetJointIDByName(helper);
if (id > -1)
{
rotation = relative ? Matrix33(pSkeletonPose->GetRelJointByID(id).q) : Matrix33(pSkeletonPose->GetAbsJointByID(id).q);
}
}
if (!relative)
{
rotation = Matrix33(pEntity->GetSlotLocalTM(slot, false)) * rotation;
}
}
}
if (worldSpace)
{
rotation = Matrix33(pEntity->GetWorldTM()) * rotation;
}
return rotation;
}
示例2: if
//------------------------------------------------------------------------
const Matrix33 &CItem::GetSlotHelperRotation(int slot, const char *helper, bool worldSpace, bool relative)
{
// if mounted force the slot to be 1st person
if(m_stats.mounted)
slot=eIGS_FirstPerson;
static Matrix33 rotation;
rotation.SetIdentity();
IEntity *pEntity = GetEntity();
if(!pEntity)
return rotation;
SEntitySlotInfo info;
if(pEntity->GetSlotInfo(slot, info))
{
if(info.pStatObj)
{
IStatObj *pStatObj = info.pStatObj;
rotation = Matrix33(pStatObj->GetHelperTM(helper));
rotation.OrthonormalizeFast();
rotation = Matrix33(GetEntity()->GetSlotLocalTM(slot, false))*rotation;
}
else if(info.pCharacter)
{
ICharacterInstance *pCharacter = info.pCharacter;
if(!pCharacter)
return rotation;
int16 id = pCharacter->GetISkeletonPose()->GetJointIDByName(helper);
// if (id > -1) rotation = Matrix33(pCharacter->GetISkeleton()->GetAbsJMatrixByID(id));
if(id > -1)
{
if(relative)
rotation = Matrix33(pCharacter->GetISkeletonPose()->GetRelJointByID(id).q);
else
rotation = Matrix33(pCharacter->GetISkeletonPose()->GetAbsJointByID(id).q);
}
if(!relative)
rotation = Matrix33(pEntity->GetSlotLocalTM(slot, false))*rotation;
}
}
if(worldSpace)
rotation=Matrix33(pEntity->GetWorldTM())*rotation;
return rotation;
}