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

#include <Physical.h>

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

List of all members.

Public Types

enum  { NAMELEN = 48 }

Public Member Functions

 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 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

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

Static Protected Attributes

static int id_key = 1
static double sub_frame = 1.0 / 60.0

Detailed Description

Definition at line 30 of file Physical.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
NAMELEN 

Definition at line 135 of file Physical.h.


Constructor & Destructor Documentation

Physical::Physical ( )

Definition at line 30 of file Physical.cpp.

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

Definition at line 47 of file Physical.cpp.

Physical::~Physical ( )
virtual

Definition at line 65 of file Physical.cpp.


Member Function Documentation

Point Physical::Acceleration ( ) const
inline

Definition at line 85 of file Physical.h.

void Physical::AeroFrame ( double  seconds)
virtual

Reimplemented in Ship.

Definition at line 158 of file Physical.cpp.

double Physical::Alpha ( ) const
inline

Definition at line 98 of file Physical.h.

void Physical::AngularFrame ( double  seconds)
virtual

Definition at line 371 of file Physical.cpp.

void Physical::ApplyForce ( const Point force)
virtual

Definition at line 503 of file Physical.cpp.

void Physical::ApplyPitch ( double  pitch_acc)
virtual

Reimplemented in Ship.

Definition at line 586 of file Physical.cpp.

void Physical::ApplyRoll ( double  roll_acc)
virtual

Definition at line 577 of file Physical.cpp.

void Physical::ApplyTorque ( const Point torque)
virtual

Definition at line 509 of file Physical.cpp.

void Physical::ApplyYaw ( double  yaw_acc)
virtual

Definition at line 595 of file Physical.cpp.

void Physical::ArcadeFrame ( double  seconds)
virtual

Definition at line 293 of file Physical.cpp.

Point Physical::BeamLine ( ) const
inline

Definition at line 83 of file Physical.h.

void Physical::CalcFlightPath ( )
virtual

Definition at line 452 of file Physical.cpp.

const Camera& Physical::Cam ( ) const
inline

Definition at line 111 of file Physical.h.

void Physical::CloneCam ( const Camera cam)
virtual

Definition at line 559 of file Physical.cpp.

int Physical::CollidesWith ( Physical o)
virtual

Reimplemented in Ship.

Definition at line 694 of file Physical.cpp.

double Physical::Drag ( ) const
inline

Definition at line 91 of file Physical.h.

void Physical::ElasticCollision ( Physical a,
Physical b 
)
static

Definition at line 714 of file Physical.cpp.

void Physical::ExecFrame ( double  seconds)
virtual

Reimplemented in Ship, Explosion, Shot, Drone, and Debris.

Definition at line 81 of file Physical.cpp.

double Physical::FlightPathPitchAngle ( ) const
inline

Definition at line 101 of file Physical.h.

double Physical::FlightPathYawAngle ( ) const
inline

Definition at line 100 of file Physical.h.

void Physical::GetAngularDrag ( double &  r,
double &  p,
double &  y 
)
virtual

Definition at line 628 of file Physical.cpp.

void Physical::GetAngularRates ( double &  r,
double &  p,
double &  y 
)
virtual

Definition at line 612 of file Physical.cpp.

void Physical::GetAngularThrust ( double &  r,
double &  p,
double &  y 
)
virtual

Definition at line 636 of file Physical.cpp.

virtual double Physical::GetBaseDensity ( ) const
inlinevirtual

Definition at line 132 of file Physical.h.

double Physical::GetDensity ( ) const
virtual

Definition at line 282 of file Physical.cpp.

Director* Physical::GetDirector ( ) const
inline

Definition at line 115 of file Physical.h.

static double Physical::GetSubFrameLength ( )
inlinestatic

Definition at line 43 of file Physical.h.

Point Physical::Heading ( ) const
inline

Definition at line 81 of file Physical.h.

int Physical::Identity ( ) const
inline

Definition at line 76 of file Physical.h.

void Physical::InelasticCollision ( Physical a,
Physical b 
)
static

Definition at line 729 of file Physical.cpp.

void Physical::InflictDamage ( double  damage,
int  type = 0 
)
virtual

Definition at line 683 of file Physical.cpp.

double Physical::Integrity ( ) const
inline

Definition at line 105 of file Physical.h.

double Physical::Life ( ) const
inline

Definition at line 106 of file Physical.h.

Point Physical::LiftLine ( ) const
inline

Definition at line 82 of file Physical.h.

Light* Physical::LightSrc ( ) const
inline

Definition at line 113 of file Physical.h.

void Physical::LinearFrame ( double  seconds)
virtual

Reimplemented in Ship.

Definition at line 405 of file Physical.cpp.

Point Physical::Location ( ) const
inline

Definition at line 80 of file Physical.h.

void Physical::LookAt ( const Point dst)
virtual

Definition at line 553 of file Physical.cpp.

double Physical::Mass ( ) const
inline

Definition at line 104 of file Physical.h.

void Physical::MoveTo ( const Point new_loc)
virtual

Definition at line 490 of file Physical.cpp.

const char* Physical::Name ( ) const
inline

Definition at line 78 of file Physical.h.

int Physical::operator== ( const Physical p) const
inline

Definition at line 39 of file Physical.h.

double Physical::Pitch ( ) const
inline

Definition at line 94 of file Physical.h.

double Physical::Radius ( ) const
inline

Definition at line 103 of file Physical.h.

Graphic* Physical::Rep ( ) const
inline

Definition at line 112 of file Physical.h.

double Physical::Roll ( ) const
inline

Definition at line 93 of file Physical.h.

Point Physical::Rotation ( ) const
inline

Definition at line 96 of file Physical.h.

void Physical::SemiElasticCollision ( Physical a,
Physical b 
)
static

Definition at line 742 of file Physical.cpp.

void Physical::SetAbsoluteOrientation ( double  roll,
double  pitch,
double  yaw 
)
virtual

Definition at line 565 of file Physical.cpp.

void Physical::SetAngularDrag ( double  r,
double  p,
double  y 
)
virtual

Definition at line 620 of file Physical.cpp.

void Physical::SetAngularRates ( double  r,
double  p,
double  y 
)
virtual

Definition at line 604 of file Physical.cpp.

void Physical::SetBaseDensity ( double  d)
virtual

Definition at line 674 of file Physical.cpp.

virtual void Physical::SetDrag ( double  d)
inlinevirtual

Definition at line 126 of file Physical.h.

void Physical::SetGravity ( double  g)
virtual

Definition at line 667 of file Physical.cpp.

void Physical::SetHeading ( double  r,
double  p,
double  y 
)
virtual

Definition at line 543 of file Physical.cpp.

void Physical::SetPrimary ( const Point loc,
double  mass 
)
virtual

Definition at line 660 of file Physical.cpp.

static void Physical::SetSubFrameLength ( double  seconds)
inlinestatic

Definition at line 42 of file Physical.h.

void Physical::SetThrust ( double  t)
virtual

Definition at line 517 of file Physical.cpp.

void Physical::SetTransX ( double  t)
virtual

Reimplemented in Ship.

Definition at line 523 of file Physical.cpp.

void Physical::SetTransY ( double  t)
virtual

Reimplemented in Ship.

Definition at line 529 of file Physical.cpp.

void Physical::SetTransZ ( double  t)
virtual

Reimplemented in Ship.

Definition at line 535 of file Physical.cpp.

virtual void Physical::SetVelocity ( const Point v)
inlinevirtual

Definition at line 123 of file Physical.h.

double Physical::Shake ( ) const
inline

Definition at line 108 of file Physical.h.

double Physical::Thrust ( ) const
inline

Definition at line 87 of file Physical.h.

void Physical::TranslateBy ( const Point ref)
virtual

Definition at line 496 of file Physical.cpp.

double Physical::TransX ( ) const
inline

Definition at line 88 of file Physical.h.

double Physical::TransY ( ) const
inline

Definition at line 89 of file Physical.h.

double Physical::TransZ ( ) const
inline

Definition at line 90 of file Physical.h.

int Physical::Type ( ) const
inline

Definition at line 77 of file Physical.h.

static const char* Physical::TYPENAME ( )
inlinestatic

Reimplemented in Ship, Shot, Drone, SimObject, and Explosion.

Definition at line 33 of file Physical.h.

Point Physical::Velocity ( ) const
inline

Definition at line 84 of file Physical.h.

const Point& Physical::Vibration ( ) const
inline

Definition at line 109 of file Physical.h.

double Physical::Yaw ( ) const
inline

Definition at line 95 of file Physical.h.


Member Data Documentation

Point Physical::accel
protected

Definition at line 149 of file Physical.h.

float Physical::alpha
protected

Definition at line 174 of file Physical.h.

Point Physical::arcade_velocity
protected

Definition at line 148 of file Physical.h.

Camera Physical::cam
protected

Definition at line 146 of file Physical.h.

float Physical::CD
protected

Definition at line 173 of file Physical.h.

float Physical::CL
protected

Definition at line 172 of file Physical.h.

Director* Physical::dir
protected

Definition at line 197 of file Physical.h.

float Physical::Do
protected

Definition at line 171 of file Physical.h.

float Physical::dp
protected

Definition at line 158 of file Physical.h.

float Physical::dp_acc
protected

Definition at line 159 of file Physical.h.

float Physical::dp_drg
protected

Definition at line 160 of file Physical.h.

float Physical::dr
protected

Definition at line 158 of file Physical.h.

float Physical::dr_acc
protected

Definition at line 159 of file Physical.h.

float Physical::dr_drg
protected

Definition at line 160 of file Physical.h.

float Physical::drag
protected

Definition at line 154 of file Physical.h.

float Physical::dy
protected

Definition at line 158 of file Physical.h.

float Physical::dy_acc
protected

Definition at line 159 of file Physical.h.

float Physical::dy_drg
protected

Definition at line 160 of file Physical.h.

float Physical::flight_path_pitch
protected

Definition at line 163 of file Physical.h.

float Physical::flight_path_yaw
protected

Definition at line 162 of file Physical.h.

float Physical::g_accel
protected

Definition at line 170 of file Physical.h.

int Physical::id
protected

Definition at line 141 of file Physical.h.

int Physical::id_key = 1
staticprotected

Definition at line 138 of file Physical.h.

float Physical::integrity
protected

Definition at line 190 of file Physical.h.

bool Physical::lat_thrust
protected

Definition at line 176 of file Physical.h.

double Physical::life
protected

Definition at line 187 of file Physical.h.

Light* Physical::light
protected

Definition at line 194 of file Physical.h.

float Physical::mass
protected

Definition at line 189 of file Physical.h.

char Physical::name[NAMELEN]
protected

Definition at line 143 of file Physical.h.

int Physical::obj_type
protected

Definition at line 142 of file Physical.h.

float Physical::pitch
protected

Definition at line 157 of file Physical.h.

float Physical::pitch_rate
protected

Definition at line 184 of file Physical.h.

Point Physical::primary_loc
protected

Definition at line 166 of file Physical.h.

double Physical::primary_mass
protected

Definition at line 167 of file Physical.h.

float Physical::radius
protected

Definition at line 188 of file Physical.h.

Graphic* Physical::rep
protected

Definition at line 193 of file Physical.h.

float Physical::roll
protected

Definition at line 157 of file Physical.h.

float Physical::roll_rate
protected

Definition at line 184 of file Physical.h.

float Physical::shake
protected

Definition at line 180 of file Physical.h.

float Physical::stall
protected

Definition at line 175 of file Physical.h.

bool Physical::straight
protected

Definition at line 177 of file Physical.h.

double Physical::sub_frame = 1.0 / 60.0
staticprotected

Definition at line 199 of file Physical.h.

float Physical::thrust
protected

Definition at line 150 of file Physical.h.

float Physical::trans_x
protected

Definition at line 151 of file Physical.h.

float Physical::trans_y
protected

Definition at line 152 of file Physical.h.

float Physical::trans_z
protected

Definition at line 153 of file Physical.h.

Point Physical::velocity
protected

Definition at line 147 of file Physical.h.

Point Physical::vibration
protected

Definition at line 181 of file Physical.h.

float Physical::yaw
protected

Definition at line 157 of file Physical.h.

float Physical::yaw_rate
protected

Definition at line 184 of file Physical.h.


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