-
Notifications
You must be signed in to change notification settings - Fork 1
/
Camera.h
54 lines (44 loc) · 1.11 KB
/
Camera.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
#pragma once
#ifndef CAMERA_H_
#define CAMERA_H_
#include "StdAfx.h"
#include "NetObject.h"
namespace Sarona
{
class NetWorld;
class Camera
{
private:
IrrlichtDevice * m_device;
scene::ICameraSceneNode * m_camera;
NetWorld * m_world;
// Follow mode:
NetObject::Id m_followTarget;
double m_followDistance;
double m_followHeight;
bool m_followFollowPitch;
// Position mode:
btVector3 m_pos_begin;
btVector3 m_pos_end;
btVector3 m_target_begin;
btVector3 m_target_end;
boost::posix_time::ptime m_time_begin;
boost::posix_time::ptime m_time_end;
enum {
CAMERA_CHASE,
CAMERA_POSITION,
CAMERA_FREE
} m_state;
public:
void Translate(int dx, int dy);
void Step(float dt);
Camera(IrrlichtDevice* dev, NetWorld* world);
~Camera();
// Make the camera follow an existing NetObject
void SetCameraChase(NetObject::Id id, double distance, double height, bool follow_pitch);
void SetCameraPos(btVector3 pos_begin, btVector3 pos_end, btVector3 target_begin, btVector3 target_end, double time);
void SetCameraFree();
bool OnEvent(const SEvent& event);
};
}
#endif