2002-04-03 23:54:44 +00:00
|
|
|
// FGAIEntity - abstract base class an artificial intelligence entity
|
|
|
|
//
|
|
|
|
// Written by David Luff, started March 2002.
|
|
|
|
//
|
|
|
|
// Copyright (C) 2002 David C. Luff - david.luff@nottingham.ac.uk
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License as
|
|
|
|
// published by the Free Software Foundation; either version 2 of the
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful, but
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
#ifndef _FG_AIEntity_HXX
|
|
|
|
#define _FG_AIEntity_HXX
|
|
|
|
|
|
|
|
#include <plib/sg.h>
|
|
|
|
#include <plib/ssg.h>
|
2003-05-08 20:28:46 +00:00
|
|
|
|
2002-04-03 23:54:44 +00:00
|
|
|
#include <simgear/math/point3d.hxx>
|
2003-05-09 19:39:48 +00:00
|
|
|
#include <simgear/scene/model/placement.hxx>
|
2003-05-08 20:28:46 +00:00
|
|
|
|
|
|
|
#include <Model/model.hxx>
|
2002-04-03 23:54:44 +00:00
|
|
|
|
2002-10-02 15:27:49 +00:00
|
|
|
|
|
|
|
/*****************************************************************
|
|
|
|
*
|
|
|
|
* FGAIEntity - this class implements the minimum requirement
|
|
|
|
* for any AI entity - a position, an orientation, an associated
|
|
|
|
* 3D model, and the ability to be moved. It does nothing useful
|
|
|
|
* and all AI entities are expected to be derived from it.
|
|
|
|
*
|
|
|
|
******************************************************************/
|
2002-04-03 23:54:44 +00:00
|
|
|
class FGAIEntity {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
virtual ~FGAIEntity();
|
|
|
|
|
|
|
|
// Run the internal calculations
|
2002-10-02 15:27:49 +00:00
|
|
|
virtual void Update(double dt);
|
2003-03-20 11:53:44 +00:00
|
|
|
|
2003-05-09 19:39:48 +00:00
|
|
|
// Send a transmission *TO* the AIEntity.
|
|
|
|
// FIXME int code is a hack - eventually this will receive Alexander's coded messages.
|
|
|
|
virtual void RegisterTransmission(int code);
|
2002-04-03 23:54:44 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2002-10-02 15:27:49 +00:00
|
|
|
Point3D pos; // WGS84 lat & lon in degrees, elev above sea-level in meters
|
2002-04-03 23:54:44 +00:00
|
|
|
double hdg; //True heading in degrees
|
|
|
|
double roll; //degrees
|
|
|
|
double pitch; //degrees
|
|
|
|
|
|
|
|
char* model_path; //Path to the 3D model
|
2002-10-02 15:27:49 +00:00
|
|
|
FGModelPlacement aip;
|
2002-04-03 23:54:44 +00:00
|
|
|
|
|
|
|
void Transform();
|
|
|
|
};
|
|
|
|
|
2002-04-04 01:32:00 +00:00
|
|
|
#endif // _FG_AIEntity_HXX
|
|
|
|
|