Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Thruster.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: Thruster.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Conventional Thruster (system) class
13 */
14 
15 #ifndef Thruster_h
16 #define Thruster_h
17 
18 #include "Types.h"
19 #include "System.h"
20 #include "Geometry.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 class Ship;
25 
26 // +--------------------------------------------------------------------+
27 
28 struct ThrusterPort {
29  static const char* TYPENAME() { return "ThrusterPort"; }
30 
31  ThrusterPort(int t, const Point& l, DWORD f, float s);
32  ~ThrusterPort();
33 
34  int type;
35  DWORD fire;
36  float burn;
37  float scale;
41 };
42 
43 // +--------------------------------------------------------------------+
44 
45 class Thruster : public System
46 {
47 public:
48  static const char* TYPENAME() { return "Thruster"; }
49 
50  enum Constants {
53  };
54 
55  Thruster(int dtype, double thrust, float flare_scale=0);
56  Thruster(const Thruster& rhs);
57  virtual ~Thruster();
58 
59  static void Initialize();
60  static void Close();
61 
62  virtual void ExecFrame(double seconds);
63  virtual void ExecTrans(double x, double y, double z);
64  virtual void SetShip(Ship* s);
65 
66  virtual double TransXLimit();
67  virtual double TransYLimit();
68  virtual double TransZLimit();
69 
70  virtual void AddPort(int type, const Point& loc, DWORD fire, float flare_scale=0);
71  virtual void CreatePort(int type, const Point& loc, DWORD fire, float flare_scale);
72 
73  int NumThrusters() const;
74  Graphic* Flare(int engine) const;
75  Graphic* Trail(int engine) const;
76  virtual void Orient(const Physical* rep);
77  virtual double GetRequest(double seconds) const;
78 
79 protected:
80  void IncBurn(int inc, int dec);
81  void DecBurn(int a, int b);
82 
84  float thrust;
85  float scale;
86  float burn[12];
87 
92 
94 };
95 
96 #endif Thruster_h
97