00001 //////////////////////////////////////////////////////////////////////////////// 00002 // Scorched3D (c) 2000-2009 00003 // 00004 // This file is part of Scorched3D. 00005 // 00006 // Scorched3D is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 2 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // Scorched3D is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with Scorched3D; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 //////////////////////////////////////////////////////////////////////////////// 00020 00021 #include <land/TargetVisibilityPatch.h> 00022 #include <client/ScorchedClient.h> 00023 #include <landscapemap/LandscapeMaps.h> 00024 #include <graph/OptionsDisplay.h> 00025 00026 std::set<void *> TargetVisibilityPatch::largeTargets_; 00027 00028 TargetVisibilityPatch::TargetVisibilityPatch() : 00029 visible_(false), distance_(0.0f) 00030 { 00031 } 00032 00033 TargetVisibilityPatch::~TargetVisibilityPatch() 00034 { 00035 } 00036 00037 void TargetVisibilityPatch::setLocation(int x, int y) 00038 { 00039 // Set location and neighbors 00040 x_ = x; y_ = y; 00041 float heightRange = 0.0f; 00042 float minHeight = 0.0f; 00043 position_ = Vector(float(x_ + 16), float(y_ + 16), 00044 heightRange / 2.0f + minHeight); 00045 } 00046 00047 bool TargetVisibilityPatch::setVisible(float distance) 00048 { 00049 //if (distance < OptionsDisplay::instance()->getDrawCullingDistance() + 100.0f) 00050 { 00051 distance_ = distance; 00052 visible_ = true; 00053 } 00054 //else 00055 { 00056 //visible_ = false; 00057 } 00058 return visible_; 00059 } 00060 00061 void TargetVisibilityPatch::setNotVisible() 00062 { 00063 visible_ = false; 00064 }
1.5.3