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
linecollide.h
Go to the documentation of this file.
1 #ifndef _LINECOLLIDE_H_
2 #define _LINECOLLIDE_H_
3 
4 #include <stdlib.h>
5 #include "gfx/vec.h"
6 
11 class Unit;
12 class Beam;
13 class Bolt;
14 
16 {
17 private:
18  union OBJECT
19  {
20  Unit *u;
21  Beam *b;
22  Bolt *blt;
23  int i;
24  };
25 
26 public:
28 
30  OBJECT object;
39  void *lastchecked;
40 
43 
45  bool hhuge;
46 
48  Mini( 0, 0, 0 )
49  , Maxi( 0, 0, 0 )
50  , lastchecked( NULL )
51  , type( UNIT )
52  , hhuge( false )
53  {
54  object.u = NULL;
55  }
56 
57  LineCollide( void *objec, collidables typ, const QVector &st, const QVector &en ) :
58  Mini( st )
59  , Maxi( en )
60  , lastchecked( NULL )
61  , type( typ )
62  , hhuge( false )
63  {
64  this->object.u = (Unit*) objec;
65  }
66 
67  LineCollide( const LineCollide &l ) :
68  Mini( l.Mini )
69  , Maxi( l.Maxi )
70  , lastchecked( NULL )
71  , type( l.type )
72  , hhuge( l.hhuge )
73  {
74  object = l.object;
75  }
76 
78  {
79  object = l.object;
80  type = l.type;
81  Mini = l.Mini;
82  Maxi = l.Maxi;
83  hhuge = l.hhuge;
84  lastchecked = NULL;
85  return *this;
86  }
87 };
88 
89 #endif
90