-
Notifications
You must be signed in to change notification settings - Fork 0
/
DinoNode.h
57 lines (44 loc) · 1.19 KB
/
DinoNode.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
// Node in scene graph that draws a dino.
//
// Author: Michael DiBernardo
//
// REFERENCES:
// None.
#ifndef __DINO_NODE_H__
#define __DINO_NODE_H__
class Animation;
class DinoState;
class JointNode;
class Orientation;
#include "Basics.h"
#include "AquaDino.h"
#include "SceneNode.h"
#include <string>
using std::string;
class DinoNode : public SceneNode {
public:
// New dino node.
DinoNode(const string& id, const DinoState& myState);
// Purge the subtree rooted at this node, including this node.
virtual ~DinoNode();
// Gets the orientation of this node.
// TODO: See if this is actually used.
const Orientation& getOrientation() const;
// Render this node and all of its children.
virtual void render();
private:
SceneNode* dinoRoot_;
JointNode* joints_[AQUA_DINO_NUM_JOINTS]; // List of dino joints
const DinoState& state_;
Animation* mf_; // move forward
Animation* mb_; // move backward
Animation* tl_; // turn left
Animation* tr_; // turn right
Animation* currentAnimation_;
// Helper method to build dino model.
SceneNode* buildDino();
// Helper method to assign new frames.
void animate();
DISALLOW_EVIL_CONSTRUCTORS(DinoNode);
};
#endif