From af38843252d433ac68be28f223797c10b084c438 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Thu, 4 Nov 2010 21:37:30 +0000 Subject: [PATCH] Added support for scaled objects. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6395 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/tracks/track.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp index 33dd1aa42..9d9381126 100644 --- a/src/tracks/track.cpp +++ b/src/tracks/track.cpp @@ -361,8 +361,9 @@ void Track::createPhysicsModel(unsigned int main_track_count) */ void Track::convertTrackToBullet(scene::ISceneNode *node) { - const core::vector3df &pos = node->getPosition(); - const core::vector3df &hpr = node->getRotation(); + const core::vector3df &pos = node->getPosition(); + const core::vector3df &hpr = node->getRotation(); + const core::vector3df &scale = node->getScale(); scene::IMesh *mesh; // In case of readonly materials we have to get the material from @@ -397,6 +398,7 @@ void Track::convertTrackToBullet(scene::ISceneNode *node) core::matrix4 mat; mat.setRotationDegrees(hpr); mat.setTranslation(pos); + mat.setScale(scale); for(unsigned int i=0; igetMeshBufferCount(); i++) { scene::IMeshBuffer *mb = mesh->getMeshBuffer(i); // FIXME: take translation/rotation into account @@ -532,13 +534,16 @@ bool Track::loadMainTrack(const XMLNode &root) scene_node->setName(debug_name.c_str()); #endif - //core::vector3df xyz(0,0,0); - Vec3 xyz(0,0,0); + core::vector3df xyz(0,0,0); n->get("xyz", &xyz); + scene_node->setPosition(xyz); core::vector3df hpr(0,0,0); n->get("hpr", &hpr); - scene_node->setPosition(xyz.toIrrVector()); scene_node->setRotation(hpr); + core::vector3df scale(1.0f, 1.0f, 1.0f); + n->get("scale", &scale); + scene_node->setScale(scale); + handleAnimatedTextures(scene_node, *n); m_all_nodes.push_back(scene_node); } // for i