本文整理汇总了C++中ISkeletonPose::SetLookIK方法的典型用法代码示例。如果您正苦于以下问题:C++ ISkeletonPose::SetLookIK方法的具体用法?C++ ISkeletonPose::SetLookIK怎么用?C++ ISkeletonPose::SetLookIK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISkeletonPose
的用法示例。
在下文中一共展示了ISkeletonPose::SetLookIK方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateLook
void CLookAim_Helper::UpdateLook(CPlayer* pPlayer, ICharacterInstance* pCharacter, bool bEnabled, f32 FOV, const Vec3& targetGlobal,const f32 *customBlends /*= NULL*/)
{
if (!m_initialized)
{
Init(pPlayer, pCharacter);
}
bool useLookAtComplex;
bool useLookAtSimple;
if (m_canUseLookAtComplex)
{
// for now just use the old 'complex' look at method until we sort out how to properly blend old and new look at
useLookAtComplex = true;
useLookAtSimple = false;
}
else
{
useLookAtComplex = true; // for backwards compatibility reasons we still update the old look-at even when m_canUseLookAtComplex is false
useLookAtSimple = m_canUseLookAtSimple;
}
// ---------------------------
// Complex (old style) Look-At
// ---------------------------
ISkeletonPose * pSkeletonPose = pCharacter->GetISkeletonPose();
pSkeletonPose->SetLookIK(useLookAtComplex && bEnabled, FOV, targetGlobal, customBlends);
// ---------------------------
// Simple Head-Only Look-At
// ---------------------------
if (m_canUseLookAtSimple)
{
float frameTime = gEnv->pTimer->GetFrameTime();
// Fade In/Out the Weight
m_lookAtWeight = bEnabled ? CLAMP(m_lookAtWeight + (frameTime * m_lookAtFadeInSpeed), 0.0f, 1.0f) : CLAMP(m_lookAtWeight - (frameTime * m_lookAtFadeOutSpeed), 0.0f, 1.0f);
// Blend To The Target
if (targetGlobal.IsValid())
{
m_lookAtTargetGlobal = targetGlobal;
}
SmoothCD(m_lookAtInterpolatedTargetGlobal, m_lookAtTargetRate, frameTime, m_lookAtTargetGlobal, m_lookAtTargetSmoothTime);
// Push the LookAtSimple PoseModifier
if (useLookAtSimple && (m_lookAtWeight > 0.0f))
{
m_lookAtSimple->SetTargetGlobal(m_lookAtInterpolatedTargetGlobal);
m_lookAtSimple->SetWeight(m_lookAtWeight);
pCharacter->GetISkeletonAnim()->PushLayer(cryinterface_cast<IAnimationPoseModifier>(m_lookAtSimple));
}
}
}