Esempio n. 1
0
void
Entity::ScriptMoveToEntity( Entity* entity )
{
    m_State = Entity::WALKMESH;

    m_MovePosition = entity->GetPosition();
    m_MoveEntity = entity;
    m_MoveStopDistance = GetSolidRadius() + entity->GetSolidRadius();
    LOG_TRIVIAL( "[SCRIPT] Entity \"" + m_Name + "\" set move to entity \"" + entity->GetName() + "\"." );
}
Esempio n. 2
0
void
Entity::Update()
{
    if(m_MoveEntity != nullptr)
    {
        m_MovePosition = m_MoveEntity->GetPosition();
        m_MoveStopDistance = GetSolidRadius() + m_MoveEntity->GetSolidRadius();
    }

    if(m_TurnEntity != nullptr)
    {
        Ogre::Degree angle = GetDirectionToEntity(m_TurnEntity);
        angle = CalculateTurnAngle(m_TurnDirectionStart, angle);
        m_TurnDirectionEnd = angle;
    }
}