2 * Copyright (C) 2005-2013 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef _TILEASSEMBLER_H_
20 #define _TILEASSEMBLER_H_
22 #include <G3D/Vector3.h>
23 #include <G3D/Matrix3.h>
26 #include "ModelInstance.h"
31 This Class is used to convert raw vector data into balanced BSP-Trees.
32 To start the conversion call convertWorld().
34 //===============================================
39 G3D::Matrix3 iRotation
;
46 iRotation
= G3D::Matrix3::fromEulerAnglesZYX(G3D::pi() * iDir
.y
/ 180.f
, G3D::pi() * iDir
.x
/ 180.f
, G3D::pi() * iDir
.z
/ 180.f
);
48 G3D::Vector3
transform(const G3D::Vector3
& pIn
) const;
49 void moveToBasePos(const G3D::Vector3
& pBasePos
) { iPos
-= pBasePos
; }
52 typedef std::map
<uint32
, ModelSpawn
> UniqueEntryMap
;
53 typedef std::multimap
<uint32
, uint32
> TileMap
;
57 UniqueEntryMap UniqueEntries
;
61 typedef std::map
<uint32
, MapSpawns
*> MapData
;
62 //===============================================
69 bool (*iFilterMethod
)(char* pName
);
70 G3D::Table
<std::string
, unsigned int > iUniqueNameIds
;
71 unsigned int iCurrentUniqueNameId
;
75 TileAssembler(const std::string
& pSrcDirName
, const std::string
& pDestDirName
);
76 virtual ~TileAssembler();
80 bool calculateTransformedBound(ModelSpawn
& spawn
);
82 bool convertRawFile(const std::string
& pModelFilename
);
83 void setModelNameFilterMethod(bool (*pFilterMethod
)(char* pName
)) { iFilterMethod
= pFilterMethod
; }
84 std::string
getDirEntryNameFromModName(unsigned int pMapId
, const std::string
& pModPosName
);
85 unsigned int getUniqueNameId(const std::string pName
);
89 #endif /*_TILEASSEMBLER_H_*/