-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScene.cpp
More file actions
48 lines (28 loc) · 876 Bytes
/
Copy pathScene.cpp
File metadata and controls
48 lines (28 loc) · 876 Bytes
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
#include "Scene.h"
Scene::Scene(){
}
Scene::~Scene(){
modelMap.clear();
}
void Scene::ClearScene(){
/// TODO: do I need to delete
modelMap.clear();
}
void Scene::AddModel(std::string nameID, std::wstring fn, int tex, int vs, int ps){
modelMap.insert(std::make_pair(nameID, new Model()));
modelMap[nameID]->AssignResources(tex, vs, ps);
modelMap[nameID]->LoadMesh(fn);
}
void Scene::DrawScene(){
for (auto const& i : modelMap) i.second->Draw();
}
void Scene::DrawModelAt(std::string model_ID, XMFLOAT3 locationToDrawAt){
this->modelMap[model_ID]->DrawAt(locationToDrawAt);
}
void Scene::UpdateScene(){
for (auto const& i : modelMap) i.second->Update();
}
Model* Scene::GetModel(std::string model_ID){
if (modelMap.find(model_ID) == modelMap.end()) Error(L"Model does not exisit in scene", L"TODO: need to convert");
return modelMap[model_ID];
}