forked from tstellar/cs510fly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAirplaneState.h
46 lines (36 loc) · 1.28 KB
/
AirplaneState.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
#ifndef AIRPLANESTATE_H
#define AIRPLANESTATE_H
#include "Ogre.h"
class ConfigReader;
struct AirplaneState {
Ogre::Vector3 position;
Ogre::Quaternion orientation;
Ogre::Vector3 velocity;
float thrust;
AirplaneState(
const Ogre::Vector3& position = Ogre::Vector3::ZERO,
const Ogre::Quaternion& orientation = Ogre::Quaternion::IDENTITY,
const Ogre::Vector3& velocity = Ogre::Vector3::ZERO,
float thrust = 0.0f) :
position(position),
orientation(orientation),
velocity(velocity),
thrust(thrust) { }
AirplaneState(const AirplaneState& other) :
position(other.position),
orientation(other.orientation),
velocity(other.velocity),
thrust(other.thrust) { }
explicit AirplaneState(const Ogre::Node * node) :
position(node->getPosition()),
orientation(node->getOrientation()),
velocity(Ogre::Vector3::ZERO),
thrust(0.0f) { }
static AirplaneState readFromConfig(const ConfigReader * reader);
void syncToNode(Ogre::Node *) const;
void syncFromNode(const Ogre::Node *);
void syncToALSource(unsigned int alSource);
bool clampAboveHeight(float height);
Ogre::Radian angleOfAttack() const;
};
#endif