-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scene.cpp
165 lines (105 loc) · 2.29 KB
/
Scene.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//
// Scene.cpp
// RealtimeRending
//
// Created by Philipp Lensing on 06.11.14.
// Copyright (c) 2014 Philipp Lensing. All rights reserved.
//
#include "Scene.h"
#include <string.h>
#include "model.h"
#include <assert.h>
SceneNode::SceneNode() : m_pParent(NULL), m_pModel(NULL), m_Scaling(1,1,1)
{
// TODO: Add your code
}
SceneNode::SceneNode( const std::string& Name, const Vector& Translation, const Vector& RotationAxis, const float RotationAngle, const Vector& Scale, SceneNode* pParent, Model* pModel)
{
setName(Name);
setLocalTransform( Translation, RotationAxis, RotationAngle);
setScaling( Scale);
setParent(pParent);
setModel(pModel);
}
const Matrix& SceneNode::getLocalTransform() const
{
return m_LocalTransform;
}
void SceneNode::setLocalTransform( const Vector& Translation, const Vector& RotationAxis, const float RotationAngle)
{
// TODO: Add your code
}
void SceneNode::setLocalTransform( const Matrix& LocalTransform)
{
m_LocalTransform = LocalTransform;
}
Matrix SceneNode::getGlobalTransform() const
{
// TODO: Add your code
return Matrix(); // dummy return
}
const SceneNode* SceneNode::getParent() const
{
return m_pParent;
}
void SceneNode::setParent( SceneNode* pNode)
{
// TODO: Add your code
}
const std::set<SceneNode*>& SceneNode::getChildren() const
{
return m_Children;
}
void SceneNode::addChild(SceneNode* pChild)
{
m_Children.insert(pChild);
}
void SceneNode::removeChild(SceneNode* pChild)
{
m_Children.erase(pChild);
}
void SceneNode::setModel( Model* pModel)
{
m_pModel = pModel;
}
const Model* SceneNode::getModel() const
{
return m_pModel;
}
void SceneNode::setName( const std::string& Name)
{
m_Name = Name;
}
const std::string& SceneNode::getName() const
{
return m_Name;
}
const Vector& SceneNode::getScaling() const
{
return m_Scaling;
}
void SceneNode::setScaling( const Vector& Scaling)
{
m_Scaling = Scaling;
}
void SceneNode::draw(const BaseCamera& Cam)
{
// TODO: Add your code
}
Scene::Scene()
{
// TODO: Add your code
}
Scene::~Scene()
{
// TODO: Add your code
}
bool Scene::addSceneFile( const char* Scenefile)
{
// TODO: Add your code
return true;
}
void Scene::draw( const BaseCamera& Cam)
{
// TODO: Add your code
}