//-----------------------------------------------------------------------------
void SoccerWorld::initKartList()
{
#ifndef SERVER_ONLY
    const unsigned int kart_amount = (unsigned int)m_karts.size();

    //Loading the indicator textures
    std::string red_path =
            file_manager->getAsset(FileManager::GUI, "soccer_player_red.png");
    std::string blue_path =
            file_manager->getAsset(FileManager::GUI, "soccer_player_blue.png");

    //Assigning indicators
    for(unsigned int i = 0; i < kart_amount; i++)
    {
        scene::ISceneNode *arrow_node = NULL;

        KartModel* km = m_karts[i]->getKartModel();
        // Color of karts can be changed using shaders if the model supports
        if (km->supportColorization() && CVS->isGLSL()) continue;

        float arrow_pos_height = km->getHeight() + 0.5f;
        SoccerTeam team = getKartTeam(i);

        arrow_node = irr_driver->addBillboard(
            core::dimension2d<irr::f32>(0.3f,0.3f),
            team == SOCCER_TEAM_BLUE ? blue_path : red_path,
            m_karts[i]->getNode());

        arrow_node->setPosition(core::vector3df(0, arrow_pos_height, 0));
    }
#endif
}   // initKartList
Beispiel #2
0
 /** Returns the height of the kart. */
 float          getKartHeight   () const {return m_kart_model->getHeight();}