mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MovingObject.h
Go to the documentation of this file.
1 
6 #pragma once
7 #include "GameObject.h"
8 #include "Vector3.h"
9 
11 
16 class MovingObject : virtual public GameObject {
17  // construction and destruction stuff
18 public:
19  MovingObject( );
20  MovingObject( Vector3 position );
21  MovingObject( float x, float y, float z );
22  ~MovingObject( void );
23 
24  // support changing the direction of view: (yaw), roll and pitch
25 public:
26  void pitch( float angle );
27  void roll( float angle );
28  Vector3 getRight( void );
29  Vector3 getUp( void );
30  Vector3 getView( void );
31  void setView( Vector3 v );
32 private:
33  Vector3 view;// direction of view
34  Vector3 up;// direction of up
35 
36  // speed and actual moving
37 public:
38  void accelerate( float step );
39  void advance( float t );
40  float getMaxSpeed( void );
41  float getMinSpeed( void );
42  float getSpeed( void );
43  void setMaxSpeed( float speed );
44  void setMinSpeed( float speed );
45  void setSpeed( float speed );
46  void setStep( float step );
47 private:
48  float m_minspeed;// maximal speed
49  float m_maxspeed;// maximal speed
50  float m_speed; // speed
51  float m_step;// step of accelerations
52 };