Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nebula_generic.h
Go to the documentation of this file.
1 #ifndef _NEBULA_GENERIC_H_
2 #define _NEBULA_GENERIC_H_
3 #include "unit_generic.h"
4 
5 class Nebula : public Unit
6 {
7 protected:
8  static void beginElement( void *Userdata, const XML_Char *name, const XML_Char **atts );
10  float Density;
11  float fognear;
12  float fogfar;
13  int index;
15  enum FOGMODE fogmode; //0=OFF (I won't use this), 1=EXP, 2=EXP2, 3=LINEAR
16  bool fogme;
17  void LoadXML( const char *filename );
18  void beginElem( const std::string&, const AttributeList& );
19  float lastfadein;
20  float fadeinvalue;
21 public:
22  void InitNebula( const char *unitfile, bool SubU, int faction, Flightgroup *fg, int fg_snumber );
23  float getFade()
24  {
25  return fadeinvalue;
26  }
27  virtual void PutInsideCam( int ) {}
28  virtual enum clsptr isUnit() const
29  {
30  return NEBULAPTR;
31  }
32  virtual void reactToCollision( Unit *smaller,
33  const QVector &biglocation,
34  const Vector &bignormal,
35  const QVector &smalllocation,
36  const Vector &smallnormal,
37  float dist );
38 
39 protected:
41  Nebula( const char *unitfile, bool SubU, int faction, Flightgroup *fg = NULL, int fg_snumber = 0 );
42 
43  friend class UnitFactory;
44  Nebula( std::vector< Mesh* >m, bool b, int i ) : Unit( m, b, i ) {}
45 public:
46  virtual void UpdatePhysics2( const Transformation &trans,
47  const Transformation &old_physical_state,
48  const Vector &accel,
49  float difficulty,
50  const Matrix &transmat,
51  const Vector &CumulativeVelocity,
52  bool ResolveLast,
53  UnitCollection *uc = NULL );
54 
55  virtual void SetFogState() {}
56 
57 protected:
59  Nebula() {}
61 //Nebula( const Nebula& );
63 //Nebula& operator=( const Nebula& );
64 };
65 
66 namespace NebulaXML
67 {
68 FOGMODE parse_fogmode( string val );
69 
70 enum Names
71 {
74  RED,
86 };
87 const unsigned short int MAXENAMES = 4;
88 const unsigned short int MAXANAMES = 11;
89 
91  EnumMap::Pair( "UNKNOWN", UNKNOWN ),
92  EnumMap::Pair( "Nebula", NEBULA ),
93  EnumMap::Pair( "Color", COLOR ),
94  EnumMap::Pair( "Limits", LIMITS ),
95 };
97  EnumMap::Pair( "UNKNOWN", UNKNOWN ),
98  EnumMap::Pair( "Red", RED ),
99  EnumMap::Pair( "Green", GREEN ),
100  EnumMap::Pair( "Blue", BLUE ),
101  EnumMap::Pair( "Near", NEBNEAR ),
102  EnumMap::Pair( "Far", NEBFAR ),
103  EnumMap::Pair( "Density", DENSITY ),
104  EnumMap::Pair( "Mode", MODE ),
105  EnumMap::Pair( "Index", INDEX ),
106  EnumMap::Pair( "ExplosionTime", EXPLOSIONTIME ),
107  EnumMap::Pair( "FogThis", FOGTHIS )
108 };
109 
112 }
113 
114 #endif
115