Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
TileAssembler.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef _TILEASSEMBLER_H_
7#define _TILEASSEMBLER_H_
8
9#include <G3D/Vector3.h>
10#include <G3D/Matrix3.h>
11#include <map>
12#include <set>
13
14#include "ModelInstance.h"
15#include "WorldModel.h"
16
17namespace VMAP
18{
23 //===============================================
24
26 {
27 private:
28 G3D::Matrix3 iRotation;
29 public:
30 ModelPosition(): iScale(0.0f) { }
31 G3D::Vector3 iPos;
32 G3D::Vector3 iDir;
33 float iScale;
34 void init()
35 {
36 iRotation = G3D::Matrix3::fromEulerAnglesZYX(G3D::pi()*iDir.y/180.f, G3D::pi()*iDir.x/180.f, G3D::pi()*iDir.z/180.f);
37 }
38 G3D::Vector3 transform(const G3D::Vector3& pIn) const;
39 void moveToBasePos(const G3D::Vector3& pBasePos) { iPos -= pBasePos; }
40 };
41
42 typedef std::map<uint32, ModelSpawn> UniqueEntryMap;
43 typedef std::multimap<uint32, uint32> TileMap;
44
50
51 typedef std::map<uint32, MapSpawns*> MapData;
52 //===============================================
53
55 {
58
59 G3D::AABox bounds;
61 std::vector<MeshTriangle> triangles;
62 std::vector<G3D::Vector3> vertexArray;
64
68
69 bool Read(FILE* f);
70 };
71
73 {
75 std::vector<GroupModel_Raw> groupsArray;
76
77 bool Read(const char * path);
78 };
79
81 {
82 private:
83 std::string iDestDir;
84 std::string iSrcDir;
85 bool (*iFilterMethod)(char *pName);
86 G3D::Table<std::string, unsigned int > iUniqueNameIds;
89 std::set<std::string> spawnedModelFiles;
90
91 public:
92 TileAssembler(const std::string& pSrcDirName, const std::string& pDestDirName);
93 virtual ~TileAssembler();
94
95 bool convertWorld2();
96 bool readMapSpawns();
99
100 bool convertRawFile(const std::string& pModelFilename);
101 void setModelNameFilterMethod(bool (*pFilterMethod)(char *pName)) { iFilterMethod = pFilterMethod; }
102 std::string getDirEntryNameFromModName(unsigned int pMapId, const std::string& pModPosName);
103 };
104
105} // VMAP
106#endif /*_TILEASSEMBLER_H_*/
std::uint32_t uint32
Definition Define.h:77
void moveToBasePos(const G3D::Vector3 &pBasePos)
G3D::Vector3 transform(const G3D::Vector3 &pIn) const
G3D::Matrix3 iRotation
unsigned int iCurrentUniqueNameId
G3D::Table< std::string, unsigned int > iUniqueNameIds
bool convertRawFile(const std::string &pModelFilename)
TileAssembler(const std::string &pSrcDirName, const std::string &pDestDirName)
std::set< std::string > spawnedModelFiles
bool calculateTransformedBound(ModelSpawn &spawn)
std::string getDirEntryNameFromModName(unsigned int pMapId, const std::string &pModPosName)
bool(* iFilterMethod)(char *pName)
void setModelNameFilterMethod(bool(*pFilterMethod)(char *pName))
std::map< uint32, MapSpawns * > MapData
std::map< uint32, ModelSpawn > UniqueEntryMap
std::multimap< uint32, uint32 > TileMap
class WmoLiquid * liquid
std::vector< G3D::Vector3 > vertexArray
std::vector< MeshTriangle > triangles
UniqueEntryMap UniqueEntries
bool Read(const char *path)
std::vector< GroupModel_Raw > groupsArray