本文整理汇总了C++中CAI_Stalker::weapon_shot_effector方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI_Stalker::weapon_shot_effector方法的具体用法?C++ CAI_Stalker::weapon_shot_effector怎么用?C++ CAI_Stalker::weapon_shot_effector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI_Stalker
的用法示例。
在下文中一共展示了CAI_Stalker::weapon_shot_effector方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEMPLATE_SPECIALIZATION
void _detail::callback (CBoneInstance *B)
{
CAI_Stalker* A = static_cast<CAI_Stalker*>(B->Callback_Param);
VERIFY (_valid(B->mTransform));
Fvector c = B->mTransform.c;
Fmatrix spin;
float yaw_factor = 0, pitch_factor = 0;
if (A->sight().use_torso_look()) {
yaw_factor = yaw_factor_fire/100.f;
pitch_factor = pitch_factor_fire/100.f;
}
else {
yaw_factor = yaw_factor_non_fire/100.f;
pitch_factor = pitch_factor_non_fire/100.f;
}
float effector_yaw = 0.f, effector_pitch = 0.f;
if (A->weapon_shot_effector().IsActive()) {
Fvector temp;
A->weapon_shot_effector().GetDeltaAngle(temp);
effector_yaw = temp.y;
VERIFY (_valid(effector_yaw));
effector_pitch = temp.x;
VERIFY (_valid(effector_pitch));
}
VERIFY (_valid(A->movement().head_orientation().current.yaw));
VERIFY (_valid(A->movement().body_orientation().current.yaw));
VERIFY (_valid(A->NET_Last.o_torso.pitch));
float yaw = angle_normalize_signed(-yaw_factor * angle_normalize_signed(A->movement().head_orientation().current.yaw + effector_yaw - (A->movement().body_orientation().current.yaw)));
float pitch = angle_normalize_signed(-pitch_factor * angle_normalize_signed(A->NET_Last.o_torso.pitch + effector_pitch));
VERIFY (_valid(yaw));
VERIFY (_valid(pitch));
spin.setXYZ (pitch, yaw, 0);
VERIFY (_valid(spin));
B->mTransform.mulA_43 (spin);
B->mTransform.c = c;
}