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

#include <Shot.h>

Inheritance diagram for Shot:
SimObject SimObserver Physical Drone

List of all members.

Public Member Functions

 Shot (const Point &pos, const Camera &cam, WeaponDesign *design, const Ship *ship=0)
virtual ~Shot ()
virtual void SeekTarget (SimObject *target, System *sub=0)
virtual void ExecFrame (double factor)
virtual void Activate (Scene &scene)
virtual void Deactivate (Scene &scene)
const ShipOwner () const
double Damage () const
int ShotType () const
virtual SimObjectGetTarget () const
virtual bool IsPrimary () const
virtual bool IsDrone () const
virtual bool IsDecoy () const
virtual bool IsProbe () const
virtual bool IsMissile () const
virtual bool IsArmed () const
virtual bool IsBeam () const
virtual bool IsFlak () const
virtual bool IsHostileTo (const SimObject *o) const
bool HitTarget () const
void SetHitTarget (bool h)
virtual bool IsTracking (Ship *tgt) const
virtual double PCS () const
virtual double ACS () const
virtual int GetIFF () const
virtual Color MarkerColor () const
const PointOrigin () const
float Charge () const
void SetCharge (float c)
double Length () const
GraphicGetTrail () const
void SetFuse (double seconds)
void SetBeamPoints (const Point &from, const Point &to)
virtual void Disarm ()
virtual void Destroy ()
const WeaponDesignDesign () const
const char * DesignName () const
int GetEta () const
void SetEta (int t)
double AltitudeMSL () const
double AltitudeAGL () const
virtual bool Update (SimObject *obj)
virtual const char * GetObserverName () const
int operator== (const Shot &s) const
- Public Member Functions inherited from SimObject
 SimObject ()
 SimObject (const char *n, int t=0)
virtual ~SimObject ()
virtual SimRegionGetRegion () const
virtual void SetRegion (SimRegion *rgn)
virtual void Notify ()
virtual void Register (SimObserver *obs)
virtual void Unregister (SimObserver *obs)
virtual DWORD GetObjID () const
virtual void SetObjID (DWORD id)
- Public Member Functions inherited from Physical
 Physical ()
 Physical (const char *n, int t=0)
virtual ~Physical ()
int operator== (const Physical &p) const
virtual void AeroFrame (double seconds)
virtual void ArcadeFrame (double seconds)
virtual void AngularFrame (double seconds)
virtual void LinearFrame (double seconds)
virtual void CalcFlightPath ()
virtual void MoveTo (const Point &new_loc)
virtual void TranslateBy (const Point &ref)
virtual void ApplyForce (const Point &force)
virtual void ApplyTorque (const Point &torque)
virtual void SetThrust (double t)
virtual void SetTransX (double t)
virtual void SetTransY (double t)
virtual void SetTransZ (double t)
virtual void SetHeading (double r, double p, double y)
virtual void LookAt (const Point &dst)
virtual void ApplyRoll (double roll_acc)
virtual void ApplyPitch (double pitch_acc)
virtual void ApplyYaw (double yaw_acc)
virtual int CollidesWith (Physical &o)
virtual void InflictDamage (double damage, int type=0)
int Identity () const
int Type () const
const char * Name () const
Point Location () const
Point Heading () const
Point LiftLine () const
Point BeamLine () const
Point Velocity () const
Point Acceleration () const
double Thrust () const
double TransX () const
double TransY () const
double TransZ () const
double Drag () const
double Roll () const
double Pitch () const
double Yaw () const
Point Rotation () const
double Alpha () const
double FlightPathYawAngle () const
double FlightPathPitchAngle () const
double Radius () const
double Mass () const
double Integrity () const
double Life () const
double Shake () const
const PointVibration () const
const CameraCam () const
GraphicRep () const
LightLightSrc () const
DirectorGetDirector () const
virtual void SetAngularRates (double r, double p, double y)
virtual void GetAngularRates (double &r, double &p, double &y)
virtual void SetAngularDrag (double r, double p, double y)
virtual void GetAngularDrag (double &r, double &p, double &y)
virtual void GetAngularThrust (double &r, double &p, double &y)
virtual void SetVelocity (const Point &v)
virtual void SetAbsoluteOrientation (double roll, double pitch, double yaw)
virtual void CloneCam (const Camera &cam)
virtual void SetDrag (double d)
virtual void SetPrimary (const Point &loc, double mass)
virtual void SetGravity (double g)
virtual void SetBaseDensity (double d)
virtual double GetBaseDensity () const
virtual double GetDensity () const
- 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 const char * TYPENAME ()
static void Initialize ()
static void Close ()

Protected Attributes

const Shipowner
int type
float base_damage
float charge
float offset
float altitude_agl
short eta
BYTE iff_code
bool first_frame
bool primary
bool beam
bool armed
bool hit_target
Spriteflash
Spriteflare
Trailtrail
Soundsound
WeaponDesigndesign
Point origin
- Protected Attributes inherited from SimObject
SimRegionregion
List< SimObserverobservers
DWORD objid
bool active
bool notifying
- Protected Attributes inherited from Physical
int id
int obj_type
char name [NAMELEN]
Camera cam
Point velocity
Point arcade_velocity
Point accel
float thrust
float trans_x
float trans_y
float trans_z
float drag
float roll
float pitch
float yaw
float dr
float dp
float dy
float dr_acc
float dp_acc
float dy_acc
float dr_drg
float dp_drg
float dy_drg
float flight_path_yaw
float flight_path_pitch
Point primary_loc
double primary_mass
float g_accel
float Do
float CL
float CD
float alpha
float stall
bool lat_thrust
bool straight
float shake
Point vibration
float roll_rate
float pitch_rate
float yaw_rate
double life
float radius
float mass
float integrity
Graphicrep
Lightlight
Directordir
- Protected Attributes inherited from SimObserver
List< SimObjectobserve_list

Additional Inherited Members

- Public Types inherited from SimObject
enum  TYPES {
  SIM_SHIP = 100, SIM_SHOT, SIM_DRONE, SIM_EXPLOSION,
  SIM_DEBRIS, SIM_ASTEROID
}
- Public Types inherited from Physical
enum  { NAMELEN = 48 }

Detailed Description

Definition at line 35 of file Shot.h.


Constructor & Destructor Documentation

Shot::Shot ( const Point pos,
const Camera cam,
WeaponDesign design,
const Ship ship = 0 
)

Definition at line 39 of file Shot.cpp.

Shot::~Shot ( )
virtual

Definition at line 141 of file Shot.cpp.


Member Function Documentation

virtual double Shot::ACS ( ) const
inlinevirtual

Reimplemented in Drone.

Definition at line 72 of file Shot.h.

void Shot::Activate ( Scene scene)
virtual

Reimplemented from SimObject.

Definition at line 536 of file Shot.cpp.

double Shot::AltitudeAGL ( ) const

Definition at line 454 of file Shot.cpp.

double Shot::AltitudeMSL ( ) const

Definition at line 448 of file Shot.cpp.

float Shot::Charge ( ) const
inline

Definition at line 77 of file Shot.h.

void Shot::Close ( )
static

Definition at line 485 of file Shot.cpp.

double Shot::Damage ( ) const

Definition at line 492 of file Shot.cpp.

void Shot::Deactivate ( Scene scene)
virtual

Reimplemented from SimObject.

Definition at line 579 of file Shot.cpp.

const WeaponDesign* Shot::Design ( ) const
inline

Definition at line 87 of file Shot.h.

const char * Shot::DesignName ( ) const

Definition at line 156 of file Shot.cpp.

void Shot::Destroy ( )
virtual

Reimplemented in Drone.

Definition at line 413 of file Shot.cpp.

void Shot::Disarm ( )
virtual

Reimplemented in Drone.

Definition at line 403 of file Shot.cpp.

void Shot::ExecFrame ( double  factor)
virtual

Reimplemented from Physical.

Reimplemented in Drone.

Definition at line 268 of file Shot.cpp.

int Shot::GetEta ( ) const
inline

Definition at line 89 of file Shot.h.

int Shot::GetIFF ( ) const
virtual

Definition at line 596 of file Shot.cpp.

const char * Shot::GetObserverName ( ) const
virtual

Reimplemented from SimObserver.

Definition at line 612 of file Shot.cpp.

SimObject * Shot::GetTarget ( ) const
virtual

Definition at line 220 of file Shot.cpp.

Graphic* Shot::GetTrail ( ) const
inline

Definition at line 80 of file Shot.h.

bool Shot::HitTarget ( ) const
inline

Definition at line 67 of file Shot.h.

void Shot::Initialize ( )
static

Definition at line 478 of file Shot.cpp.

virtual bool Shot::IsArmed ( ) const
inlinevirtual

Definition at line 62 of file Shot.h.

virtual bool Shot::IsBeam ( ) const
inlinevirtual

Definition at line 63 of file Shot.h.

virtual bool Shot::IsDecoy ( ) const
inlinevirtual

Reimplemented in Drone.

Definition at line 59 of file Shot.h.

virtual bool Shot::IsDrone ( ) const
inlinevirtual

Reimplemented in Drone.

Definition at line 58 of file Shot.h.

bool Shot::IsFlak ( ) const
virtual

Definition at line 233 of file Shot.cpp.

bool Shot::IsHostileTo ( const SimObject o) const
virtual

Reimplemented from SimObject.

Definition at line 241 of file Shot.cpp.

virtual bool Shot::IsMissile ( ) const
inlinevirtual

Definition at line 61 of file Shot.h.

virtual bool Shot::IsPrimary ( ) const
inlinevirtual

Definition at line 57 of file Shot.h.

virtual bool Shot::IsProbe ( ) const
inlinevirtual

Reimplemented in Drone.

Definition at line 60 of file Shot.h.

bool Shot::IsTracking ( Ship tgt) const
virtual

Definition at line 214 of file Shot.cpp.

double Shot::Length ( ) const

Definition at line 525 of file Shot.cpp.

Color Shot::MarkerColor ( ) const
virtual

Definition at line 604 of file Shot.cpp.

int Shot::operator== ( const Shot s) const
inline

Definition at line 99 of file Shot.h.

const Point& Shot::Origin ( ) const
inline

Definition at line 76 of file Shot.h.

const Ship* Shot::Owner ( ) const
inline

Definition at line 52 of file Shot.h.

virtual double Shot::PCS ( ) const
inlinevirtual

Reimplemented in Drone.

Definition at line 71 of file Shot.h.

void Shot::SeekTarget ( SimObject target,
System sub = 0 
)
virtual

Reimplemented in Drone.

Definition at line 183 of file Shot.cpp.

void Shot::SetBeamPoints ( const Point from,
const Point to 
)

Definition at line 421 of file Shot.cpp.

void Shot::SetCharge ( float  c)

Definition at line 164 of file Shot.cpp.

void Shot::SetEta ( int  t)
inline

Definition at line 90 of file Shot.h.

void Shot::SetFuse ( double  seconds)

Definition at line 174 of file Shot.cpp.

void Shot::SetHitTarget ( bool  h)
inline

Definition at line 68 of file Shot.h.

int Shot::ShotType ( ) const
inline

Definition at line 54 of file Shot.h.

static const char* Shot::TYPENAME ( )
inlinestatic

Reimplemented from SimObject.

Reimplemented in Drone.

Definition at line 39 of file Shot.h.

bool Shot::Update ( SimObject obj)
virtual

Reimplemented from SimObserver.

Definition at line 620 of file Shot.cpp.


Member Data Documentation

float Shot::altitude_agl
protected

Definition at line 108 of file Shot.h.

bool Shot::armed
protected

Definition at line 114 of file Shot.h.

float Shot::base_damage
protected

Definition at line 105 of file Shot.h.

bool Shot::beam
protected

Definition at line 113 of file Shot.h.

float Shot::charge
protected

Definition at line 106 of file Shot.h.

WeaponDesign* Shot::design
protected

Definition at line 122 of file Shot.h.

short Shot::eta
protected

Definition at line 109 of file Shot.h.

bool Shot::first_frame
protected

Definition at line 111 of file Shot.h.

Sprite* Shot::flare
protected

Definition at line 118 of file Shot.h.

Sprite* Shot::flash
protected

Definition at line 117 of file Shot.h.

bool Shot::hit_target
protected

Definition at line 115 of file Shot.h.

BYTE Shot::iff_code
protected

Reimplemented in Drone.

Definition at line 110 of file Shot.h.

float Shot::offset
protected

Definition at line 107 of file Shot.h.

Point Shot::origin
protected

Definition at line 125 of file Shot.h.

const Ship* Shot::owner
protected

Definition at line 102 of file Shot.h.

bool Shot::primary
protected

Definition at line 112 of file Shot.h.

Sound* Shot::sound
protected

Definition at line 121 of file Shot.h.

Trail* Shot::trail
protected

Definition at line 119 of file Shot.h.

int Shot::type
protected

Definition at line 104 of file Shot.h.


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