本文整理汇总了C++中Position::GetAngle方法的典型用法代码示例。如果您正苦于以下问题:C++ Position::GetAngle方法的具体用法?C++ Position::GetAngle怎么用?C++ Position::GetAngle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Position
的用法示例。
在下文中一共展示了Position::GetAngle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsSummonedBy
void IsSummonedBy(Unit* owner) override
{
if (owner->GetTypeId() != TYPEID_UNIT)
return;
Position pos;
if (MarrowgarAI* marrowgarAI = CAST_AI(MarrowgarAI, owner->GetAI()))
pos.Relocate(marrowgarAI->GetLastColdflamePosition());
else
pos.Relocate(owner);
if (owner->HasAura(SPELL_BONE_STORM))
{
float ang = Position::NormalizeOrientation(pos.GetAngle(me));
me->SetOrientation(ang);
owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 5.0f - owner->GetObjectSize(), ang);
}
else
{
Player* target = ObjectAccessor::GetPlayer(*owner, owner->GetAI()->GetGUID(DATA_COLDFLAME_GUID));
if (!target)
{
me->DespawnOrUnsummon();
return;
}
float ang = Position::NormalizeOrientation(pos.GetAngle(target));
me->SetOrientation(ang);
owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 15.0f - owner->GetObjectSize(), ang);
}
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), me->GetPositionZ(), me->GetOrientation());
DoCast(SPELL_COLDFLAME_SUMMON);
_events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 500);
}