本文整理汇总了C++中CAI_Stalker::movement方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI_Stalker::movement方法的具体用法?C++ CAI_Stalker::movement怎么用?C++ CAI_Stalker::movement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI_Stalker
的用法示例。
在下文中一共展示了CAI_Stalker::movement方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CScriptGameObject::set_desired_position (const Fvector *desired_position)
{
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object());
if (!stalker)
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member movement!");
else {
THROW2 (desired_position || stalker->movement().restrictions().accessible(*desired_position),*stalker->cName());
stalker->movement().set_desired_position (desired_position);
}
}
示例2:
bool CScriptGameObject::movement_target_reached ()
{
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object());
if (!stalker) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError, "CAI_Stalker : cannot access class member movement_target_reached!");
return (false);
}
return (stalker->movement().current_params().equal_to_target(stalker->movement().target_params()));
}
示例3:
bool CScriptGameObject::is_body_turning () const
{
CCustomMonster *monster = smart_cast<CCustomMonster*>(&object());
if (!monster) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member is_turning!");
return (false);
}
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(monster);
if (!stalker)
return (!fsimilar(monster->movement().body_orientation().target.yaw,monster->movement().body_orientation().current.yaw));
else
return (!fsimilar(stalker->movement().head_orientation().target.yaw,stalker->movement().head_orientation().current.yaw) || !fsimilar(monster->movement().body_orientation().target.yaw,monster->movement().body_orientation().current.yaw));
}
示例4: set_dest_level_vertex_id
void CScriptGameObject::set_dest_level_vertex_id(u32 level_vertex_id)
{
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object());
if (!stalker)
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member set_dest_level_vertex_id!");
else {
if (!ai().level_graph().valid_vertex_id(level_vertex_id)) {
#ifdef DEBUG
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : invalid vertex id being setup by action %s!",stalker->brain().CStalkerPlanner::current_action().m_action_name);
#endif
return;
}
THROW2 (stalker->movement().restrictions().accessible(level_vertex_id),*stalker->cName());
stalker->movement().set_level_dest_vertex (level_vertex_id);
}
}
示例5:
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;
}
示例6: GetPatrolPathName
LPCSTR CScriptGameObject::GetPatrolPathName()
{
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object());
if (!stalker) {
CScriptEntity *script_monster = smart_cast<CScriptEntity*>(&object());
if (!script_monster) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member GetPatrolPathName!");
return ("");
}
else
return (script_monster->GetPatrolPathName());
}
else
return (*stalker->movement().patrol().path_name());
}