//-----------------------------------------------------------------------------
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
Ejemplo n.º 2
0
 /** Returns the width of the kart. */
 float          getKartWidth    () const {return m_kart_model->getWidth(); }
Ejemplo n.º 3
0
 /** Returns the height of the kart. */
 float          getKartHeight   () const {return m_kart_model->getHeight();}
Ejemplo n.º 4
0
 /** Returns the length of the kart. */
 float          getKartLength   () const {return m_kart_model->getLength();}
Ejemplo n.º 5
0
 /** Sets the name of a mesh to be used for this kart.
  *  \param hat_name Name of the mesh.
  */
 void setHatMeshName(const std::string &hat_name)
 {
     m_kart_model->setHatMeshName(hat_name);
 }   // setHatMeshName
Ejemplo n.º 6
0
 /** Returns a pointer to the KartModel object. */
 KartModel*    getKartModelCopy   () const
                                         {return m_kart_model->makeCopy(); }
Ejemplo n.º 7
0
 // ------------------------------------------------------------------------
 bool           isWheeless() const {return m_kart_model->getWheelModel(0)==NULL;}