-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCameraNode.h
More file actions
52 lines (41 loc) · 1.04 KB
/
Copy pathCameraNode.h
File metadata and controls
52 lines (41 loc) · 1.04 KB
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
// Node in scene graph that makes sure camera is always looking at
// player.
//
// Author: Michael DiBernardo
//
// REFERENCES:
// None.
#ifndef __CAMERA_NODE_H__
#define __CAMERA_NODE_H__
#include "Basics.h"
#include "SceneNode.h"
#include "os.h"
#include <string>
using std::string;
class DinoNode;
class CameraNode : public SceneNode {
public:
// Construct a new camera node looking at the given dino.
CameraNode(const string& id, const DinoNode& target);
// Purge the subtree rooted at this node, including this node.
virtual ~CameraNode();
// Zooms camera in.
void zoomIn();
// Zooms camera out.
void zoomOut();
// Raises the camera.
void raise();
// Lowers the camera.
void lower();
// Render this node and all of its children.
virtual void render();
private:
// Dino to focus on.
const DinoNode& focus_;
// How far away from the target dino is the camera?
double followDistance_;
// How high above the 'surface' is the camera?
double camH_;
DISALLOW_EVIL_CONSTRUCTORS(CameraNode);
};
#endif