本文整理汇总了C++中CCustomMonster::movement方法的典型用法代码示例。如果您正苦于以下问题:C++ CCustomMonster::movement方法的具体用法?C++ CCustomMonster::movement怎么用?C++ CCustomMonster::movement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCustomMonster
的用法示例。
在下文中一共展示了CCustomMonster::movement方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: is_body_turning
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 (!fis_zero(angle_difference(monster->movement().body_orientation().target.yaw, monster->movement().body_orientation().current.yaw)));
else
return (!fis_zero(angle_difference(stalker->movement().head_orientation().target.yaw, stalker->movement().head_orientation().current.yaw)) || !fis_zero(angle_difference(monster->movement().body_orientation().target.yaw, monster->movement().body_orientation().current.yaw)));
}
示例2:
u32 CScriptGameObject::location_on_path (float distance, Fvector *location)
{
if (!location) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : location_on_path -> specify destination location!");
return (u32(-1));
}
CCustomMonster *monster = smart_cast<CCustomMonster*>(&object());
if (!monster) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member location_on_path!");
return (u32(-1));
}
VERIFY (location);
return (monster->movement().detail().location_on_path(monster,distance,*location));
}
示例3:
void CScriptGameObject::remove_restrictions (LPCSTR out, LPCSTR in)
{
CCustomMonster *monster = smart_cast<CCustomMonster*>(&object());
if (!monster) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CRestrictedObject : cannot access class member remove_restrictions!");
return;
}
// xr_vector<ALife::_OBJECT_ID> temp0;
// xr_vector<ALife::_OBJECT_ID> temp1;
// construct_restriction_vector (out,temp0);
// construct_restriction_vector (in,temp1);
monster->movement().restrictions().remove_restrictions(out,in);
}