00001 /* 00002 Enki - a fast 2D robot simulator 00003 Copyright (C) 1999-2005 Stephane Magnenat <stephane at magnenat dot net> 00004 Copyright (C) 2005 Laboratory of Intelligent Systems, EPFL, Lausanne 00005 See AUTHORS for details 00006 00007 This program is free software; the authors of any publication 00008 arising from research using this software are asked to add the 00009 following reference: 00010 Enki - a fast 2D robot simulator part of the Teem framework 00011 http://teem.epfl.ch 00012 Stephane Magnenat <stephane at magnenat dot net>, 00013 Markus Waibel <markus dot waibel at epfl dot ch> 00014 Laboratory of Intelligent Systems, EPFL, Lausanne. 00015 00016 You can redistribute this program and/or modify 00017 it under the terms of the GNU General Public License as published by 00018 the Free Software Foundation; either version 2 of the License, or 00019 (at your option) any later version. 00020 00021 This program is distributed in the hope that it will be useful, 00022 but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00024 GNU General Public License for more details. 00025 00026 You should have received a copy of the GNU General Public License 00027 along with this program; if not, write to the Free Software 00028 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00029 */ 00030 00031 #ifndef __SBOTCAM_H 00032 #define __SBOTCAM_H 00033 00034 #include <enki/Interaction.h> 00035 #include <enki/PhysicalEngine.h> 00036 #include <enki/interactions/CircularCam.h> 00037 00038 #include <valarray> 00039 00043 namespace Enki 00044 { 00045 class Sbot; 00046 00048 00049 class SbotCam : public LocalInteraction 00050 { 00051 public: 00053 std::valarray<double> zbuffer; 00055 std::valarray<An::Color> image; 00056 00057 protected: 00059 CircularCam cam0; 00061 CircularCam cam1; 00062 00063 public : 00065 SbotCam(Sbot *owner, unsigned halfPixelCount); 00067 virtual ~SbotCam(){} 00068 virtual void init(); 00069 virtual void objectStep (double dt, PhysicalObject *po, World *w); 00070 virtual void wallsStep(World *w); 00071 virtual void finalize(double dt); 00073 void setFogConditions(bool useFog, double density = 0.0, An::Color threshold = An::Color::black); 00075 void setRange(double range); 00077 void setPixelOperationFunctor(PixelOperationFunctor *pixelOperationFunctor); 00078 }; 00079 } 00080 #endif 00081