00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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_)