DeformLandscape.h

Go to the documentation of this file.
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 #if !defined(AFX_DEFORMCIRCULAR_H__7E191509_3CD0_4EA5_A6B2_7C96C081C1AD__INCLUDED_)
00022 #define AFX_DEFORMCIRCULAR_H__7E191509_3CD0_4EA5_A6B2_7C96C081C1AD__INCLUDED_
00023 
00024 class ScorchedContext;
00025 class ProgressCounter;
00026 
00027 #include <common/FixedVector.h>
00028 #include <vector>
00029 
00030 class DeformLandscape
00031 {
00032 public:
00033         struct DeformPoints
00034         {
00035                 fixed map[100][100];
00036         };
00037         enum DeformType
00038         {
00039                 eDeformLandscapeUp = 1,
00040                 eDeformLandscapeDown = 2,
00041                 eFlattenArea = 3,
00042         };
00043         struct DeformInfo
00044         {
00045                 int type;
00046                 FixedVector pos;
00047                 fixed radius;
00048         };
00049 
00050         static bool deformLandscape(
00051                 ScorchedContext &context,
00052                 FixedVector &pos, fixed radius, 
00053                 bool down, DeformPoints &map);
00054         static void flattenArea(
00055                 ScorchedContext &context, 
00056                 FixedVector &tankPos,
00057                 bool removeObjects = true,
00058                 fixed size = 2);
00059 
00060         static void clearInfos();
00061         static std::vector<DeformInfo> &getInfos() { return deformInfos_; }
00062         static void applyInfos(ScorchedContext &context, 
00063                 std::vector<DeformInfo> &infos,
00064                 ProgressCounter *counter = 0);
00065 
00066 private:
00067         static std::vector<DeformInfo> deformInfos_;
00068 
00069         static bool deformLandscapeInternal(
00070                 ScorchedContext &context,
00071                 FixedVector &pos, fixed radius, 
00072                 bool down, DeformPoints &map,
00073                 bool setNormals);
00074         static void flattenAreaInternal(
00075                 ScorchedContext &context, 
00076                 FixedVector &tankPos,
00077                 bool removeObjects,
00078                 fixed size,
00079                 bool setNormals);
00080 };
00081 
00082 #endif // !defined(AFX_DEFORMCIRCULAR_H__7E191509_3CD0_4EA5_A6B2_7C96C081C1AD__INCLUDED_)

Generated on Mon Feb 16 15:14:50 2009 for Scorched3D by  doxygen 1.5.3