vegastrike  0.5.1.r1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StarSystem Class Reference

#include <star_system_generic.h>

Inheritance diagram for StarSystem:
GameStarSystem

Classes

struct  StarXML
 Starsystem XML Struct For use with XML loading. More...
 
struct  Statistics
 

Public Member Functions

 StarSystem ()
 
 StarSystem (const char *filename, const Vector &centroid=Vector(0, 0, 0), const float timeofyear=0)
 
virtual ~StarSystem ()
 
void SetZone (unsigned int zonenum)
 
unsigned int GetZone ()
 
virtual void AddMissileToQueue (class MissileEffect *)
 
virtual void UpdateMissiles ()
 
void UpdateUnitPhysics (bool firstframe)
 
void RequestPhysics (Unit *un, unsigned int queue)
 Requeues the unit so that it is simulated ASAP. More...
 
virtual void activateLightMap (int stage=1)
 
virtual Texture * getLightMap ()
 
virtual unsigned int numTerrain ()
 activates the light map texture More...
 
virtual unsigned int numContTerrain ()
 
virtual void Draw (bool DrawCockpit=true)
 Draws a frame of action, interpolating between physics frames. More...
 
void Update (float priority, bool executeDirector)
 update a simulation atom ExecuteDirector must be false if star system is just loaded before mission is loaded More...
 
void Update (float priority)
 
virtual void SwapIn ()
 re-enables the included lights and terrains More...
 
virtual void SwapOut ()
 Disables included lights and terrains. More...
 
virtual Terrain * getTerrain (unsigned int which)
 
virtual ContinuousTerrain * getContTerrain (unsigned int which)
 
virtual Background * getBackground ()
 
virtual ClickList * getClickList ()
 
unsigned int getCurrentSimFrame () const
 Gets the current simulation frame. More...
 
void ExecuteUnitAI ()
 
std::string getFileName () const
 
std::string getName ()
 
UnitCollection & getUnitList ()
 Loads the star system from an XML file. More...
 
UnitCollection & gravitationalUnits ()
 
Unit * nextSignificantUnit ()
 
void AddUnit (Unit *unit)
 
returns xy sorted bounding spheres of all units in current view

Adds to draw list More...

 
bool RemoveUnit (Unit *unit)
 Removes from draw list. More...
 
bool JumpTo (Unit *unit, Unit *jumppoint, const std::string &system, bool force=false, bool save_coordinates=false)
 
virtual void VolitalizeJumpAnimation (const int ani)
 
virtual void DoJumpingComeSightAndSound (Unit *un)
 
virtual int DoJumpingLeaveSightAndSound (Unit *un)
 
virtual void createBackground (StarSystem::StarXML *xml)
 

Static Public Member Functions

static void beginElement (void *userData, const XML_Char *name, const XML_Char **atts)
 
static void endElement (void *userData, const XML_Char *name)
 
static void ProcessPendingJumps ()
 

Public Attributes

struct StarSystem::Statistics stats
 
std::multimap< Unit *, Unit * > last_collisions
 
class CollideTable * collidetable
 
CollideMap * collidemap [2]
 
class bolt_draw * bolts
 

Protected Types

enum  PHYSICS_STAGE { MISSION_SIMULATION, PROCESS_UNIT, PHY_NUM }
 Physics is divided into 3 stages spread over 3 frames. More...
 

Protected Member Functions

void LoadXML (const char *, const Vector &centroid, const float timeofyear)
 
void beginElement (const std::string &name, const AttributeList &attributes)
 
void endElement (const std::string &name)
 
void AddStarsystemToUniverse (const std::string &filename)
 The Light Map corresponding for the BP for spheremapping. More...
 
void RemoveStarsystemFromUniverse ()
 

Protected Attributes

struct StarSystem::StarXMLxml
 
enum StarSystem::PHYSICS_STAGE current_stage
 
std::vector< Terrain * > terrains
 Stars, planets, etc. Orbital mechanics precalculated. More...
 
std::vector< ContinuousTerrain * > contterrains
 
UnitCollection drawList
 Everything to be drawn. Folded missiles in here oneday. More...
 
UnitCollection GravitationalUnits
 
UnitCollection physics_buffer [SIM_QUEUE_SIZE+1]
 
unsigned int current_sim_location
 
unsigned char no_collision_time
 Objects subject to global gravitron physics (disabled) More...
 
char * name
 system name More...
 
std::string filename
 
un_iter sigIter
 
double time
 to track the next given physics frame More...
 
Stars * stars
 The background associated with this system. More...
 
int lightcontext
 
std::vector< class
MissileEffect * > 
dischargedMissiles
 
unsigned int zone
 

Friends

class Universe
 

Detailed Description

Definition at line 53 of file star_system_generic.h.

Member Enumeration Documentation

enum StarSystem::PHYSICS_STAGE
protected

Physics is divided into 3 stages spread over 3 frames.

Enumerator
MISSION_SIMULATION 
PROCESS_UNIT 
PHY_NUM 

Definition at line 113 of file star_system_generic.h.

Constructor & Destructor Documentation

StarSystem::StarSystem ( )

adds to jumping table;

Definition at line 73 of file star_system_generic.cpp.

StarSystem::StarSystem ( const char *  filename,
const Vector &  centroid = Vector( 0, 0, 0 ),
const float  timeofyear = 0 
)

adds to jumping table;

Definition at line 91 of file star_system_generic.cpp.

StarSystem::~StarSystem ( )
virtual

Definition at line 117 of file star_system_generic.cpp.

Member Function Documentation

virtual void StarSystem::activateLightMap ( int  stage = 1)
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 163 of file star_system_generic.h.

virtual void StarSystem::AddMissileToQueue ( class MissileEffect *  )
virtual
void StarSystem::AddStarsystemToUniverse ( const std::string &  filename)
protected

The Light Map corresponding for the BP for spheremapping.

Definition at line 775 of file star_system_generic.cpp.

void StarSystem::AddUnit ( Unit *  unit)

returns xy sorted bounding spheres of all units in current view

Adds to draw list

Definition at line 230 of file star_system_generic.cpp.

void StarSystem::beginElement ( const std::string &  name,
const AttributeList attributes 
)
protected
void StarSystem::beginElement ( void *  userData,
const XML_Char *  name,
const XML_Char **  atts 
)
static

Definition at line 209 of file star_system_generic.cpp.

virtual void StarSystem::createBackground ( StarSystem::StarXML xml)
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 242 of file star_system_generic.h.

virtual void StarSystem::DoJumpingComeSightAndSound ( Unit *  un)
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 236 of file star_system_generic.h.

virtual int StarSystem::DoJumpingLeaveSightAndSound ( Unit *  un)
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 237 of file star_system_generic.h.

virtual void StarSystem::Draw ( bool  DrawCockpit = true)
inlinevirtual

Draws a frame of action, interpolating between physics frames.

Reimplemented in GameStarSystem.

Definition at line 178 of file star_system_generic.h.

void StarSystem::endElement ( const std::string &  name)
protected
void StarSystem::endElement ( void *  userData,
const XML_Char *  name 
)
static

Definition at line 214 of file star_system_generic.cpp.

void StarSystem::ExecuteUnitAI ( )

Definition at line 300 of file star_system_generic.cpp.

virtual Background* StarSystem::getBackground ( )
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 195 of file star_system_generic.h.

virtual ClickList* StarSystem::getClickList ( )
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 199 of file star_system_generic.h.

virtual ContinuousTerrain* StarSystem::getContTerrain ( unsigned int  which)
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 191 of file star_system_generic.h.

unsigned int StarSystem::getCurrentSimFrame ( ) const
inline

Gets the current simulation frame.

Definition at line 204 of file star_system_generic.h.

string StarSystem::getFileName ( ) const

Definition at line 220 of file star_system_generic.cpp.

virtual Texture* StarSystem::getLightMap ( )
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 164 of file star_system_generic.h.

string StarSystem::getName ( )

Definition at line 225 of file star_system_generic.cpp.

virtual Terrain* StarSystem::getTerrain ( unsigned int  which)
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 187 of file star_system_generic.h.

UnitCollection& StarSystem::getUnitList ( )
inline

Loads the star system from an XML file.

Definition at line 219 of file star_system_generic.h.

unsigned int StarSystem::GetZone ( )
inline

Definition at line 153 of file star_system_generic.h.

UnitCollection& StarSystem::gravitationalUnits ( )
inline

Definition at line 223 of file star_system_generic.h.

bool StarSystem::JumpTo ( Unit *  unit,
Unit *  jumppoint,
const std::string &  system,
bool  force = false,
bool  save_coordinates = false 
)

Definition at line 927 of file star_system_generic.cpp.

void StarSystem::LoadXML ( const char *  filename,
const Vector &  centroid,
const float  timeofyear 
)
protected

Definition at line 1498 of file star_system_xml.cpp.

Unit * StarSystem::nextSignificantUnit ( )

Definition at line 654 of file star_system_generic.cpp.

virtual unsigned int StarSystem::numContTerrain ( )
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 173 of file star_system_generic.h.

virtual unsigned int StarSystem::numTerrain ( )
inlinevirtual

activates the light map texture

Reimplemented in GameStarSystem.

Definition at line 169 of file star_system_generic.h.

void StarSystem::ProcessPendingJumps ( )
static

Definition at line 804 of file star_system_generic.cpp.

void StarSystem::RemoveStarsystemFromUniverse ( )
protected

Definition at line 780 of file star_system_generic.cpp.

bool StarSystem::RemoveUnit ( Unit *  unit)

Removes from draw list.

Definition at line 258 of file star_system_generic.cpp.

void StarSystem::RequestPhysics ( Unit *  un,
unsigned int  queue 
)

Requeues the unit so that it is simulated ASAP.

Definition at line 484 of file star_system_generic.cpp.

void StarSystem::SetZone ( unsigned int  zonenum)
inline

Definition at line 149 of file star_system_generic.h.

virtual void StarSystem::SwapIn ( )
inlinevirtual

re-enables the included lights and terrains

Reimplemented in GameStarSystem.

Definition at line 184 of file star_system_generic.h.

virtual void StarSystem::SwapOut ( )
inlinevirtual

Disables included lights and terrains.

Reimplemented in GameStarSystem.

Definition at line 186 of file star_system_generic.h.

void StarSystem::Update ( float  priority,
bool  executeDirector 
)

update a simulation atom ExecuteDirector must be false if star system is just loaded before mission is loaded

this makes it so systems without players may be simulated less accurately

just be sure to restore this at the end

Definition at line 689 of file star_system_generic.cpp.

void StarSystem::Update ( float  priority)

Definition at line 659 of file star_system_generic.cpp.

virtual void StarSystem::UpdateMissiles ( )
virtual
void StarSystem::UpdateUnitPhysics ( bool  firstframe)

Definition at line 498 of file star_system_generic.cpp.

virtual void StarSystem::VolitalizeJumpAnimation ( const int  ani)
inlinevirtual

Reimplemented in GameStarSystem.

Definition at line 235 of file star_system_generic.h.

Friends And Related Function Documentation

friend class Universe
friend

Definition at line 142 of file star_system_generic.h.

Member Data Documentation

class bolt_draw* StarSystem::bolts

Definition at line 213 of file star_system_generic.h.

CollideMap* StarSystem::collidemap[2]

Definition at line 212 of file star_system_generic.h.

class CollideTable* StarSystem::collidetable

Definition at line 210 of file star_system_generic.h.

std::vector< ContinuousTerrain* > StarSystem::contterrains
protected

Definition at line 120 of file star_system_generic.h.

unsigned int StarSystem::current_sim_location
protected

Definition at line 125 of file star_system_generic.h.

enum StarSystem::PHYSICS_STAGE StarSystem::current_stage
protected
std::vector< class MissileEffect* > StarSystem::dischargedMissiles
protected

Definition at line 144 of file star_system_generic.h.

UnitCollection StarSystem::drawList
protected

Everything to be drawn. Folded missiles in here oneday.

Definition at line 122 of file star_system_generic.h.

std::string StarSystem::filename
protected

Definition at line 130 of file star_system_generic.h.

UnitCollection StarSystem::GravitationalUnits
protected

Definition at line 123 of file star_system_generic.h.

std::multimap< Unit*, Unit* > StarSystem::last_collisions

Definition at line 147 of file star_system_generic.h.

int StarSystem::lightcontext
protected

Definition at line 143 of file star_system_generic.h.

char* StarSystem::name
protected

system name

Definition at line 129 of file star_system_generic.h.

unsigned char StarSystem::no_collision_time
protected

Objects subject to global gravitron physics (disabled)

Definition at line 127 of file star_system_generic.h.

UnitCollection StarSystem::physics_buffer[SIM_QUEUE_SIZE+1]
protected

Definition at line 124 of file star_system_generic.h.

un_iter StarSystem::sigIter
protected

Definition at line 131 of file star_system_generic.h.

Stars* StarSystem::stars
protected

The background associated with this system.

The moving, fading stars

Definition at line 137 of file star_system_generic.h.

struct StarSystem::Statistics StarSystem::stats
std::vector< Terrain* > StarSystem::terrains
protected

Stars, planets, etc. Orbital mechanics precalculated.

Definition at line 119 of file star_system_generic.h.

double StarSystem::time
protected

to track the next given physics frame

Definition at line 133 of file star_system_generic.h.

struct StarSystem::StarXML * StarSystem::xml
protected
unsigned int StarSystem::zone
protected

Definition at line 145 of file star_system_generic.h.


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