Core/Collision: Replaced phasemask with proper phases in GameObject c…

…ollision calculation
This commit is contained in:
Aokromes committed 2017-05-06 01:55:17 +02:00
1 parent 27683014f2
commit 0fbcdca05e
29 files changed
+120 -152

No files matched your search

@@ -2223,15 +2223,6 @@ void GameObject::SetDisplayId(uint32 displayid)
UpdateModel();
}
bool GameObject::SetInPhase(uint32 id, bool update, bool apply)
{
bool res = WorldObject::SetInPhase(id, update, apply);
if (m_model && m_model->isEnabled())
EnableCollision(true);
return res;
}
void GameObject::EnableCollision(bool enable)
{
if (!m_model)
@@ -2240,7 +2231,7 @@ void GameObject::EnableCollision(bool enable)
/*if (enable && !GetMap()->ContainsGameObjectModel(*m_model))
GetMap()->InsertGameObjectModel(*m_model);*/
m_model->enable(enable ? GetPhaseMask() : 0);
m_model->enableCollision(enable);
}
void GameObject::UpdateModel()
@@ -2488,7 +2479,7 @@ public:
virtual bool IsSpawned() const override { return _owner->isSpawned(); }
virtual uint32 GetDisplayId() const override { return _owner->GetDisplayId(); }
virtual uint32 GetPhaseMask() const override { return _owner->GetPhaseMask(); }
virtual bool IsInPhase(std::set<uint32> const& phases) const override { return _owner->IsInPhase(phases); }
virtual G3D::Vector3 GetPosition() const override { return G3D::Vector3(_owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ()); }
virtual float GetOrientation() const override { return _owner->GetOrientation(); }
virtual float GetScale() const override { return _owner->GetObjectScale(); }