From: <hik...@us...> - 2010-10-26 21:45:38
|
Revision: 6343 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6343&view=rev Author: hikerstk Date: 2010-10-26 21:45:32 +0000 (Tue, 26 Oct 2010) Log Message: ----------- Fixed (one) rotation bug: rotation for objects in the xml file are already degrees, they were converted to degrees again. Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2010-10-26 09:57:26 UTC (rev 6342) +++ main/trunk/src/tracks/track_object.cpp 2010-10-26 21:45:32 UTC (rev 6343) @@ -84,7 +84,9 @@ { } m_animated_node->setPosition(m_init_xyz.toIrrVector()); - m_animated_node->setRotation(m_init_hpr.toIrrHPR() ); + // Note that toIrrHPR converts radians to degrees. Since the value + // from the xml file is already in degrees, there is no need for that. + m_animated_node->setRotation(m_init_hpr.toIrrVector() ); m_animated_node->setMaterialFlag(video::EMF_LIGHTING, false); } // TrackObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-11-08 11:10:58
|
Revision: 6437 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=6437&view=rev Author: hikerstk Date: 2010-11-08 11:10:50 +0000 (Mon, 08 Nov 2010) Log Message: ----------- Added call to reset in constructor, which will actually start the animation loop. Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2010-11-08 11:07:14 UTC (rev 6436) +++ main/trunk/src/tracks/track_object.cpp 2010-11-08 11:10:50 UTC (rev 6437) @@ -89,6 +89,7 @@ m_animated_node->setRotation(m_init_hpr); m_animated_node->setScale(m_init_scale); m_animated_node->setMaterialFlag(video::EMF_LIGHTING, false); + reset(); } // TrackObject // ---------------------------------------------------------------------------- @@ -106,12 +107,11 @@ m_animated_node->setPosition(m_init_xyz); m_animated_node->setRotation(m_init_hpr); m_animated_node->setScale(m_init_scale); - m_animated_node->setLoopMode(false); + m_animated_node->setLoopMode(m_is_looped); if(m_is_looped) { m_animated_node->setFrameLoop(m_frame_start, m_frame_end); - m_animated_node->setLoopMode(true); } } // reset // ---------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-03-08 23:53:13
|
Revision: 7860 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=7860&view=rev Author: hikerstk Date: 2011-03-08 23:53:07 +0000 (Tue, 08 Mar 2011) Log Message: ----------- Removed warning messages printed to stderr if a track object is not in the track directory (but in the shared model directory). Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-03-08 05:49:42 UTC (rev 7859) +++ main/trunk/src/tracks/track_object.cpp 2011-03-08 23:53:07 UTC (rev 7860) @@ -57,7 +57,11 @@ else { std::string full_path = World::getWorld()->getTrack()->getTrackFile(model_name); - scene::IAnimatedMesh *mesh = irr_driver->getAnimatedMesh(full_path); + scene::IAnimatedMesh *mesh=NULL; + if(file_manager->fileExists(full_path)) + { + scene::IAnimatedMesh *mesh = irr_driver->getAnimatedMesh(full_path); + } if(!mesh) { // If the model isn't found in the track directory, look This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-05-23 23:55:56
|
Revision: 8686 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8686&view=rev Author: auria Date: 2011-05-23 23:55:50 +0000 (Mon, 23 May 2011) Log Message: ----------- Fixed rare shutdown crash Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-05-23 21:12:03 UTC (rev 8685) +++ main/trunk/src/tracks/track_object.cpp 2011-05-23 23:55:50 UTC (rev 8686) @@ -105,9 +105,9 @@ { if(m_node) irr_driver->removeNode(m_node); - irr_driver->dropAllTextures(m_mesh); if(m_mesh) { + irr_driver->dropAllTextures(m_mesh); m_mesh->drop(); if(m_mesh->getReferenceCount()==1) irr_driver->removeMeshFromCache(m_mesh); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-08-07 01:23:14
|
Revision: 9439 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9439&view=rev Author: auria Date: 2011-08-07 01:23:07 +0000 (Sun, 07 Aug 2011) Log Message: ----------- Disable sound emitters in multiplayer mode as OpenAL supports a single listener so we make sounds non-positional in multiplayer and the result is bad for sound emitters that are meant to be localized Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-08-07 00:22:17 UTC (rev 9438) +++ main/trunk/src/tracks/track_object.cpp 2011-08-07 01:23:07 UTC (rev 9439) @@ -55,7 +55,9 @@ std::string sound; xml_node.get("sound", &sound ); - if (sound.size() > 0) + // FIXME: at this time sound emitters are just disabled in multiplayer otherwise + // the sounds would be constantly heard + if (sound.size() > 0 && race_manager->getNumLocalPlayers() == 1) { float rolloff = 0.5; xml_node.get("rolloff", &rolloff ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2011-09-15 12:42:33
|
Revision: 9848 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9848&view=rev Author: hikerstk Date: 2011-09-15 12:42:23 +0000 (Thu, 15 Sep 2011) Log Message: ----------- Minor cosmetic changes. Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-09-15 02:10:49 UTC (rev 9847) +++ main/trunk/src/tracks/track_object.cpp 2011-09-15 12:42:23 UTC (rev 9848) @@ -55,8 +55,8 @@ std::string sound; xml_node.get("sound", &sound ); - // FIXME: at this time sound emitters are just disabled in multiplayer otherwise - // the sounds would be constantly heard + // FIXME: at this time sound emitters are just disabled in multiplayer + // otherwise the sounds would be constantly heard if (sound.size() > 0 && race_manager->getNumLocalPlayers() == 1) { float rolloff = 0.5; @@ -79,11 +79,13 @@ } else { - fprintf(stderr, "[TrackObject] Sound emitter object could not be created\n"); + fprintf(stderr, + "[TrackObject] Sound emitter object could not be created\n"); } } - // Some animated objects (billboards, sound emitters) don't use this scene node + // Some animated objects (billboards, sound emitters) + // don't use this scene node if (model_name == "") { m_node = NULL; @@ -91,7 +93,8 @@ } else { - std::string full_path = World::getWorld()->getTrack()->getTrackFile(model_name); + std::string full_path = + World::getWorld()->getTrack()->getTrackFile(model_name); if(file_manager->fileExists(full_path)) { m_mesh = irr_driver->getAnimatedMesh(full_path); @@ -104,7 +107,8 @@ m_mesh = irr_driver->getAnimatedMesh(full_path); if(!m_mesh) { - fprintf(stderr, "Warning: '%s' in '%s' not found and is ignored.\n", + fprintf(stderr, + "Warning: '%s' in '%s' not found and is ignored.\n", xml_node.getName().c_str(), model_name.c_str()); return; } // if(!m_mesh) @@ -112,7 +116,8 @@ m_mesh->grab(); irr_driver->grabAllTextures(m_mesh); - scene::IAnimatedMeshSceneNode *node=irr_driver->addAnimatedMesh(m_mesh); + scene::IAnimatedMeshSceneNode *node = + irr_driver->addAnimatedMesh(m_mesh); m_node = node; #ifdef DEBUG std::string debug_name = model_name+" (track-object)"; @@ -187,7 +192,9 @@ } // TrackObject // ---------------------------------------------------------------------------- - +/** Destructor. Removes the node from the scene graph, and also + * drops the textures of the mesh. Sound buffers are also freed. + */ TrackObject::~TrackObject() { if(m_node) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-10-26 15:28:06
|
Revision: 10045 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10045&view=rev Author: auria Date: 2011-10-26 15:27:56 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Attempt to fix desctructor of TrackObject + fix issue with texture retention Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-10-26 15:18:46 UTC (rev 10044) +++ main/trunk/src/tracks/track_object.cpp 2011-10-26 15:27:56 UTC (rev 10045) @@ -164,6 +164,7 @@ { m_mesh = model; m_mesh->grab(); + irr_driver->grabAllTextures(m_mesh); scene::IMeshSceneNode *node = irr_driver->addMesh(model); m_node = node; @@ -195,9 +196,9 @@ if(m_mesh) { irr_driver->dropAllTextures(m_mesh); - m_mesh->drop(); if(m_mesh->getReferenceCount()==1) irr_driver->removeMeshFromCache(m_mesh); + m_mesh->drop(); } if (m_sound) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-10-26 15:39:08
|
Revision: 10047 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10047&view=rev Author: auria Date: 2011-10-26 15:39:01 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Remove silly part of my previous commit Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-10-26 15:36:31 UTC (rev 10046) +++ main/trunk/src/tracks/track_object.cpp 2011-10-26 15:39:01 UTC (rev 10047) @@ -203,8 +203,6 @@ irr_driver->dropAllTextures(m_mesh); - if (!is_in_cache && m_mesh->getReferenceCount() == 1) - irr_driver->removeMeshFromCache(m_mesh); m_mesh->drop(); if (is_in_cache && m_mesh->getReferenceCount() == 1) irr_driver->removeMeshFromCache(m_mesh); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-02-13 23:32:21
|
Revision: 10841 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10841&view=rev Author: auria Date: 2012-02-13 23:32:15 +0000 (Mon, 13 Feb 2012) Log Message: ----------- Fix another unitialized variable Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2012-02-13 23:23:10 UTC (rev 10840) +++ main/trunk/src/tracks/track_object.cpp 2012-02-13 23:32:15 UTC (rev 10841) @@ -46,6 +46,7 @@ m_is_looped = false; m_sound = NULL; m_mesh = NULL; + m_node = NULL; xml_node.get("xyz", &m_init_xyz ); xml_node.get("hpr", &m_init_hpr ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2012-07-04 01:38:39
|
Revision: 11364 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11364&view=rev Author: hikerstk Date: 2012-07-04 01:38:32 +0000 (Wed, 04 Jul 2012) Log Message: ----------- Fixed compiler warnings. Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2012-07-03 01:02:35 UTC (rev 11363) +++ main/trunk/src/tracks/track_object.cpp 2012-07-04 01:38:32 UTC (rev 11364) @@ -214,8 +214,8 @@ else { m_node = irr_driver->addMesh(m_mesh); - m_frame_start = 0.0f; - m_frame_end = 0.0f; + m_frame_start = 0; + m_frame_end = 0; } #ifdef DEBUG std::string debug_name = model_name+" (track-object)"; @@ -288,8 +288,8 @@ else { m_node = irr_driver->addMesh(m_mesh); - m_frame_start = 0.0f; - m_frame_end = 0.0f; + m_frame_start = 0; + m_frame_end = 0; } #ifdef DEBUG This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2012-09-30 12:16:07
|
Revision: 11636 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11636&view=rev Author: hikerstk Date: 2012-09-30 12:16:01 +0000 (Sun, 30 Sep 2012) Log Message: ----------- Fixed compiler warning. Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2012-09-29 22:46:29 UTC (rev 11635) +++ main/trunk/src/tracks/track_object.cpp 2012-09-30 12:16:01 UTC (rev 11636) @@ -405,7 +405,7 @@ a_node->setRotation(m_init_hpr); a_node->setScale(m_init_scale); a_node->setLoopMode(m_is_looped); - a_node->setCurrentFrame(a_node->getStartFrame()); + a_node->setCurrentFrame((float)(a_node->getStartFrame())); // trick to reset the animation AND also the timer inside it a_node->OnAnimate(0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2013-04-06 00:29:53
|
Revision: 12617 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12617&view=rev Author: auria Date: 2013-04-06 00:29:45 +0000 (Sat, 06 Apr 2013) Log Message: ----------- Allow LOD nodes to have a physical body Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2013-04-06 00:21:57 UTC (rev 12616) +++ main/trunk/src/tracks/track_object.cpp 2013-04-06 00:29:45 UTC (rev 12617) @@ -108,13 +108,8 @@ m_type = type; - if (lod_node != NULL) + if (xml_node.getName() == "particle-emitter") { - m_type = "lod"; - m_presentation = new TrackObjectPresentationLOD(xml_node, lod_node); - } - else if (xml_node.getName() == "particle-emitter") - { m_type = "particle-emitter"; m_presentation = new TrackObjectPresentationParticles(xml_node); } @@ -139,11 +134,16 @@ } else { - TrackObjectPresentationMesh* mesh_presentation = - new TrackObjectPresentationMesh(xml_node, m_enabled); + if (lod_node != NULL) + { + m_type = "lod"; + m_presentation = new TrackObjectPresentationLOD(xml_node, lod_node); + } + else + { + m_presentation = new TrackObjectPresentationMesh(xml_node, m_enabled); + } - m_presentation = mesh_presentation; - if (m_interaction != "ghost" && m_interaction != "none") { m_rigid_body = PhysicalObject::fromXML(type == "movable", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-10-26 15:36:37
|
Revision: 10046 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10046&view=rev Author: auria Date: 2011-10-26 15:36:31 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Attempt to work with irrlicht mesh cache stuff Modified Paths: -------------- main/trunk/src/tracks/track_object.cpp Modified: main/trunk/src/tracks/track_object.cpp =================================================================== --- main/trunk/src/tracks/track_object.cpp 2011-10-26 15:27:56 UTC (rev 10045) +++ main/trunk/src/tracks/track_object.cpp 2011-10-26 15:36:31 UTC (rev 10046) @@ -29,6 +29,8 @@ #include "tracks/track.hpp" #include <IMeshSceneNode.h> +#include <IMeshCache.h> +#include <ISceneManager.h> /** A track object: any additional object on the track. This object implements * a graphics-only representation, i.e. there is no physical representation. @@ -190,15 +192,22 @@ * drops the textures of the mesh. Sound buffers are also freed. */ TrackObject::~TrackObject() -{ +{ if(m_node) irr_driver->removeNode(m_node); + if(m_mesh) { + scene::IMeshCache* cache = irr_driver->getSceneManager()->getMeshCache(); + bool is_in_cache = (cache->getMeshIndex(m_mesh) != -1); + irr_driver->dropAllTextures(m_mesh); - if(m_mesh->getReferenceCount()==1) + + if (!is_in_cache && m_mesh->getReferenceCount() == 1) irr_driver->removeMeshFromCache(m_mesh); m_mesh->drop(); + if (is_in_cache && m_mesh->getReferenceCount() == 1) + irr_driver->removeMeshFromCache(m_mesh); } if (m_sound) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |