mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[12027] Add some VMap LoS checking functions to Map scope
This commit is contained in:
parent
0e0a765312
commit
ea30899db4
6 changed files with 28 additions and 19 deletions
|
|
@ -1935,3 +1935,22 @@ void Map::PlayDirectSoundToMap(uint32 soundId, uint32 zoneId /*=0*/)
|
|||
if (!zoneId || itr->getSource()->GetZoneId() == zoneId)
|
||||
itr->getSource()->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to check if a point is in line of sight from an other point
|
||||
*/
|
||||
bool Map::IsInLineOfSight(float srcX, float srcY, float srcZ, float destX, float destY, float destZ)
|
||||
{
|
||||
VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
return vMapManager->isInLineOfSight(GetId(), srcX, srcY, srcZ, destX, destY, destZ);
|
||||
}
|
||||
|
||||
/**
|
||||
* get the hit position and return true if we hit something
|
||||
* otherwise the result pos will be the dest pos
|
||||
*/
|
||||
bool Map::GetObjectHitPos(float srcX, float srcY, float srcZ, float destX, float destY, float destZ, float& resX, float &resY, float& resZ, float pModifyDist)
|
||||
{
|
||||
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
return vMapManager->getObjectHitPos(GetId(), srcX, srcY, srcZ, destX, destY, destZ, resX, resY, resZ, pModifyDist);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue