From: <hik...@us...> - 2009-12-17 00:22:47
|
Revision: 4308 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4308&view=rev Author: hikerstk Date: 2009-12-17 00:22:29 +0000 (Thu, 17 Dec 2009) Log Message: ----------- 1) Added support for ignoring materials 2) Replaced tabs with spaces. 3) Removed unnecessary function parameter for loadTrackInfo. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2009-12-16 23:03:17 UTC (rev 4307) +++ main/trunk/src/tracks/track.cpp 2009-12-17 00:22:29 UTC (rev 4308) @@ -74,9 +74,9 @@ m_has_final_camera = false; m_is_arena = false; m_quad_graph = NULL; - m_animation_manager = NULL; - m_check_manager = NULL; - loadTrackInfo(m_filename); + m_animation_manager = NULL; + m_check_manager = NULL; + loadTrackInfo(); } // Track //----------------------------------------------------------------------------- @@ -84,7 +84,7 @@ Track::~Track() { if(m_quad_graph) delete m_quad_graph; - if(m_check_manager) delete m_check_manager; + if(m_check_manager) delete m_check_manager; if(m_mini_map) irr_driver->removeTexture(m_mini_map); } // ~Track @@ -96,8 +96,8 @@ void Track::reset() { m_ambient_color = m_default_ambient_color; - if(m_animation_manager) - m_animation_manager->reset(); + if(m_animation_manager) + m_animation_manager->reset(); if(m_check_manager) m_check_manager->reset(*this); item_manager->reset(); @@ -181,7 +181,7 @@ } // getStartTransform //----------------------------------------------------------------------------- -void Track::loadTrackInfo(const std::string &filename) +void Track::loadTrackInfo() { // Default values m_use_fog = false; @@ -199,7 +199,7 @@ if(!root || root->getName()!="track") { std::ostringstream o; - o<<"Can't load track '"<<filename<<"', no track element."; + o<<"Can't load track '"<<m_filename<<"', no track element."; throw std::runtime_error(o.str()); } std::string temp_name; @@ -238,10 +238,10 @@ if(m_groups.size()==0) m_groups.push_back("standard"); const XMLNode *xml_node = root->getNode("curves"); - if(xml_node) - loadCurves(*xml_node); + if(xml_node) + loadCurves(*xml_node); - // Set the correct paths + // Set the correct paths m_screenshot = m_root+"/"+m_screenshot; delete root; @@ -250,11 +250,11 @@ //----------------------------------------------------------------------------- void Track::loadCurves(const XMLNode &node) { - for(unsigned int i=0; i<node.getNumNodes(); i++) - { - const XMLNode *curve = node.getNode(i); - m_all_curves.push_back(new BezierCurve(*curve)); - } // for i<node.getNumNodes + for(unsigned int i=0; i<node.getNumNodes(); i++) + { + const XMLNode *curve = node.getNode(i); + m_all_curves.push_back(new BezierCurve(*curve)); + } // for i<node.getNumNodes } // loadCurves //----------------------------------------------------------------------------- @@ -375,7 +375,12 @@ if(t) { std::string image = std::string(t->getName().c_str()); material=material_manager->getMaterial(StringUtils::getBasename(image)); + // Zipper are converted to non-collision mesh, since otherwise + // the road becomes 'bumpy' if the meshes are not 100% correctly + // aligned. if(material->isZipper()) tmesh = m_non_collision_mesh; + // Materials to be ignored are not converted into bullet meshes. + if(material->isIgnore()) continue; } u16 *mbIndices = mb->getIndices(); @@ -528,10 +533,10 @@ { m_physical_objects[i]->update(dt); } - if(m_animation_manager) - m_animation_manager->update(dt); - if(m_check_manager) - m_check_manager->update(dt); + if(m_animation_manager) + m_animation_manager->update(dt); + if(m_check_manager) + m_check_manager->update(dt); item_manager->update(dt); } // update @@ -711,14 +716,14 @@ node->get("h", &h); m_start_heading.push_back(h); } - else if(name=="animations") - { - m_animation_manager = new AnimationManager(*this, *node); - } - else if(name=="checks") - { - m_check_manager = new CheckManager(*node, this); - } + else if(name=="animations") + { + m_animation_manager = new AnimationManager(*this, *node); + } + else if(name=="checks") + { + m_check_manager = new CheckManager(*node, this); + } else if(name=="sun") { node->get("xyz", &m_sun_position ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2009-12-30 19:41:06
|
Revision: 4374 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4374&view=rev Author: auria Date: 2009-12-30 19:40:59 +0000 (Wed, 30 Dec 2009) Log Message: ----------- Fixed Hikerian mistake Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2009-12-30 19:24:21 UTC (rev 4373) +++ main/trunk/src/tracks/track.cpp 2009-12-30 19:40:59 UTC (rev 4374) @@ -140,8 +140,6 @@ } delete m_track_object_manager; - - delete m_track_object_manager; m_track_object_manager = NULL; irr_driver->removeNode(m_sun); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-01-29 02:50:33
|
Revision: 4558 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4558&view=rev Author: hikerstk Date: 2010-01-29 02:50:26 +0000 (Fri, 29 Jan 2010) Log Message: ----------- Replaced octree with normal mesh, which is actually faster. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-01-29 02:47:52 UTC (rev 4557) +++ main/trunk/src/tracks/track.cpp 2010-01-29 02:50:26 UTC (rev 4558) @@ -421,7 +421,8 @@ } m_all_meshes.push_back(mesh); - scene::ISceneNode *scene_node = irr_driver->addOctTree(mesh); + scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); + mesh->setHardwareMappingHint(scene::EHM_STATIC); core::vector3df xyz(0,0,0); track_node->getXYZ(&xyz); core::vector3df hpr(0,0,0); @@ -676,12 +677,13 @@ scene::IMesh *mesh = irr_driver->getAnimatedMesh(full_path); if(!mesh) { - fprintf(stderr, "Warning: Main track model '%s' in '%s' not found, aborting.\n", + fprintf(stderr, "Warning: model '%s' in '%s' not found, aborting.\n", node->getName().c_str(), model_name.c_str()); exit(-1); } + mesh->setHardwareMappingHint(scene::EHM_STATIC); m_all_meshes.push_back(mesh); - scene::ISceneNode *scene_node = irr_driver->addOctTree(mesh); + scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); core::vector3df xyz(0,0,0); node->getXYZ(&xyz); core::vector3df hpr(0,0,0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-02-10 12:01:50
|
Revision: 4677 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4677&view=rev Author: hikerstk Date: 2010-02-10 12:01:37 +0000 (Wed, 10 Feb 2010) Log Message: ----------- Removed test code. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-10 11:40:33 UTC (rev 4676) +++ main/trunk/src/tracks/track.cpp 2010-02-10 12:01:37 UTC (rev 4677) @@ -904,8 +904,8 @@ // Don't tilt the items, since otherwise the rotation will look odd, // i.e. the items will not rotate around the normal, but 'wobble' // around. - Vec3 normal(0.7071f, 0, 0.7071f); - //Vec3 normal(0, 0, 1); + //Vec3 normal(0.7071f, 0, 0.7071f); + Vec3 normal(0, 0, 1); item_manager->newItem(type, loc, normal); } // itemCommand This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-16 00:40:44
|
Revision: 4738 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4738&view=rev Author: auria Date: 2010-02-16 00:40:32 +0000 (Tue, 16 Feb 2010) Log Message: ----------- Removed unnecessary includes Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-16 00:33:41 UTC (rev 4737) +++ main/trunk/src/tracks/track.cpp 2010-02-16 00:40:32 UTC (rev 4738) @@ -39,8 +39,6 @@ #include "io/xml_node.hpp" #include "items/item.hpp" #include "items/item_manager.hpp" -#include "lisp/lisp.hpp" -#include "lisp/parser.hpp" #include "modes/world.hpp" #include "physics/physical_object.hpp" #include "physics/triangle_mesh.hpp" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-02-21 00:43:43
|
Revision: 4782 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4782&view=rev Author: hikerstk Date: 2010-02-21 00:43:36 +0000 (Sun, 21 Feb 2010) Log Message: ----------- Cosmetical change only. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-21 00:39:23 UTC (rev 4781) +++ main/trunk/src/tracks/track.cpp 2010-02-21 00:43:36 UTC (rev 4782) @@ -84,7 +84,7 @@ Track::~Track() { if(m_quad_graph) delete m_quad_graph; - if(m_check_manager) delete m_check_manager; + if(m_check_manager) delete m_check_manager; if(m_mini_map) irr_driver->removeTexture(m_mini_map); } // ~Track This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-24 01:52:06
|
Revision: 4817 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4817&view=rev Author: auria Date: 2010-02-24 01:52:00 +0000 (Wed, 24 Feb 2010) Log Message: ----------- Fixed losing lives in 3 strikes Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-24 01:24:48 UTC (rev 4816) +++ main/trunk/src/tracks/track.cpp 2010-02-24 01:52:00 UTC (rev 4817) @@ -214,7 +214,8 @@ root->get("gravity", &m_gravity); root->get("arena", &m_is_arena); root->get("groups", &m_groups); - for(unsigned int i=0; i<root->getNumNodes(); i++) + + for (unsigned int i=0; i<root->getNumNodes(); i++) { const XMLNode *mode=root->getNode(i); if(mode->getName()!="mode") continue; @@ -615,7 +616,7 @@ void Track::loadTrackModel(unsigned int mode_id) { m_has_final_camera = false; - m_is_arena = false; + //m_is_arena = false; m_track_object_manager = new TrackObjectManager(); // Load the graph only now: this function is called from world, after This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-24 23:52:03
|
Revision: 4834 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4834&view=rev Author: auria Date: 2010-02-24 23:51:56 +0000 (Wed, 24 Feb 2010) Log Message: ----------- Cosmetic fix : corrected confusing code indentation Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-24 23:46:36 UTC (rev 4833) +++ main/trunk/src/tracks/track.cpp 2010-02-24 23:51:56 UTC (rev 4834) @@ -226,20 +226,20 @@ mode->get("scene", &tm.m_scene ); m_all_modes.push_back(tm); } + // If no mode is specified, add a default mode. - if(m_all_modes.size()==0) + if (m_all_modes.size()==0) { TrackMode tm; m_all_modes.push_back(tm); } - if(m_groups.size()==0) - m_groups.push_back("standard"); + if (m_groups.size()==0) m_groups.push_back("standard"); + const XMLNode *xml_node = root->getNode("curves"); - if(xml_node) - loadCurves(*xml_node); + if (xml_node) loadCurves(*xml_node); - // Set the correct paths + // Set the correct paths m_screenshot = m_root+"/"+m_screenshot; delete root; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-25 00:08:10
|
Revision: 4835 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4835&view=rev Author: auria Date: 2010-02-25 00:08:02 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Some more cleanup to make code follow our guidelines Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-24 23:51:56 UTC (rev 4834) +++ main/trunk/src/tracks/track.cpp 2010-02-25 00:08:02 UTC (rev 4835) @@ -248,11 +248,11 @@ //----------------------------------------------------------------------------- void Track::loadCurves(const XMLNode &node) { - for(unsigned int i=0; i<node.getNumNodes(); i++) - { - const XMLNode *curve = node.getNode(i); - m_all_curves.push_back(new BezierCurve(*curve)); - } // for i<node.getNumNodes + for (unsigned int i=0; i<node.getNumNodes(); i++) + { + const XMLNode *curve = node.getNode(i); + m_all_curves.push_back(new BezierCurve(*curve)); + } // for i<node.getNumNodes } // loadCurves //----------------------------------------------------------------------------- @@ -357,10 +357,12 @@ core::matrix4 mat; mat.setRotationDegrees(hpr); mat.setTranslation(pos); - for(unsigned int i=0; i<mesh->getMeshBufferCount(); i++) { + for(unsigned int i=0; i<mesh->getMeshBufferCount(); i++) + { scene::IMeshBuffer *mb = mesh->getMeshBuffer(i); // FIXME: take translation/rotation into account - if(mb->getVertexType()!=video::EVT_STANDARD) { + if(mb->getVertexType()!=video::EVT_STANDARD) + { fprintf(stderr, "WARNING: Physics::convertTrack: Ignoring type '%d'!", mb->getVertexType()); continue; @@ -370,7 +372,8 @@ const Material* material=0; TriangleMesh *tmesh = m_track_mesh; - if(t) { + if(t) + { #if (IRRLICHT_VERSION_MAJOR == 1) && (IRRLICHT_VERSION_MINOR == 7) std::string image = std::string(core::stringc(t->getName()).c_str()); #else @@ -388,8 +391,10 @@ u16 *mbIndices = mb->getIndices(); Vec3 vertices[3]; irr::video::S3DVertex* mbVertices=(video::S3DVertex*)mb->getVertices(); - for(unsigned int j=0; j<mb->getIndexCount(); j+=3) { - for(unsigned int k=0; k<3; k++) { + for(unsigned int j=0; j<mb->getIndexCount(); j+=3) + { + for(unsigned int k=0; k<3; k++) + { int indx=mbIndices[j+k]; core::vector3df v = mbVertices[indx].Pos; mat.transformVect(v); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-25 21:10:36
|
Revision: 4846 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4846&view=rev Author: auria Date: 2010-02-25 21:10:28 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Reverted the (accidental) switch to an octtree, since this causes very brightly materials on Linux and Windows (WTF??) [and not on mac... WTF again...] Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-25 13:20:26 UTC (rev 4845) +++ main/trunk/src/tracks/track.cpp 2010-02-25 21:10:28 UTC (rev 4846) @@ -419,8 +419,8 @@ } m_all_meshes.push_back(mesh); - //scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); - scene::ISceneNode *scene_node = irr_driver->addOctTree(mesh); + scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); + //scene::ISceneNode *scene_node = irr_driver->addOctTree(mesh); mesh->setHardwareMappingHint(scene::EHM_STATIC); core::vector3df xyz(0,0,0); track_node->getXYZ(&xyz); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-02-25 21:39:16
|
Revision: 4849 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4849&view=rev Author: auria Date: 2010-02-25 21:39:09 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Committed back octree, since it is now obvious I was totally wrong thinking this caused the shininess... hum, should have looked at hiker's commit first *blush* Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-02-25 21:28:35 UTC (rev 4848) +++ main/trunk/src/tracks/track.cpp 2010-02-25 21:39:09 UTC (rev 4849) @@ -419,8 +419,8 @@ } m_all_meshes.push_back(mesh); - scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); - //scene::ISceneNode *scene_node = irr_driver->addOctTree(mesh); + //scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); + scene::ISceneNode *scene_node = irr_driver->addOctTree(mesh); mesh->setHardwareMappingHint(scene::EHM_STATIC); core::vector3df xyz(0,0,0); track_node->getXYZ(&xyz); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-03-24 10:25:14
|
Revision: 5054 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5054&view=rev Author: hikerstk Date: 2010-03-24 10:25:08 +0000 (Wed, 24 Mar 2010) Log Message: ----------- 1) Fixed fog - all track nodes are now with fog. 2) Some code cleanup. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-03-24 00:23:15 UTC (rev 5053) +++ main/trunk/src/tracks/track.cpp 2010-03-24 10:25:08 UTC (rev 5054) @@ -417,7 +417,7 @@ track_node->getName().c_str(), model_name.c_str()); exit(-1); } - + m_all_meshes.push_back(mesh); //scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); scene::ISceneNode *scene_node = irr_driver->addOctTree(mesh); @@ -471,7 +471,6 @@ // This will (at this stage) only convert the main track model. for(unsigned int i=0; i<m_all_meshes.size(); i++) - //for(unsigned int i=0; i<1; i++) { convertTrackToBullet(m_all_meshes[i], m_all_nodes[i]); } @@ -666,31 +665,6 @@ { createWater(*node); } - else if(name=="model") - { - std::string model_name; - node->get("model", &model_name); - std::string full_path = m_root+"/"+model_name; - scene::IMesh *mesh = irr_driver->getAnimatedMesh(full_path); - if(!mesh) - { - fprintf(stderr, "Warning: model '%s' in '%s' not found, aborting.\n", - node->getName().c_str(), model_name.c_str()); - exit(-1); - } - mesh->setHardwareMappingHint(scene::EHM_STATIC); - m_all_meshes.push_back(mesh); - scene::ISceneNode *scene_node = irr_driver->addMesh(mesh); - core::vector3df xyz(0,0,0); - node->getXYZ(&xyz); - core::vector3df hpr(0,0,0); - node->getHPR(&hpr); - scene_node->setPosition(xyz); - scene_node->setRotation(hpr); - handleAnimatedTextures(scene_node, *node); - m_all_nodes.push_back(scene_node); - scene_node->setMaterialFlag(video::EMF_LIGHTING, true); - } else if(name=="banana" || name=="item" || name=="small-nitro" || name=="big-nitro") { @@ -800,7 +774,7 @@ m_sun_diffuse_color); m_sun->setLightType(video::ELT_DIRECTIONAL); m_sun->setRotation( core::vector3df(180, 45, 45) ); // TODO: make sun orientation configurable (calculate from m_sun_position) - + // We should NOT give the sun an ambient color, we already have a scene-wide ambient color. // No need for two ambient colors. //m_sun->getLightData().AmbientColor = m_sun_ambient_color; @@ -822,9 +796,13 @@ irr_driver->getVideoDriver()->setFog(m_fog_color, video::EFT_FOG_LINEAR, m_fog_start, m_fog_end, m_fog_density); } - // Note: the physics world for irrlicht is created in loadMainTrack createPhysicsModel(main_track_count); if (UserConfigParams::m_track_debug) m_quad_graph->createDebugMesh(); + + // Enable for for all track nodes if fog is used + if(m_use_fog) + for(unsigned int i=0; i<m_all_nodes.size(); i++) + m_all_nodes[i]->setMaterialFlag(video::EMF_FOG_ENABLE, true); } // loadTrackModel //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-03-24 23:19:45
|
Revision: 5062 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5062&view=rev Author: mbjornstk Date: 2010-03-24 23:19:39 +0000 (Wed, 24 Mar 2010) Log Message: ----------- Add note about fog params and change (commented out) ambient light to blueish. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-03-24 22:38:31 UTC (rev 5061) +++ main/trunk/src/tracks/track.cpp 2010-03-24 23:19:39 UTC (rev 5062) @@ -787,15 +787,17 @@ video::SLight light; // HACK & TEST: checking how ambient looks for some things, must be properly done once we reach an agreement light.AmbientColor = irr::video::SColorf(0.666666f, 0.666666f, 0.666666f, 0.0f); + light.AmbientColor = irr::video::SColorf(0.5f, 0.666666f, 0.75f, 0.0f); m_light->setLightData(light); */ // ---- Fog if (m_use_fog) { + /* NOTE: if LINEAR type, density does not matter, if EXP or EXP2, start and end do not matter */ irr_driver->getVideoDriver()->setFog(m_fog_color, video::EFT_FOG_LINEAR, m_fog_start, m_fog_end, m_fog_density); } - + createPhysicsModel(main_track_count); if (UserConfigParams::m_track_debug) m_quad_graph->createDebugMesh(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-04-13 01:36:57
|
Revision: 5191 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5191&view=rev Author: hikerstk Date: 2010-04-13 01:36:50 +0000 (Tue, 13 Apr 2010) Log Message: ----------- Fixed incorrect heading computation for start position (causing stadium not to work). Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-04-12 23:15:40 UTC (rev 5190) +++ main/trunk/src/tracks/track.cpp 2010-04-13 01:36:50 UTC (rev 5191) @@ -169,7 +169,7 @@ : Vec3( (pos%2==0)?1.5f:-1.5f, 1.0f, -1.5f*pos-1.5f); btTransform start; start.setOrigin(orig); - start.setRotation(btQuaternion(btVector3(0, 0, 1), + start.setRotation(btQuaternion(btVector3(0, 1, 0), pos<m_start_heading.size() ? DEGREE_TO_RAD*m_start_heading[pos] : 0.0f )); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-05-01 20:05:31
|
Revision: 5337 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5337&view=rev Author: auria Date: 2010-05-01 20:05:25 +0000 (Sat, 01 May 2010) Log Message: ----------- Minor : improved code that was indented very weirdly Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-05-01 19:46:45 UTC (rev 5336) +++ main/trunk/src/tracks/track.cpp 2010-05-01 20:05:25 UTC (rev 5337) @@ -231,13 +231,12 @@ m_all_modes.push_back(tm); } - if(m_groups.size()==0) - m_groups.push_back("standard"); + if(m_groups.size()==0) m_groups.push_back("standard"); const XMLNode *xml_node = root->getNode("curves"); - if(xml_node) - loadCurves(*xml_node); + + if(xml_node) loadCurves(*xml_node); - // Set the correct paths + // Set the correct paths m_screenshot = m_root+"/"+m_screenshot; delete root; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-05-02 00:19:32
|
Revision: 5340 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5340&view=rev Author: mbjornstk Date: 2010-05-02 00:19:22 +0000 (Sun, 02 May 2010) Log Message: ----------- Disable fog for overhead/debug camera. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-05-01 23:52:19 UTC (rev 5339) +++ main/trunk/src/tracks/track.cpp 2010-05-02 00:19:22 UTC (rev 5340) @@ -811,7 +811,7 @@ */ // ---- Fog - if (m_use_fog) + if (m_use_fog && !UserConfigParams::m_camera_debug) { /* NOTE: if LINEAR type, density does not matter, if EXP or EXP2, start and end do not matter */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-06-30 05:30:02
|
Revision: 5595 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5595&view=rev Author: hikerstk Date: 2010-06-30 05:29:56 +0000 (Wed, 30 Jun 2010) Log Message: ----------- Fixed uninitialised variable. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-06-30 05:23:37 UTC (rev 5594) +++ main/trunk/src/tracks/track.cpp 2010-06-30 05:29:56 UTC (rev 5595) @@ -705,7 +705,7 @@ */ void Track::loadTrackModel(World* parent, unsigned int mode_id) { - //m_is_arena = false; + m_sky_type = SKY_NONE; m_track_object_manager = new TrackObjectManager(); // Load the graph only now: this function is called from world, after This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-04 22:49:19
|
Revision: 5628 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5628&view=rev Author: hikerstk Date: 2010-07-04 22:49:13 +0000 (Sun, 04 Jul 2010) Log Message: ----------- Added missing variable initialisation. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-07-04 22:48:12 UTC (rev 5627) +++ main/trunk/src/tracks/track.cpp 2010-07-04 22:49:13 UTC (rev 5628) @@ -77,6 +77,7 @@ m_quad_graph = NULL; m_animation_manager = NULL; m_check_manager = NULL; + m_mini_map = NULL; m_start_angle = 0; m_sky_dx = 0.05f; m_sky_dy = 0.0f; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-07-05 23:02:15
|
Revision: 5650 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5650&view=rev Author: hikerstk Date: 2010-07-05 23:02:09 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Fixed minor memory leak (minor=data structure that is used till the end of the game is not freed, so memory usage does not increase over time). Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-07-05 23:00:41 UTC (rev 5649) +++ main/trunk/src/tracks/track.cpp 2010-07-05 23:02:09 UTC (rev 5650) @@ -92,6 +92,8 @@ if(m_quad_graph) delete m_quad_graph; if(m_check_manager) delete m_check_manager; if(m_mini_map) irr_driver->removeTexture(m_mini_map); + delete m_track_mesh; + delete m_non_collision_mesh; } // ~Track //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2010-08-27 15:41:31
|
Revision: 5792 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5792&view=rev Author: auria Date: 2010-08-27 15:41:24 +0000 (Fri, 27 Aug 2010) Log Message: ----------- Added support for ambient light track-wide (Joerg: am I duplicating something that already exists somewhere else?) Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-08-27 15:24:08 UTC (rev 5791) +++ main/trunk/src/tracks/track.cpp 2010-08-27 15:41:24 UTC (rev 5792) @@ -266,7 +266,9 @@ root->get("gravity", &m_gravity); root->get("arena", &m_is_arena); root->get("groups", &m_groups); - + root->get("ambient", &m_sun_diffuse_color); + root->get("ambient", &m_sun_specular_color); + root->get("ambient", &m_default_ambient_color); root->get("maxKartCount", &m_max_kart_count); for(unsigned int i=0; i<root->getNumNodes(); i++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-08-30 23:17:59
|
Revision: 5831 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5831&view=rev Author: hikerstk Date: 2010-08-30 23:17:52 +0000 (Mon, 30 Aug 2010) Log Message: ----------- Fixed white spaces in source code. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-08-30 22:38:50 UTC (rev 5830) +++ main/trunk/src/tracks/track.cpp 2010-08-30 23:17:52 UTC (rev 5831) @@ -303,11 +303,11 @@ //----------------------------------------------------------------------------- void Track::loadCurves(const XMLNode &node) { - for(unsigned int i=0; i<node.getNumNodes(); i++) - { - const XMLNode *curve = node.getNode(i); - m_all_curves.push_back(new BezierCurve(*curve)); - } // for i<node.getNumNodes + for(unsigned int i=0; i<node.getNumNodes(); i++) + { + const XMLNode *curve = node.getNode(i); + m_all_curves.push_back(new BezierCurve(*curve)); + } // for i<node.getNumNodes } // loadCurves //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-12 23:57:29
|
Revision: 5977 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5977&view=rev Author: hikerstk Date: 2010-09-12 23:57:23 +0000 (Sun, 12 Sep 2010) Log Message: ----------- Fixed incorrect start positions in tracks that don't have checklines defined (removed old, temporary global variable and replaced it with correct variable in class), added a warning message printed to stdout in case that checkline are missing. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-09-12 23:42:28 UTC (rev 5976) +++ main/trunk/src/tracks/track.cpp 2010-09-12 23:57:23 UTC (rev 5977) @@ -57,8 +57,6 @@ const float Track::NOHIT = -99999.9f; -btTransform global_start; - // ---------------------------------------------------------------------------- Track::Track(std::string filename) { @@ -189,8 +187,8 @@ end.X - start.X); core::vector2df mid = (start+end)*0.5f; btQuaternion q(Vec3(0, 1, 0), m_start_angle); - global_start.setRotation(q); - global_start.setOrigin(Vec3(mid.X, 0, mid.Y)); + m_start_transform.setRotation(q); + m_start_transform.setOrigin(Vec3(mid.X, 0, mid.Y)); } // setStartCoordinates //----------------------------------------------------------------------------- @@ -217,7 +215,7 @@ orig = Vec3( X_DIST * (pos%2==0) ? 1.0f : -1.0f, 1.0f, -Z_DIST*pos-Z_DIST_FROM_START); - orig = global_start(orig); + orig = m_start_transform(orig); angle = m_start_angle; } @@ -934,6 +932,13 @@ if(m_use_fog) for(unsigned int i=0; i<m_all_nodes.size(); i++) m_all_nodes[i]->setMaterialFlag(video::EMF_FOG_ENABLE, true); + + if(!m_check_manager) + { + printf("WARNING: no check lines found in track '%s'.\n", + m_ident.c_str()); + printf("Lap counting will not work, and start positions might be incorrect.\n"); + } } // loadTrackModel //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-18 07:31:04
|
Revision: 6039 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6039&view=rev Author: hikerstk Date: 2010-09-18 07:30:58 +0000 (Sat, 18 Sep 2010) Log Message: ----------- Fixed compilation problem (const vs no-const mismatch). Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-09-17 12:18:05 UTC (rev 6038) +++ main/trunk/src/tracks/track.cpp 2010-09-18 07:30:58 UTC (rev 6039) @@ -417,7 +417,7 @@ * \param mesh The mesh to convert. * \param node The scene node. */ -void Track::convertTrackToBullet(const scene::ISceneNode *node) +void Track::convertTrackToBullet(scene::ISceneNode *node) { const core::vector3df &pos = node->getPosition(); const core::vector3df &hpr = node->getRotation(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-18 10:08:20
|
Revision: 6040 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6040&view=rev Author: hikerstk Date: 2010-09-18 10:08:14 +0000 (Sat, 18 Sep 2010) Log Message: ----------- Fixed handling of material in track conversion (file was missing in r6037) --> animated water scene nodes will now trigger rescue. Also fixed getting the location for water scene nodes. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-09-18 07:30:58 UTC (rev 6039) +++ main/trunk/src/tracks/track.cpp 2010-09-18 10:08:14 UTC (rev 6040) @@ -421,16 +421,26 @@ { const core::vector3df &pos = node->getPosition(); const core::vector3df &hpr = node->getRotation(); + scene::IMesh *mesh; + // In case of readonly materials we have to get the material from + // the mesh, otherwise from the node. This is esp. important for + // water nodes, which only have the material defined in the node, + // but not in the mesh at all! + bool is_readonly_material=false; switch(node->getType()) { case scene::ESNT_MESH : case scene::ESNT_WATER_SURFACE : case scene::ESNT_OCTREE : mesh = ((scene::IMeshSceneNode*)node)->getMesh(); + is_readonly_material = + ((scene::IMeshSceneNode*)node)->isReadOnlyMaterials(); break; case scene::ESNT_ANIMATED_MESH : mesh = ((scene::IAnimatedMeshSceneNode*)node)->getMesh(); + is_readonly_material = + ((scene::IAnimatedMeshSceneNode*)node)->isReadOnlyMaterials(); break; case scene::ESNT_SKY_BOX : case scene::ESNT_SKY_DOME: @@ -453,7 +463,15 @@ mb->getVertexType()); continue; } - video::SMaterial &irrMaterial=mb->getMaterial(); + + // Handle readonly materials correctly: mb->getMaterial can return + // NULL if the node is not using readonly materials. E.g. in case + // of a water scene node, the mesh (which is the animated copy of + // the original mesh) does not contain any material information, + // the material is only available in the node. + const video::SMaterial &irrMaterial = + is_readonly_material ? mb->getMaterial() + : node->getMaterial(i); video::ITexture* t=irrMaterial.getTexture(0); const Material* material=0; @@ -708,10 +726,11 @@ } mesh->grab(); m_all_meshes.push_back(mesh); + core::vector3df xyz(0,0,0); - node.getXYZ(&xyz); + node.get("xyz", &xyz); core::vector3df hpr(0,0,0); - node.getHPR(&hpr); + node.get("hpr", &hpr); scene_node->setPosition(xyz); scene_node->setRotation(hpr); m_all_nodes.push_back(scene_node); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-10-14 11:26:29
|
Revision: 6286 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6286&view=rev Author: hikerstk Date: 2010-10-14 11:26:22 +0000 (Thu, 14 Oct 2010) Log Message: ----------- Made light position configurable, and automatically compute the direction of light to point to (0,0,0). ATM if no light position is specified, it will fall back to the previous default value of (180, 45, 45) as direction, but some tracks might need adjustment now. Modified Paths: -------------- main/trunk/src/tracks/track.cpp Modified: main/trunk/src/tracks/track.cpp =================================================================== --- main/trunk/src/tracks/track.cpp 2010-10-14 00:56:25 UTC (rev 6285) +++ main/trunk/src/tracks/track.cpp 2010-10-14 11:26:22 UTC (rev 6286) @@ -183,6 +183,7 @@ m_default_ambient_color = video::SColor(255, 120, 120, 120); m_sun_specular_color = video::SColor(255, 255, 255, 255); m_sun_diffuse_color = video::SColor(255, 255, 255, 255); + m_sun_position = core::vector3df(0, 0, 0); XMLNode *root = file_manager->createXMLTree(m_filename); if(!root || root->getName()!="track") @@ -881,27 +882,22 @@ irr_driver->getSceneManager()->setAmbientLight(m_ambient_color); // ---- Create sun (non-ambient directional light) - m_sun = irr_driver->getSceneManager()->addLightSceneNode(NULL, core::vector3df(0,0,0), - m_sun_diffuse_color); + m_sun = irr_driver->getSceneManager()->addLightSceneNode(NULL, + m_sun_position, + m_sun_diffuse_color); m_sun->setLightType(video::ELT_DIRECTIONAL); - m_sun->setRotation( core::vector3df(180, 45, 45) ); // TODO: make sun orientation configurable (calculate from m_sun_position) - // We should NOT give the sun an ambient color, we already have a scene-wide ambient color. - // No need for two ambient colors. - //m_sun->getLightData().AmbientColor = m_sun_ambient_color; - - //m_sun->getLightData().DiffuseColor = m_sun_diffuse_color; + // The angle of the light is rather important - let the sun + // point towards (0,0,0). + if(m_sun_position.getLengthSQ()==0) + // Backward compatibility: if no sun is specified, use the + // old hardcoded default angle + m_sun->setRotation( core::vector3df(180, 45, 45) ); + else + m_sun->setRotation((-m_sun_position).getHorizontalAngle()); + m_sun->getLightData().SpecularColor = m_sun_specular_color; - /* - m_light = irr_driver->getSceneManager()->addLightSceneNode(0, m_sun_position); - video::SLight light; - // HACK & TEST: checking how ambient looks for some things, must be properly done once we reach an agreement - light.AmbientColor = irr::video::SColorf(0.666666f, 0.666666f, 0.666666f, 0.0f); - light.AmbientColor = irr::video::SColorf(0.5f, 0.666666f, 0.75f, 0.0f); - m_light->setLightData(light); - */ - // ---- Fog if (m_use_fog && !UserConfigParams::m_camera_debug) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |