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

#include <SimObject.h>

Inheritance diagram for SimObject:
Physical Debris Explosion Ship Shot Asteroid Drone

List of all members.

Public Types

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

Public Member Functions

 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 void Activate (Scene &scene)
virtual void Deactivate (Scene &scene)
virtual DWORD GetObjID () const
virtual void SetObjID (DWORD id)
virtual bool IsHostileTo (const SimObject *o) const
- Public Member Functions inherited from Physical
 Physical ()
 Physical (const char *n, int t=0)
virtual ~Physical ()
int operator== (const Physical &p) const
virtual void ExecFrame (double seconds)
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

Static Public Member Functions

static const char * TYPENAME ()
- Static Public Member Functions inherited from Physical
static void SetSubFrameLength (double seconds)
static double GetSubFrameLength ()
static void ElasticCollision (Physical &a, Physical &b)
static void InelasticCollision (Physical &a, Physical &b)
static void SemiElasticCollision (Physical &a, Physical &b)

Protected Attributes

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

Friends

class SimRegion

Additional Inherited Members

- Static Protected Attributes inherited from Physical
static int id_key = 1
static double sub_frame = 1.0 / 60.0

Detailed Description

Definition at line 32 of file SimObject.h.


Member Enumeration Documentation

Enumerator:
SIM_SHIP 
SIM_SHOT 
SIM_DRONE 
SIM_EXPLOSION 
SIM_DEBRIS 
SIM_ASTEROID 

Definition at line 39 of file SimObject.h.


Constructor & Destructor Documentation

SimObject::SimObject ( )
inline

Definition at line 48 of file SimObject.h.

SimObject::SimObject ( const char *  n,
int  t = 0 
)
inline

Definition at line 49 of file SimObject.h.

SimObject::~SimObject ( )
virtual

Definition at line 70 of file SimObject.cpp.


Member Function Documentation

void SimObject::Activate ( Scene scene)
virtual

Reimplemented in Ship, Explosion, and Shot.

Definition at line 130 of file SimObject.cpp.

void SimObject::Deactivate ( Scene scene)
virtual

Reimplemented in Ship, Explosion, and Shot.

Definition at line 141 of file SimObject.cpp.

virtual DWORD SimObject::GetObjID ( ) const
inlinevirtual

Definition at line 62 of file SimObject.h.

virtual SimRegion* SimObject::GetRegion ( ) const
inlinevirtual

Definition at line 52 of file SimObject.h.

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

Reimplemented in Ship, and Shot.

Definition at line 65 of file SimObject.h.

void SimObject::Notify ( )
virtual

Definition at line 78 of file SimObject.cpp.

void SimObject::Register ( SimObserver obs)
virtual

Definition at line 112 of file SimObject.cpp.

virtual void SimObject::SetObjID ( DWORD  id)
inlinevirtual

Definition at line 63 of file SimObject.h.

virtual void SimObject::SetRegion ( SimRegion rgn)
inlinevirtual

Reimplemented in Ship.

Definition at line 53 of file SimObject.h.

static const char* SimObject::TYPENAME ( )
inlinestatic

Reimplemented from Physical.

Reimplemented in Ship, Shot, Drone, and Explosion.

Definition at line 37 of file SimObject.h.

void SimObject::Unregister ( SimObserver obs)
virtual

Definition at line 121 of file SimObject.cpp.


Friends And Related Function Documentation

friend class SimRegion
friend

Definition at line 34 of file SimObject.h.


Member Data Documentation

bool SimObject::active
protected

Definition at line 72 of file SimObject.h.

bool SimObject::notifying
protected

Definition at line 73 of file SimObject.h.

DWORD SimObject::objid
protected

Definition at line 71 of file SimObject.h.

List<SimObserver> SimObject::observers
protected

Definition at line 70 of file SimObject.h.

SimRegion* SimObject::region
protected

Definition at line 69 of file SimObject.h.


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