Improved support for karts without wheels (up to now Gnu had
invisible wheel models). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6026 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
286d12a5f2
commit
8c8d8de7f4
@ -74,6 +74,8 @@ void ModelViewWidget::clearModels()
|
||||
// -----------------------------------------------------------------------------
|
||||
void ModelViewWidget::addModel(irr::scene::IMesh* mesh, const Vec3& location, const int frame)
|
||||
{
|
||||
if(!mesh) return;
|
||||
|
||||
m_models.push_back(mesh);
|
||||
m_model_location.push_back(location);
|
||||
m_model_frames.push_back(frame);
|
||||
|
@ -203,6 +203,7 @@ void KartModel::attachModel(scene::ISceneNode **node)
|
||||
|
||||
for(unsigned int i=0; i<4; i++)
|
||||
{
|
||||
if(!m_wheel_model[i]) continue;
|
||||
m_wheel_node[i] = irr_driver->addMesh(m_wheel_model[i],
|
||||
*node);
|
||||
m_wheel_node[i]->grab();
|
||||
@ -433,14 +434,15 @@ void KartModel::update(float rotation, float visual_steer,
|
||||
|
||||
for(unsigned int i=0; i<4; i++)
|
||||
{
|
||||
if(!m_wheel_node[i]) continue;
|
||||
core::vector3df pos = m_wheel_graphics_position[i].toIrrVector();
|
||||
pos.Y += clamped_suspension[i];
|
||||
m_wheel_node[i]->setPosition(pos);
|
||||
}
|
||||
m_wheel_node[0]->setRotation(wheel_front);
|
||||
m_wheel_node[1]->setRotation(wheel_front);
|
||||
m_wheel_node[2]->setRotation(wheel_rear );
|
||||
m_wheel_node[3]->setRotation(wheel_rear );
|
||||
if(m_wheel_node[0]) m_wheel_node[0]->setRotation(wheel_front);
|
||||
if(m_wheel_node[1]) m_wheel_node[1]->setRotation(wheel_front);
|
||||
if(m_wheel_node[2]) m_wheel_node[2]->setRotation(wheel_rear );
|
||||
if(m_wheel_node[3]) m_wheel_node[3]->setRotation(wheel_rear );
|
||||
|
||||
// Check if the end animation is being played, if so, don't
|
||||
// play steering animation.
|
||||
|
Loading…
Reference in New Issue
Block a user