model_lightindicator.cc
Go to the documentation of this file.
00001 #include "stage.hh"
00002 
00003 using namespace Stg;
00004 
00005 ModelLightIndicator::ModelLightIndicator( World* world, 
00006                                                                                                                 Model* parent,
00007                                                                                                                 const std::string& type ) : 
00008   Model( world, parent, type ),
00009   m_IsOn(false)
00010 {
00011 }
00012 
00013 
00014 ModelLightIndicator::~ModelLightIndicator()
00015 {
00016 }
00017 
00018 
00019 void ModelLightIndicator::SetState(bool isOn)
00020 {
00021         m_IsOn = isOn;
00022 }
00023 
00024 
00025 void ModelLightIndicator::DrawBlocks()
00026 {
00027         if(m_IsOn)
00028         {
00029                 Model::DrawBlocks();
00030         }
00031         else
00032           {
00033                 const double scaleFactor = 0.8;
00034                 
00035                 Color keep = this->GetColor();
00036                 Color c = this->GetColor();
00037                 c.r *= scaleFactor;
00038                 c.g *= scaleFactor;
00039                 c.b *= scaleFactor;
00040                 
00041                 this->SetColor( c );
00042                 Model::DrawBlocks();
00043                 
00044                 this->SetColor( keep );
00045           }
00046 }


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Thu Aug 27 2015 15:20:57