1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-10 09:47:46 +00:00
This commit is contained in:
AriAvery 2019-02-01 11:24:17 +01:00
parent 415be38845
commit fa3226bc00
2 changed files with 3 additions and 3 deletions

View file

@ -60,10 +60,10 @@ std::string Sapphire::Entity::Chara::getName() const
return std::string( m_name );
}
bool Sapphire::Entity::Chara::isFacing( Entity::CharaPtr target )
bool Sapphire::Entity::Chara::isFacing( Entity::CharaPtr target, float arcDegree )
{
auto angleBetween = Util::RelativeAngle( getRot(), getPos().x, getPos().y, target->getPos().x, target->getPos().y );
return angleBetween >= ( -( 180.0f / 2 ) && angleBetween <= ( 180.0f / 2 ) );
return angleBetween >= ( -( arcDegree / 2 ) && angleBetween <= ( arcDegree / 2 ) );
}
/*! \return current stance of the actors */

View file

@ -160,7 +160,7 @@ namespace Sapphire::Entity
std::string getName() const;
bool isFacing( Entity::CharaPtr target );
bool isFacing( Entity::CharaPtr target, float arcDegree = 100 );
bool face( const Common::FFXIVARR_POSITION3& p );