void ProcessRenderMessage_ChangePosition(ChangePositionRenderMessage msg)
        {
            RenderEntity render_entity = m_render_entity_manager.GetObject(msg.EntityID);

            if (render_entity == null)
            {
                return;
            }
            PredictLogicComponent predic_component = render_entity.GetComponent(PredictLogicComponent.ID) as PredictLogicComponent;

            if (predic_component != null)
            {
                if (msg.m_micro_adjusting && predic_component.HasMovementPredict)
                {
                    return;
                }
                else
                {
                    predic_component.ClearAllPrediction();
                }
            }
            ModelComponent model_component = render_entity.GetComponent <ModelComponent>();

            if (model_component == null)
            {
                return;
            }
            model_component.UpdatePosition();
        }
Exemplo n.º 2
0
        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
        }
Exemplo n.º 3
0
        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
        }