Fixed kart wheels sinking into the podiums in GP win screen. Also tried to fix characters looking left but that didn't quite work out

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6234 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2010-10-10 15:12:40 +00:00
parent f7762c3fa2
commit b424856d6c

View File

@ -22,6 +22,7 @@ using namespace irr::core;
using namespace irr::gui;
using namespace irr::video;
const float KARTS_DELTA_Y = 0.03f;
const float INITIAL_Y = -3.0f;
const float INITIAL_PODIUM_Y = -3.6f;
const float PODIUM_HEIGHT[3] = { 0.325f, 0.5f, 0.15f };
@ -306,12 +307,12 @@ void GrandPrixWin::onUpdate(float dt, irr::video::IVideoDriver* driver)
if (m_kart_node[k] != NULL)
{
const float y_target = INITIAL_Y + PODIUM_HEIGHT[k];
if (m_kart_y[k] < y_target)
if (m_kart_y[k] < y_target + KARTS_DELTA_Y)
{
m_kart_y[k] += dt*(PODIUM_HEIGHT[k]);
m_kart_node[k]->setPosition( core::vector3df(m_kart_x[k], m_kart_y[k], m_kart_z[k]) );
m_kart_node[k]->setPosition( core::vector3df(m_kart_x[k], m_kart_y[k], m_kart_z[k]) );
m_podium_step[k]->setPosition( core::vector3df(m_podium_x[k],
INITIAL_PODIUM_Y - (INITIAL_Y - m_kart_y[k]),
INITIAL_PODIUM_Y - (INITIAL_Y - m_kart_y[k]) - KARTS_DELTA_Y,
m_podium_z[k]) );
}
@ -411,7 +412,7 @@ void GrandPrixWin::setKarts(const std::string idents_arg[3])
assert(kart_model != NULL);
m_kart_x[n] = m_podium_x[n];
m_kart_y[n] = INITIAL_Y;
m_kart_y[n] = INITIAL_Y + KARTS_DELTA_Y;
m_kart_z[n] = -4;
m_kart_rotation[n] = 0.0f;
@ -421,6 +422,7 @@ void GrandPrixWin::setKarts(const std::string idents_arg[3])
m_kart_z[n]) );
kart_main_node->setScale( core::vector3df(0.4f, 0.4f, 0.4f) );
kart_model->setAnimation(KartModel::AF_DEFAULT);
kart_model->update(0.0f, 0.0f, (float[]){0.0f, 0.0f, 0.0f, 0.0f});
}
else
{