API
This commit is contained in:
parent
2b36fb7c39
commit
a1e2d0209f
2 changed files with 7 additions and 5 deletions
|
@ -191,7 +191,7 @@ struct NavigationSceneImpl LUMIX_FINAL : public NavigationScene
|
|||
addCrowdAgent(iter.value());
|
||||
if (!agent.is_finished)
|
||||
{
|
||||
navigate(entity, target_pos, speed, agent.stop_distance);
|
||||
navigate({entity.index}, target_pos, speed, agent.stop_distance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1028,8 +1028,9 @@ struct NavigationSceneImpl LUMIX_FINAL : public NavigationScene
|
|||
}
|
||||
|
||||
|
||||
void cancelNavigation(Entity entity) override
|
||||
void cancelNavigation(ComponentHandle cmp) override
|
||||
{
|
||||
Entity entity = {cmp.index};
|
||||
auto iter = m_agents.find(entity);
|
||||
if (iter == m_agents.end()) return;
|
||||
|
||||
|
@ -1056,8 +1057,9 @@ struct NavigationSceneImpl LUMIX_FINAL : public NavigationScene
|
|||
}
|
||||
|
||||
|
||||
bool navigate(Entity entity, const Vec3& dest, float speed, float stop_distance) override
|
||||
bool navigate(ComponentHandle cmp, const Vec3& dest, float speed, float stop_distance) override
|
||||
{
|
||||
Entity entity = {cmp.index};
|
||||
if (!m_navquery) return false;
|
||||
if (!m_crowd) return false;
|
||||
if (entity == INVALID_ENTITY) return false;
|
||||
|
|
|
@ -17,8 +17,8 @@ class NavigationScene : public IScene
|
|||
{
|
||||
public:
|
||||
virtual bool isFinished(Entity entity) = 0;
|
||||
virtual bool navigate(Entity entity, const struct Vec3& dest, float speed, float stop_distance) = 0;
|
||||
virtual void cancelNavigation(Entity entity) = 0;
|
||||
virtual bool navigate(ComponentHandle cmp, const struct Vec3& dest, float speed, float stop_distance) = 0;
|
||||
virtual void cancelNavigation(ComponentHandle cmp) = 0;
|
||||
virtual void setActorActive(Entity entity, bool active) = 0;
|
||||
virtual float getAgentSpeed(Entity entity) = 0;
|
||||
virtual float getAgentYawDiff(Entity entity) = 0;
|
||||
|
|
Loading…
Reference in a new issue