Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SteerAI Class Reference

#include <SteerAI.h>

Inheritance diagram for SteerAI:
Director SimObserver SeekerAI ShipAI DropShipAI FighterAI NavAI StarshipAI

List of all members.

Public Types

enum  Type { SEEKER = 1000, FIGHTER, STARSHIP, GROUND }

Public Member Functions

 SteerAI (SimObject *self)
virtual ~SteerAI ()
virtual void SetTarget (SimObject *targ, System *sub=0)
virtual SimObjectGetTarget () const
virtual SystemGetSubTarget () const
virtual void DropTarget (double drop_time=1.5)
virtual int Type () const
virtual bool Update (SimObject *obj)
virtual const char * GetObserverName () const
virtual Point GetObjective () const
virtual SimObjectGetOther () const
- Public Member Functions inherited from Director
 Director ()
virtual ~Director ()
virtual int Subframe () const
virtual void ExecFrame (double factor)
- Public Member Functions inherited from SimObserver
virtual ~SimObserver ()
int operator== (const SimObserver &o) const
virtual void Observe (SimObject *obj)
virtual void Ignore (SimObject *obj)

Static Public Member Functions

static DirectorCreate (SimObject *, int type)
- Static Public Member Functions inherited from SimObserver
static const char * TYPENAME ()

Protected Member Functions

virtual void Navigator ()
virtual int Accumulate (const Steer &steer)
virtual Steer Seek (const Point &point)
virtual Steer Flee (const Point &point)
virtual Steer Avoid (const Point &point, float radius)
virtual Steer Evade (const Point &point, const Point &vel)
virtual void FindObjective ()
virtual Point ClosingVelocity ()
virtual Point Transform (const Point &pt)
virtual Point AimTransform (const Point &pt)

Protected Attributes

int seeking
SimObjectself
SimObjecttarget
Systemsubtarget
SimObjectother
Point obj_w
Point objective
double distance
double az [3]
double el [3]
Steer accumulator
double magnitude
DWORD evade_time
double seek_gain
double seek_damp
int ai_type
- Protected Attributes inherited from SimObserver
List< SimObjectobserve_list

Detailed Description

Definition at line 56 of file SteerAI.h.


Member Enumeration Documentation

Enumerator:
SEEKER 
FIGHTER 
STARSHIP 
GROUND 

Definition at line 59 of file SteerAI.h.


Constructor & Destructor Documentation

SteerAI::SteerAI ( SimObject self)

Definition at line 109 of file SteerAI.cpp.

SteerAI::~SteerAI ( )
virtual

Definition at line 124 of file SteerAI.cpp.


Member Function Documentation

int SteerAI::Accumulate ( const Steer steer)
protectedvirtual

Definition at line 311 of file SteerAI.cpp.

Point SteerAI::AimTransform ( const Point pt)
protectedvirtual

Definition at line 289 of file SteerAI.cpp.

Steer SteerAI::Avoid ( const Point point,
float  radius 
)
protectedvirtual

Reimplemented in NavAI, and StarshipAI.

Definition at line 402 of file SteerAI.cpp.

Point SteerAI::ClosingVelocity ( )
protectedvirtual

Reimplemented in ShipAI, and FighterAI.

Definition at line 176 of file SteerAI.cpp.

Director * SteerAI::Create ( SimObject self,
int  type 
)
static

Definition at line 89 of file SteerAI.cpp.

void SteerAI::DropTarget ( double  drop_time = 1.5)
virtual

Reimplemented in ShipAI.

Definition at line 143 of file SteerAI.cpp.

Steer SteerAI::Evade ( const Point point,
const Point vel 
)
protectedvirtual

Definition at line 429 of file SteerAI.cpp.

void SteerAI::FindObjective ( )
protectedvirtual

Reimplemented in ShipAI, NavAI, DropShipAI, FighterAI, SeekerAI, and StarshipAI.

Definition at line 189 of file SteerAI.cpp.

Steer SteerAI::Flee ( const Point point)
protectedvirtual

Reimplemented in NavAI, and StarshipAI.

Definition at line 377 of file SteerAI.cpp.

virtual Point SteerAI::GetObjective ( ) const
inlinevirtual

Definition at line 76 of file SteerAI.h.

const char * SteerAI::GetObserverName ( ) const
virtual

Reimplemented from SimObserver.

Reimplemented in ShipAI, and SeekerAI.

Definition at line 166 of file SteerAI.cpp.

virtual SimObject* SteerAI::GetOther ( ) const
inlinevirtual

Definition at line 77 of file SteerAI.h.

virtual System* SteerAI::GetSubTarget ( ) const
inlinevirtual

Definition at line 68 of file SteerAI.h.

virtual SimObject* SteerAI::GetTarget ( ) const
inlinevirtual

Definition at line 67 of file SteerAI.h.

void SteerAI::Navigator ( )
protectedvirtual

Reimplemented in ShipAI, NavAI, SeekerAI, FighterAI, DropShipAI, and StarshipAI.

Definition at line 304 of file SteerAI.cpp.

Steer SteerAI::Seek ( const Point point)
protectedvirtual

Reimplemented in FighterAI, NavAI, and StarshipAI.

Definition at line 341 of file SteerAI.cpp.

void SteerAI::SetTarget ( SimObject targ,
System sub = 0 
)
virtual

Reimplemented in ShipAI, and SeekerAI.

Definition at line 130 of file SteerAI.cpp.

Point SteerAI::Transform ( const Point pt)
protectedvirtual

Reimplemented in NavAI, and StarshipAI.

Definition at line 238 of file SteerAI.cpp.

virtual int SteerAI::Type ( ) const
inlinevirtual

Reimplemented from Director.

Reimplemented in NavAI, DropShipAI, and SeekerAI.

Definition at line 70 of file SteerAI.h.

bool SteerAI::Update ( SimObject obj)
virtual

Reimplemented from SimObserver.

Reimplemented in ShipAI, and SeekerAI.

Definition at line 151 of file SteerAI.cpp.


Member Data Documentation

Steer SteerAI::accumulator
protected

Definition at line 111 of file SteerAI.h.

int SteerAI::ai_type
protected

Definition at line 118 of file SteerAI.h.

double SteerAI::az[3]
protected

Definition at line 109 of file SteerAI.h.

double SteerAI::distance
protected

Definition at line 108 of file SteerAI.h.

double SteerAI::el[3]
protected

Definition at line 109 of file SteerAI.h.

DWORD SteerAI::evade_time
protected

Definition at line 113 of file SteerAI.h.

double SteerAI::magnitude
protected

Definition at line 112 of file SteerAI.h.

Point SteerAI::obj_w
protected

Definition at line 105 of file SteerAI.h.

Point SteerAI::objective
protected

Definition at line 106 of file SteerAI.h.

SimObject* SteerAI::other
protected

Definition at line 103 of file SteerAI.h.

double SteerAI::seek_damp
protected

Definition at line 116 of file SteerAI.h.

double SteerAI::seek_gain
protected

Definition at line 115 of file SteerAI.h.

int SteerAI::seeking
protected

Definition at line 98 of file SteerAI.h.

SimObject* SteerAI::self
protected

Definition at line 100 of file SteerAI.h.

System* SteerAI::subtarget
protected

Reimplemented in StarshipAI.

Definition at line 102 of file SteerAI.h.

SimObject* SteerAI::target
protected

Definition at line 101 of file SteerAI.h.


The documentation for this class was generated from the following files: