1 // FGAICarrier - AIShip-derived class creates an AI aircraft carrier
3 // Written by David Culp, started October 2004.
5 // Copyright (C) 2004 David P. Culp - davidculp2@comcast.net
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef _FG_AICARRIER_HXX
22 #define _FG_AICARRIER_HXX
27 #include <simgear/compiler.h>
36 class FGAICarrierHardware : public ssgBase {
39 enum Type { Catapult, Wire, Solid };
45 static FGAICarrierHardware* newCatapult(FGAICarrier *c) {
46 FGAICarrierHardware* ch = new FGAICarrierHardware;
52 static FGAICarrierHardware* newWire(FGAICarrier *c) {
53 FGAICarrierHardware* ch = new FGAICarrierHardware;
59 static FGAICarrierHardware* newSolid(FGAICarrier *c) {
60 FGAICarrierHardware* ch = new FGAICarrierHardware;
71 class FGAICarrier : public FGAIShip {
75 FGAICarrier(FGAIManager* mgr);
78 void setSolidObjects(const list<string>& solid_objects);
79 void setWireObjects(const list<string>& wire_objects);
80 void setCatapultObjects(const list<string>& catapult_objects);
81 void setParkingPositions(const list<ParkPosition>& p);
82 void setSign(const string& );
83 void setFlolsOffset(const Point3D& off);
85 void getVelocityWrtEarth(sgVec3 v);
87 virtual void unbind();
88 void UpdateFlols ( double dt );
92 bool getParkPosition(const string& id, Point3D& geodPos,
93 double& hdng, sgdVec3 uvw);
97 void update(double dt);
98 void mark_nohot(ssgEntity*);
99 bool mark_wires(ssgEntity*, const list<string>&, bool = false);
100 bool mark_cat(ssgEntity*, const list<string>&, bool = false);
101 bool mark_solid(ssgEntity*, const list<string>&, bool = false);
103 list<string> solid_objects; // List of solid object names
104 list<string> wire_objects; // List of wire object names
105 list<string> catapult_objects; // List of catapult object names
106 list<ParkPosition> ppositions; // List of positions where an aircraft can start.
107 string sign; // The sign of this carrier.
109 // Velocity wrt earth.
110 sgVec3 vel_wrt_earth;
112 // these describe the flols
115 double dist; // the distance of the eyepoint from the flols
117 int source; // the flols light which is visible at the moment
120 #endif // _FG_AICARRIER_HXX