-
Notifications
You must be signed in to change notification settings - Fork 0
/
SceneParser.h
58 lines (49 loc) · 1.56 KB
/
SceneParser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* ┏┓ ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃ ┃
* ┃ ━ ┃ ++ + + +
* ████━████ ┃+
* ┃ ┃ +
* ┃ ┻ ┃
* ┃ ┃ + +
* ┗━┓ ┏━┛
* ┃ ┃
* ┃ ┃ + + + +
* ┃ ┃ Code is far away from bug with the animal protecting
* ┃ ┃ + 神兽保佑,代码无bug
* ┃ ┃
* ┃ ┃ +
* ┃ ┗━━━┓ + +
* ┃ ┣┓
* ┃ ┏┛
* ┗┓┓┏━┳┓┏┛ + + + +
* ┃┫┫ ┃┫┫
* ┗┻┛
*/
#pragma once
#include"JmxRConfig.h"
#include"Scene.h"
#include"tinyxml2.h"
#include"tiny_obj_loader.h"
#include<map>
#include<cstring>
namespace jmxRCore
{
struct ElementBuf
{
std::string elemName;
std::map<std::string, std::string> attri;
};
class SceneParser
{
public:
static Scene* loadSceneRtRough(const std::string& file);
private:
static ElementBuf readElement(tinyxml2::XMLElement* elem);
static void readMesh(tinyxml2::XMLElement* elem,Scene* sc);
static void readLight(tinyxml2::XMLElement* elem,Scene* sc);
static void readCamera(tinyxml2::XMLElement* elem,Scene* sc);
static Mat4x4 readTransform(tinyxml2::XMLElement* elem);
};
}