本文整理汇总了C++中ISkeletonPose::SetForceSkeletonUpdate方法的典型用法代码示例。如果您正苦于以下问题:C++ ISkeletonPose::SetForceSkeletonUpdate方法的具体用法?C++ ISkeletonPose::SetForceSkeletonUpdate怎么用?C++ ISkeletonPose::SetForceSkeletonUpdate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISkeletonPose
的用法示例。
在下文中一共展示了ISkeletonPose::SetForceSkeletonUpdate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Reset
//------------------------------------------------------------------------
void CVehiclePartAnimated::Reset()
{
CVehiclePartBase::Reset();
SetDrivingProxy(false);
if (m_slot > -1 && m_pCharInstance)
{
ISkeletonAnim* pSkeletonAnim = m_pCharInstance->GetISkeletonAnim();
CRY_ASSERT(pSkeletonAnim);
ISkeletonPose* pSkeletonPose = m_pCharInstance->GetISkeletonPose();
CRY_ASSERT(pSkeletonPose);
IDefaultSkeleton &rIDefaultSkeleton = m_pCharInstance->GetIDefaultSkeleton();
pSkeletonAnim->StopAnimationsAllLayers();
pSkeletonPose->SetDefaultPose();
pSkeletonPose->SetForceSkeletonUpdate(0);
for (int i = 0; i < rIDefaultSkeleton.GetJointCount(); ++i)
{
pSkeletonPose->SetMaterialOnJoint(i, NULL);
}
}
m_iRotChangedFrameId = 0;
}
示例2: Update
//------------------------------------------------------------------------
void CVehiclePartTread::Update(const float frameTime)
{
FUNCTION_PROFILER( GetISystem(), PROFILE_ACTION );
if (!m_pCharInstance)
return;
if (m_bForceSetU)
{
m_bForceSetU = false;
m_currentU = m_wantedU + 1.0f;
UpdateU();
}
ISkeletonPose* pSkeletonPose = m_pCharInstance->GetISkeletonPose();
pSkeletonPose->SetForceSkeletonUpdate(0);
if (VehicleCVars().v_staticTreadDeform == 0 && m_pVehicle->GetStatus().speed < 0.001f)
{
return;
}
if (frameTime > 0.f &&
(m_damageRatio >= 1.f || !m_pVehicle->GetGameObject()->IsProbablyVisible() || m_pVehicle->IsProbablyDistant()))
{
return;
}
// we need a tread update in next frame
pSkeletonPose->SetForceSkeletonUpdate(1);
m_pVehicle->NeedsUpdate();
// animate the UV texture according to the wheels speed
if (m_uvSpeedMultiplier != 0.0f && frameTime > 0.0f)
{
IPhysicalEntity* pPhysics = GetEntity()->GetPhysics();
pe_status_wheel wheelStatus;
wheelStatus.iWheel = m_lastWheelIndex;
if (pPhysics && pPhysics->GetStatus(&wheelStatus) != 0)
{
m_wantedU += m_uvSpeedMultiplier * (wheelStatus.w * wheelStatus.r * frameTime);
m_wantedU -= std::floor(m_wantedU);
UpdateU();
}
}
// deform the tread to follow the wheels
QuatT absRoot = pSkeletonPose->GetAbsJointByID(0);
for (TWheelInfoVector::const_iterator ite=m_wheels.begin(), end=m_wheels.end(); ite != end; ++ite)
{
const SWheelInfo& wheelInfo = *ite;
const Matrix34& slotTM = GetEntity()->GetSlotLocalTM(wheelInfo.slot, true);
VALIDATE_MAT(slotTM);
if (m_operatorQueue)
{
m_operatorQueue->PushPosition(wheelInfo.jointId,
IAnimationOperatorQueue::eOp_Override, slotTM.GetTranslation());
}
#if ENABLE_VEHICLE_DEBUG
if (VehicleCVars().v_debugdraw == 4)
{
Vec3 local = GetEntity()->GetWorldTM().GetInverted() * slotTM.GetTranslation();
gEnv->pRenderer->GetIRenderAuxGeom()->DrawSphere(GetEntity()->GetWorldTM() * (local+Vec3((float)sgn(local.x)*0.5f,0.f,0.f)),0.1f,ColorB(0,0,255,255));
}
#endif
}
ISkeletonAnim* pSkeletonAnim = m_pCharInstance->GetISkeletonAnim();
pSkeletonAnim->PushPoseModifier(VEH_ANIM_POSE_MODIFIER_LAYER, m_operatorQueue, "VehiclePartAnimatedJoint");
}