mirror of
https://github.com/mangosfour/server.git
synced 2025-12-31 22:37:05 +00:00
[10052] Camera System
(based on SilverIce's repo commit 4f2f4ab + next 3 more) Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
f520c9b1e0
commit
e427ce80cc
27 changed files with 515 additions and 207 deletions
|
|
@ -31,11 +31,9 @@
|
|||
template<class T>
|
||||
inline void MaNGOS::VisibleNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
WorldObject const* viewPoint = i_player.GetViewPoint();
|
||||
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_player.UpdateVisibilityOf(viewPoint,iter->getSource(), i_data, i_visibleNow);
|
||||
i_camera.UpdateVisibilityOf(iter->getSource(), i_data, i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
}
|
||||
}
|
||||
|
|
@ -96,7 +94,7 @@ inline void MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
|||
if (!i_player.isAlive() || i_player.isInFlight())
|
||||
return;
|
||||
|
||||
WorldObject const* viewPoint = i_player.GetViewPoint();
|
||||
WorldObject const* viewPoint = i_player.GetCamera().GetBody();
|
||||
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if (iter->getSource()->isAlive())
|
||||
|
|
@ -106,13 +104,13 @@ inline void MaNGOS::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
|||
template<>
|
||||
inline void MaNGOS::CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
if(!i_creature.isAlive())
|
||||
if (!i_creature.isAlive())
|
||||
return;
|
||||
|
||||
for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
if (Player* player = iter->getSource())
|
||||
if (player->isAlive() && !player->isInFlight())
|
||||
PlayerCreatureRelocationWorker(player, player->GetViewPoint(), &i_creature);
|
||||
PlayerCreatureRelocationWorker(player, player->GetCamera().GetBody(), &i_creature);
|
||||
}
|
||||
|
||||
template<>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue