-
Notifications
You must be signed in to change notification settings - Fork 0
/
shapes.h
39 lines (28 loc) · 983 Bytes
/
shapes.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
#pragma once
#include <utility>
#include "glstuff.h"
#include "xml.h"
#include "position.h"
class Scene;
class Camera;
class WorldClock;
typedef std::pair<float, float> FloatPair;
class Shape
{
public:
const std::string m_name;
Position* const m_position;
Shape(const std::string& name, Position* position) :
m_name(name), m_position(position)
{}
// This function should update members, excluding m_position
// (this is done by the Scene), that are not camera-specific.
virtual void updateGeneral(const WorldClock& worldClock) = 0;
// This function should cache any View Space specific members.
virtual void updateForCamera(const Camera* camera) = 0;
// Used for sorting by closeness when drawing Systems - because
// closer transparent atmospheres need to be drawn after distant planets
virtual FloatPair getMinMaxDrawDist() const = 0;
virtual void draw(const Scene* scene, const Camera* camera) = 0;
static Shape* buildFromXMLNode(XMLNode& node);
};