// NeL - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . #include "nel/misc/types_nl.h" #include "nel/misc/time_nl.h" #include "nel/misc/config_file.h" #include "nel/misc/debug.h" #include "nel/misc/path.h" #include "nel/misc/common.h" #include "nel/misc/displayer.h" #include "nel/misc/file.h" #include "nel/misc/matrix.h" #include "nel/misc/aabbox.h" #include "nel/3d/register_3d.h" #include "nel/3d/scene_group.h" #include "nel/3d/transform_shape.h" #include "nel/3d/water_model.h" #include "nel/3d/water_shape.h" #include #include #include #include #include using namespace std; using namespace NLMISC; using namespace NL3D; #ifndef NL_BIB_CFG #define NL_BIB_CFG "." #endif // NL_BIB_CFG string Output; string IGPath; vector IGs; class CIGBox { public: CIGBox() {} CIGBox(const string &name, const CAABBox &bbox) : Name(name), BBox(bbox) {} string Name; CAABBox BBox; void serial(NLMISC::IStream &f) { f.serial(Name, BBox); } }; vector Boxes; set NonWaterShapes; // int getInt(CConfigFile &cf, const string &varName) { CConfigFile::CVar &var = cf.getVar(varName); return var.asInt(); } string getString(CConfigFile &cf, const string &varName) { CConfigFile::CVar &var = cf.getVar(varName); return var.asString(); } void init() { registerSerial3d(); try { #ifdef NL_OS_UNIX NLMISC::CPath::addSearchPath(NLMISC::CPath::getApplicationDirectory("NeL")); #endif // NL_OS_UNIX NLMISC::CPath::addSearchPath(NL_BIB_CFG); CConfigFile cf; uint i; cf.load("build_ig_boxes.cfg"); Output = getString(cf, "Output"); // nlinfo("Output=%s", Output.c_str()); CConfigFile::CVar &cvIGs = cf.getVar("IGs"); for (i=0; iaddNegativeFilter("adding the path"); createDebug(); CFileDisplayer fd(getLogDirectory() + "evallog.log", true); try { // Init init(); uint i, j, k; for (i=0; i(shape.getShapePointer()); if (wshape == NULL) { NonWaterShapes.insert(shapeName); continue; } CMatrix matrix; ig.getInstanceMatrix(j, matrix); CPolygon wpoly; wshape->getShapeInWorldSpace(wpoly); for (k=0; k