-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scene.h
69 lines (60 loc) · 1.81 KB
/
Scene.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// Scene.h
// RealtimeRending
//
// Created by Philipp Lensing on 06.11.14.
// Copyright (c) 2014 Philipp Lensing. All rights reserved.
//
#ifndef __RealtimeRending__Scene__
#define __RealtimeRending__Scene__
#include <iostream>
#include "matrix.h"
#include <set>
#include <vector>
#include <map>
#include "basemodel.h"
class Model;
class SceneNode
{
public:
SceneNode();
SceneNode( const std::string& Name, const Vector& Translation, const Vector& RotationAxis, const float RotationAngle, const Vector& Scale, SceneNode* pParent, Model* pModel);
//getter
const Matrix& getLocalTransform() const;
Matrix getGlobalTransform() const;
const SceneNode* getParent() const;
const Model* getModel() const;
const std::string& getName() const;
const Vector& getScaling() const;
//setter
void setLocalTransform( const Vector& Translation, const Vector& RotationAxis, const float RotationAngle );
void setLocalTransform( const Matrix& LocalTransform);
void setParent( SceneNode* pNode);
const std::set<SceneNode*>& getChildren() const;
void addChild(SceneNode* pChild);
void removeChild(SceneNode* pChild);
void setModel( Model* pModel);
void setName( const std::string& Name);
void setScaling( const Vector& Scaling);
void draw(const BaseCamera& Cam);
protected:
std::string m_Name;
Model* m_pModel;
SceneNode* m_pParent;
std::set<SceneNode*> m_Children;
Matrix m_LocalTransform;
Vector m_Scaling;
};
class Scene : public BaseModel
{
public:
Scene();
virtual ~Scene();
bool addSceneFile( const char* Scenefile);
virtual void draw(const BaseCamera& Cam);
protected:
void draw( SceneNode* pNode);
SceneNode m_Root;
std::map<std::string, Model*> m_Models;
};
#endif /* defined(__RealtimeRending__Scene__) */