Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <unit.h>
Public Member Functions | |
GameUnit (int dummy) | |
GameUnit (std::vector< Mesh * > &meshes, bool Subunit, int faction) | |
GameUnit (const char *filename, bool SubUnit, int faction, std::string customizedUnit=std::string(""), Flightgroup *flightgroup=NULL, int fg_subnumber=0, std::string *netxml=NULL) | |
virtual | ~GameUnit () |
int | nummesh () const |
UnitImages< void > & | GetImageInformation () |
bool | RequestClearance (Unit *dockingunit) |
void | UpgradeInterface (Unit *base) |
Loads a user interface for the user to upgrade his ship. More... | |
virtual void | Cloak (bool cloak) |
The name (type) of this unit shouldn't be public. More... | |
void | Split (int level) |
void | FixGauges () |
void | UpdateHudMatrix (int whichcam) |
Sets the camera to be within this unit. More... | |
VSSprite * | getHudImage () const |
What's the HudImage of this unit. More... | |
virtual void | Draw (const Transformation &quat, const Matrix &m) |
Draws this unit with the transformation and matrix (should be equiv) separately. More... | |
virtual void | Draw (const Transformation &quat) |
virtual void | Draw () |
virtual void | DrawNow (const Matrix &m, float lod=1000000000) |
virtual void | DrawNow () |
void | addHalo (const char *filename, const QVector &loc, const Vector &size, const GFXColor &col, std::string halo_type, float halo_speed) |
Deprecated. More... | |
virtual void | applyTechniqueOverrides (const std::map< std::string, std::string > &overrides) |
bool | TransferUnitToSystem (unsigned int whichJumpQueue, StarSystem *&previouslyActiveStarSystem, bool DoSightAndSound) |
bool | Explode (bool draw, float timeit) |
Begin and continue explosion. More... | |
bool | queryFrustum (double frustum[6][4]) const |
*bool | querySphereClickList (int, int, float err, Camera *activeCam) |
virtual void | UpdatePhysics2 (const Transformation &trans, const Transformation &old_physical_state, const Vector &accel, float difficulty, const Matrix &transmat, const Vector &CumulativeVelocity, bool ResolveLast, UnitCollection *uc=NULL) |
returns true if jump possible even if not taken More... | |
void | Thrust (const Vector &amt, bool afterburn=false) |
Thrusts by ammt and clamps accordingly (afterburn or not) More... | |
Vector | ResolveForces (const Transformation &, const Matrix &) |
Resolves forces of given unit on a physics frame. More... | |
virtual void | ArmorDamageSound (const Vector &pnt) |
virtual void | HullDamageSound (const Vector &pnt) |
float | DealDamageToShield (const Vector &pnt, float &Damage) |
applies damage from the given pnt to the shield, and returns % damage applied and applies lighitn More... | |
bool | UpgradeSubUnits (const Unit *up, int subunitoffset, bool touchme, bool downgrade, int &numave, double &percentage) |
double | Upgrade (const std::string &file, int mountoffset, int subunitoffset, bool force, bool loop_through_mounts) |
Matrix | WarpMatrix (const Matrix &ctm) const |
Holds temporary values for inter-function XML communication Saves deprecated restr info. More... | |
Public Attributes | |
double | sparkle_accum |
std::auto_ptr< HaloSystem > | phalos |
Friends | |
class | UnitFactory |
GameUnit contains any physical object that may collide with something And may be physically affected by forces. Units are assumed to have various damage and explode when they are dead. Units may have any number of weapons which, themselves may be units the aistate indicates how the unit will behave in the upcoming phys frame
Definition at line 80 of file unit.cpp.
References Unit::Init().
GameUnit< UnitType >::GameUnit | ( | std::vector< Mesh * > & | meshes, |
bool | Subunit, | ||
int | faction | ||
) |
GameUnit< UnitType >::GameUnit | ( | const char * | filename, |
bool | SubUnit, | ||
int | faction, | ||
std::string | customizedUnit = std::string("") , |
||
Flightgroup * | flightgroup = NULL , |
||
int | fg_subnumber = 0 , |
||
std::string * | netxml = NULL |
||
) |
void GameUnit< UnitType >::addHalo | ( | const char * | filename, |
const QVector & | loc, | ||
const Vector & | size, | ||
const GFXColor & | col, | ||
std::string | halo_type, | ||
float | halo_speed | ||
) |
|
virtual |
Definition at line 619 of file unit.cpp.
References Technique::Pass::getNumShaderParams(), Technique::Pass::getShaderParam(), Technique::Pass::ShaderParam::name, override, parseFloat4(), and Technique::Pass::ShaderParam::value.
Definition at line 152 of file unit_damage.h.
References _Universe, AUDCreateSoundWAV(), AUDIsPlaying(), AUDPlay(), AUDStopPlaying(), VegaConfig::getVariable(), Universe::isPlayerStarship(), XMLSupport::parse_bool(), and vs_config.
The name (type) of this unit shouldn't be public.
Definition at line 156 of file unit.cpp.
References UnitUtil::isPlayerStarship(), Network, NetClient::sendCloak(), and SERVER.
float GameUnit< UnitType >::DealDamageToShield | ( | const Vector & | pnt, |
float & | Damage | ||
) |
applies damage from the given pnt to the shield, and returns % damage applied and applies lighitn
Definition at line 193 of file unit_damage.h.
References _Universe, AUDCreateSoundWAV(), AUDIsPlaying(), AUDPlay(), AUDStopPlaying(), VegaConfig::getVariable(), Universe::isPlayerStarship(), XMLSupport::parse_bool(), and vs_config.
|
virtual |
Draws this unit with the transformation and matrix (should be equiv) separately.
this is the final, smoothly calculated cam
Reimplemented in AtmosphereHalo, and GamePlanet.
Definition at line 333 of file unit.cpp.
References _Universe, Universe::AccessCamera(), Universe::AccessCockpit(), Universe::activeStarSystem(), AUDAdjustSound(), weapon_info::AUTOTRACKING, weapon_info::BEAM, calc_blend_factor(), CalculateOrientation(), cam_setup_phase, cloakVal(), Transformation::Compose(), Unit::computer, Unit::cur_sim_queue_slot, d, damagelevel, game_data_t::detaillevel, GameUnit< UnitType >::Draw(), Mesh::Draw(), GameUnit< UnitType >::Explode(), StarSystemGent::faction, flickerDamage(), float, g_game, StarSystem::getCurrentSimFrame(), GetElapsedTime(), Camera::GetNebula(), Matrix::getP(), Cockpit::GetParent(), Camera::GetPosition(), Matrix::getQ(), Matrix::getR(), VegaConfig::getVariable(), Camera::GetVelocity(), GFXSphereInFrustum(), i, int, interpolation_blend_factor, LaunchOneParticle(), linear_interpolate(), Magnitude(), GameUnit< UnitType >::nummesh(), ONE, Matrix::p, XMLSupport::parse_bool(), XMLSupport::parse_float(), perspectiveFactor(), GameUnit< UnitType >::phalos, q, QVector, Unit::Computer::radar, Mesh::rSize(), saved_interpolation_blend_factor, ScaleMatrix(), Mesh::setCurrentFrame(), Cockpit::SetupViewPort(), Unit::sim_atom_multiplier, SIMULATION_ATOM, size, GameUnit< UnitType >::sparkle_accum, Unit::Target(), Unit::Computer::RADARLIM::trackingcone, Transform(), Mount::UNCHOSEN, Vector, VectorAndPositionToMatrix(), vs_config, GameUnit< UnitType >::WarpMatrix(), and game_data_t::znear.
|
virtual |
Definition at line 582 of file unit.cpp.
References GameUnit< UnitType >::Draw(), and identity_matrix().
|
virtual |
Definition at line 588 of file unit.cpp.
References identity_matrix(), and identity_transformation().
Referenced by GamePlanet::Draw(), AtmosphereHalo::Draw(), and GameUnit< UnitType >::Draw().
|
virtual |
Definition at line 219 of file unit.cpp.
References _Universe, Universe::AccessCamera(), CalculateOrientation(), cloakVal(), Transformation::Compose(), Unit::curr_physical_state, d, damagelevel, game_data_t::detaillevel, Mesh::Draw(), GameUnit< UnitType >::DrawNow(), StarSystemGent::faction, float, Transformation::from_matrix(), g_game, Camera::GetNebula(), Camera::GetPosition(), Matrix::getR(), VegaConfig::getVariable(), GFXSphereInFrustum(), i, int, Magnitude(), MultMatrix(), GameUnit< UnitType >::nummesh(), Matrix::p, XMLSupport::parse_bool(), perspectiveFactor(), GameUnit< UnitType >::phalos, Mesh::ProcessUndrawnMeshes(), Mesh::ProcessZFarMeshes(), q, QVector, Mesh::rSize(), ScaleMatrix(), Mesh::setCurrentFrame(), Transformation::to_matrix(), Transform(), Mount::UNCHOSEN, Vector, VectorAndPositionToMatrix(), vs_config, GameUnit< UnitType >::WarpMatrix(), and game_data_t::znear.
|
virtual |
Definition at line 325 of file unit.cpp.
References identity_matrix().
Referenced by GameUnit< UnitType >::DrawNow().
Begin and continue explosion.
Definition at line 227 of file unit_damage.h.
References _Universe, Universe::AccessCockpit(), Universe::activeStarSystem(), AddAnimation(), StarSystem::AddMissileToQueue(), AUDPlay(), BILINEAR, bleh, BaseInterface::CurrentBase, Mission::DirectorShipDestroyed(), disableSubUnits(), Unit::Explode(), UnitImages< BOGUS >::explosion_type, StarSystemGent::faction, Unit::GetImageInformation(), getNewTime(), Cockpit::GetParent(), FactionUtil::GetRandExplosionAnimation(), getRandomCachedAniString(), Unit::getRelation(), FactionUtil::GetUpgradeFaction(), VegaConfig::getVariable(), GetVolatileAni(), i, Universe::isPlayerStarship(), lasttime, Music::LOSSLIST, MIPMAP, MISSILEPTR, mission, muzak, newtime, XMLSupport::parse_bool(), XMLSupport::parse_float(), UnitImages< BOGUS >::pExplosion, Unit::Position(), q, QVector, Animation::SetDimensions(), Animation::SetFaceCam(), Animation::SetOrientation(), Music::SkipRandSong(), UNITPTR, Vector, Music::VICTORYLIST, and vs_config.
Referenced by GameUnit< UnitType >::Draw().
void GameUnit< UnitType >::FixGauges | ( | ) |
UnitImages< void >& GameUnit< UnitType >::GetImageInformation | ( | ) |
fils in corner_min,corner_max and radial_size returns -1 if unit cannot dock, otherwise returns which dock it can dock at
Definition at line 173 of file unit_damage.h.
References _Universe, AUDCreateSoundWAV(), AUDIsPlaying(), AUDPlay(), AUDStopPlaying(), VegaConfig::getVariable(), Universe::isPlayerStarship(), XMLSupport::parse_bool(), and vs_config.
Definition at line 114 of file unit.cpp.
Referenced by GameUnit< UnitType >::Draw(), GameUnit< UnitType >::DrawNow(), and GameUnit< UnitType >::queryFrustum().
Updates the collide Queue with any possible change in sectors Queries if this unit is within a given frustum
Definition at line 170 of file unit.cpp.
References GFXSphereInFrustum(), i, GameUnit< UnitType >::nummesh(), Transform(), and Vector.
bool GameUnit< UnitType >::querySphereClickList | ( | int | mouseX, |
int | mouseY, | ||
float | err, | ||
Camera * | activeCam | ||
) |
Queries the bounding sphere with a duo of mouse coordinates that project to the center of a ship and compare with a sphere...pretty fast
Definition at line 13 of file unit_click.h.
References _Universe, Universe::AccessCamera(), Camera::GetPosition(), Camera::GetPQR(), Camera::GetView(), i, MouseCoordinate(), Transform(), and Vector.
Vector GameUnit< UnitType >::ResolveForces | ( | const Transformation & | trans, |
const Matrix & | transmat | ||
) |
Resolves forces of given unit on a physics frame.
Definition at line 177 of file unit_physics.h.
References AUDAdjustSound(), and Unit::ResolveForces().
Process all meshes to be deleted Split this mesh with into 2^level submeshes at arbitrary planes
Definition at line 37 of file unit_damage.h.
References AddMeshes(), Unit::ApplyForce(), Unit::ApplyLocalTorque(), UnitFactory::createUnit(), VSFileSystem::current_path, VSFileSystem::current_subdirectory, VSFileSystem::current_type, StarSystemGent::faction, FactionUtil::GetFaction(), Unit::GetMass(), Unit::GetMoment(), CSVRow::getRoot(), VegaConfig::getVariable(), Unit::hull, i, int, j, k, BeamXML::level, LookupUnitRow(), UniverseUtil::LookupUnitStat(), Unit::Mass, Unit::meshdata, Unit::name, ONE, XMLSupport::parse_bool(), XMLSupport::parse_float(), Unit::pImage, split(), CSVRow::success(), UnitImages< BOGUS >::timeexplode, XMLSupport::tostring(), VSFileSystem::UnitFile, Vector, and vs_config.
void GameUnit< UnitType >::Thrust | ( | const Vector & | amt, |
bool | afterburn = false |
||
) |
Thrusts by ammt and clamps accordingly (afterburn or not)
Definition at line 126 of file unit_physics.h.
References _Universe, Universe::AccessCockpit(), AUDCreateSound(), AUDIsPlaying(), AUDPlay(), AUDStopPlaying(), UnitUtil::getDistance(), getNewTime(), Cockpit::GetParent(), VegaConfig::getVariable(), Unit::GetVelocity(), Universe::isPlayerStarship(), Unit::owner, XMLSupport::parse_bool(), XMLSupport::parse_float(), Unit::Position(), QVector, SIMULATION_ATOM, Unit::Thrust(), Vector, and vs_config.
bool GameUnit< UnitType >::TransferUnitToSystem | ( | unsigned int | whichJumpQueue, |
StarSystem *& | previouslyActiveStarSystem, | ||
bool | DoSightAndSound | ||
) |
eradicating from system, leaving no trace
Definition at line 34 of file unit_jump.h.
References _Universe, Universe::AccessCockpit(), ActivateAnimation(), Unit::ActivateJumpDrive(), Universe::activeStarSystem(), AUDCreateSound(), AUDPlay(), AUDStopAllSounds(), ComparePrimaries(), UnitCollection::createIterator(), DealPossibleJumpDamage(), Flightgroup::directive, Unit::getFlightgroup(), Cockpit::GetParent(), UnitContainer::GetUnit(), StarSystem::getUnitList(), VegaConfig::getVariable(), i, is_null(), Unit::isUnit(), Flightgroup::leader, Unit::LocalPosition(), Unit::location, Magnitude(), pendingjump, Unit::Position(), primary, QVector, Unit::rSize(), Universe::setActiveStarSystem(), StarSystem::SwapOut(), Unit::Target(), Unit::Threat(), Unit::Threaten(), Unit::TransferUnitToSystem(), Unit::UNIT_BOLT, Unit::UNIT_ONLY, UNITPTR, Unit::VelocityReference(), vs_config, VSFileSystem::vs_fprintf(), and WarpPursuit().
Sets the camera to be within this unit.
Definition at line 200 of file unit.cpp.
References _Universe, Universe::AccessCamera(), Matrix::getQ(), Matrix::getR(), q, Camera::SetOrientation(), Camera::SetPosition(), Transform(), and Vector.
|
virtual |
returns true if jump possible even if not taken
Updates physics given unit space transformations and if this is the last physics frame in the current gfx frame
Reimplemented in GameMissile, GameBuilding, GameAsteroid, and GameNebula.
Definition at line 49 of file unit_physics.h.
References _Universe, blah, c, Transformation::from_matrix(), i, NetClient::Interpolate(), MatrixToVectors(), Network, UniverseUtil::networked(), q, queryTime(), NetClient::sendPosition(), SIMULATION_ATOM, TransformNormal(), Vector, and Universe::whichPlayerStarship().
Referenced by GameAsteroid::UpdatePhysics2(), GameNebula::UpdatePhysics2(), GameBuilding::UpdatePhysics2(), and GameMissile::UpdatePhysics2().
double GameUnit< UnitType >::Upgrade | ( | const std::string & | file, |
int | mountoffset, | ||
int | subunitoffset, | ||
bool | force, | ||
bool | loop_through_mounts | ||
) |
Definition at line 42 of file unit_customize.h.
References Unit::Upgrade().
Loads a user interface for the user to upgrade his ship.
Definition at line 120 of file unit.cpp.
References getCargoUnitName(), Unit::getFullname(), Unit::isUnit(), BaseUtil::LoadBaseInterfaceAtDock(), Unit::name, and PLANETPTR.
bool GameUnit< UnitType >::UpgradeSubUnits | ( | const Unit * | up, |
int | subunitoffset, | ||
bool | touchme, | ||
bool | downgrade, | ||
int & | numave, | ||
double & | percentage | ||
) |
Definition at line 26 of file unit_customize.h.
References CreateGameTurret(), UnitCollection::empty(), and Unit::SubUnits.
Holds temporary values for inter-function XML communication Saves deprecated restr info.
Definition at line 658 of file unit.cpp.
References VegaConfig::getVariable(), k, StarSystemGent::maxspeed, XMLSupport::parse_bool(), XMLSupport::parse_float(), ScaleMatrix(), speed, Vector, and vs_config.
Referenced by GameUnit< UnitType >::Draw(), and GameUnit< UnitType >::DrawNow().
|
friend |
std::auto_ptr< HaloSystem > GameUnit< UnitType >::phalos |
Definition at line 90 of file unit.h.
Referenced by GameUnit< UnitType >::addHalo(), GameUnit< UnitType >::Draw(), and GameUnit< UnitType >::DrawNow().
double GameUnit< UnitType >::sparkle_accum |
Definition at line 89 of file unit.h.
Referenced by GameUnit< UnitType >::Draw().