public void AdjustPosition2Walkable() { GridGraph graph = null; if (m_current_space != null) { graph = m_current_space.m_graph; } else { graph = GetLogicWorld().GetDefaultSceneSpace().m_graph; } if (graph == null) { return; } CurrentPosition = graph.AdjustPosition2Walkable(m_current_position); #if COMBAT_CLIENT ChangePositionRenderMessage msg = RenderMessage.Create <ChangePositionRenderMessage>(); msg.Construct(GetOwnerEntityID(), m_current_position, true); GetLogicWorld().AddRenderMessage(msg); #endif }
public void Teleport(SceneSpace space, Vector3FP new_position) { if (m_collision_sender) { if (space != m_current_space) { if (m_current_space != null) { m_current_space.m_paitition.RemoveEntity(this); } m_current_position = new_position; m_current_space = space; if (m_current_space != null) { m_current_space.m_paitition.AddEntiy(this); } } else { if (m_current_space != null) { m_current_space.m_paitition.UpdateEntity(this, new_position); } m_current_position = new_position; } } else { m_current_position = new_position; } #if COMBAT_CLIENT ChangePositionRenderMessage msg = RenderMessage.Create <ChangePositionRenderMessage>(); msg.Construct(GetOwnerEntityID(), new_position); GetLogicWorld().AddRenderMessage(msg); #endif }