-
Notifications
You must be signed in to change notification settings - Fork 9
/
SceneCellGroup.cpp
82 lines (64 loc) · 1.86 KB
/
SceneCellGroup.cpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include "Scene.h"
#include "SceneCell.h"
#include "SceneCellGroup.h"
#include "cdcSceneCookdata.h"
namespace cdc {
static CellGroupDataHeader s_globalGroupHeader = {
.numTotalCells = 1,
.numToplevelCells = 1,
.numBSPNodes = 0,
.numSymbols = 1
};
static CellGroupDataHeader s_exteriorGroupHeader = {
.numTotalCells = 1,
.numToplevelCells = 1,
.numBSPNodes = 0,
.numSymbols = 1
};
static const char *s_ppGlobalTable[1] = {"__global"};
static const char *s_ppExteriorTable[1] = {"__exterior"};
static CellGroupData s_globalGroupData = {
.header = &s_globalGroupHeader,
.symbols = s_ppGlobalTable,
};
static CellGroupData s_exteriorGroupData = {
.header = &s_exteriorGroupHeader,
.symbols = s_ppExteriorTable,
};
SceneCellGroup::SceneCellGroup(Scene *scene, SpecialType type) :
SceneCellContainer(scene, this),
scene1C(scene)
{
static const char *pNames[2] = {
"Global Cellgroup",
"Exterior Cellgroup"
};
static CellGroupData *pData[2] = {
&s_globalGroupData,
&s_exteriorGroupData
};
name = pNames[int(type)];
cellGroupData = pData[int(type)];
}
// SceneCellGroup::SceneCellGroup(Scene*, CellGroupData*) {
// // TODO
// }
void SceneCellGroup::allocateCells() {
cells.resize(cellGroupData->header->numTotalCells);
for (auto& cellPtr : cells) {
cellPtr = new SceneCell(this);
}
}
IScene *SceneCellGroup::getScene() { return scene1C; }
uint32_t SceneCellGroup::getCellCount() { return cells.size(); }
ISceneCell *SceneCellGroup::cellByIndex(uint32_t index) { return cells[index]; }
ISceneCell *SceneCellGroup::queryPoint(float *point, bool useThisContainer) {
return SceneCellContainer::queryPoint(point, useThisContainer);
}
float *SceneCellGroup::getOrigin() { return origin; }
void SceneCellGroup::setUserData(void *) {
// TODO
}
void SceneCellGroup::setName(const char *newName) { name = newName; }
const char *SceneCellGroup::getName() { return name; }
}