Revision: 2636 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2636&view=rev Author: ulteq Date: 2012-05-23 18:03:39 +0000 (Wed, 23 May 2012) Log Message: ----------- -Bugfix: added setBeamVisibility() - hides the own beams for the environment map camera
Modified Paths: -------------- trunk/source/main/gfx/envmap.cpp trunk/source/main/physics/Beam.cpp trunk/source/main/physics/Beam.h Modified: trunk/source/main/gfx/envmap.cpp =================================================================== --- trunk/source/main/gfx/envmap.cpp 2012-05-23 16:35:36 UTC (rev 2635) +++ trunk/source/main/gfx/envmap.cpp 2012-05-23 18:03:39 UTC (rev 2636) @@ -229,10 +229,17 @@ // but only if they are visible ... bool toggleMeshes = beam && beam->meshesVisible; + // same for all beams + bool toggleBeams = beam && beam->beamsVisible; + if (toggleMeshes) { beam->setMeshVisibility(false); } + if (toggleBeams) + { + beam->setBeamVisibility(false); + } for (int i=0; i < updateRate; i++) { @@ -257,6 +264,10 @@ { beam->setMeshVisibility(true); } + if (toggleBeams) + { + beam->setBeamVisibility(true); + } } void Envmap::init(Vector3 center) Modified: trunk/source/main/physics/Beam.cpp =================================================================== --- trunk/source/main/physics/Beam.cpp 2012-05-23 16:35:36 UTC (rev 2635) +++ trunk/source/main/physics/Beam.cpp 2012-05-23 18:03:39 UTC (rev 2636) @@ -87,6 +87,7 @@ , aileron(0) , avichatter_timer(11.0f) // some pseudo random number, doesn't matter , beacon(false) + , beamsVisible(true) , blinkingtype(BLINK_NONE) , blinktreshpassed(false) , brake(0.0) @@ -480,6 +481,9 @@ // hide all meshes, prevents deleting stuff while drawing this->setMeshVisibility(false); + // hide all beams, prevents deleting stuff while drawing + this->setBeamVisibility(false); + _waitForSync(); // delete all classes we might have constructed @@ -4540,6 +4544,25 @@ } } +void Beam::setBeamVisibility(bool visible, bool linked) +{ + int i=0; + for(i=0;i<free_beam;i++) + { + if(beams[i].mSceneNode) beams[i].mSceneNode->setVisible(visible); + } + beamsVisible = visible; + + if (linked) + { + // apply to the locked truck + std::list<Beam*> linkedBeams = getAllLinkedBeams(); + + for (std::list<Beam*>::iterator it = linkedBeams.begin(); it != linkedBeams.end(); ++it) + (*it)->setBeamVisibility(visible, false); + } +} + void Beam::setMeshVisibility(bool visible, bool linked) { int i=0; Modified: trunk/source/main/physics/Beam.h =================================================================== --- trunk/source/main/physics/Beam.h 2012-05-23 16:35:36 UTC (rev 2635) +++ trunk/source/main/physics/Beam.h 2012-05-23 18:03:39 UTC (rev 2636) @@ -321,6 +321,8 @@ bool abs_state; float abs_timer; + void setBeamVisibility(bool visible, bool linked=true); + bool beamsVisible; void setMeshVisibility(bool visible, bool linked=true); bool meshesVisible; bool inRange(float num, float min, float max); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Rigsofrods-devel mailing list Rigsofrods-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel