Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <unit_generic.h>
Classes | |
union | REF |
Public Types | |
enum | MOUNTSTATUS { REQUESTED, ACCEPTED, PROCESSED, UNFIRED, FIRED } |
enum | STATUS { ACTIVE, INACTIVE, DESTROYED, UNCHOSEN } |
Public Member Functions | |
float | ComputeAnimatedFrame (Mesh *gun) |
void | ReplaceMounts (Unit *unit, const Mount *other) |
double | Percentage (const Mount *newammo) const |
Mount () | |
Mount (const std::string &name, int ammo, int volume, float xyscale, float zscale, float functionality, float maxfunctionality, bool banked) | |
void | Activate (bool Missile) |
void | DeActive (bool Missile) |
Sets this gun to inactive, unless unchosen or destroyed. More... | |
void | SetMountPosition (const Vector &) |
void | SetMountOrientation (const Quaternion &) |
const Vector & | GetMountLocation () const |
const Quaternion & | GetMountOrientation () const |
void | UnFire () |
void | PhysicsAlignedUnfire () |
bool | PhysicsAlignedFire (Unit *caller, const Transformation &Cumulative, const Matrix &mat, const Vector &Velocity, void *owner, Unit *target, signed char autotrack, float trackingcone, CollideMap::iterator hint[]) |
bool | NextMountCloser (Mount *nextmount, Unit *) |
bool | Fire (Unit *firer, void *owner, bool Missile=false, bool collide_only_with_target=false) |
bool | IsEmpty () const |
Public Attributes | |
ObjSerial | serial |
float | xyscale |
float | zscale |
union Mount::REF | ref |
unsigned int | size |
int | ammo |
int | volume |
enum Mount::MOUNTSTATUS | processed |
enum Mount::STATUS | status |
bool | bank |
const weapon_info * | type |
float | functionality |
float | maxfunctionality |
int | sound |
float | time_to_lock |
Protected Member Functions | |
void | ReplaceSound () |
Protected Attributes | |
Vector | pos |
Quaternion | orient |
double | last_sound_refire_time |
Definition at line 108 of file unit_generic.h.
enum Mount::MOUNTSTATUS |
enum Mount::STATUS |
Mount::Mount | ( | ) |
Definition at line 23 of file mount.cpp.
References ammo, weapon_info::BEAM, functionality, VegaConfig::getVariable(), last_sound_refire_time, maxfunctionality, weapon_info::NOWEAP, XMLSupport::parse_float(), PROCESSED, processed, serial, size, sound, status, type, UNCHOSEN, vs_config, xyscale, and zscale.
Mount::Mount | ( | const std::string & | name, |
int | ammo, | ||
int | volume, | ||
float | xyscale, | ||
float | zscale, | ||
float | functionality, | ||
float | maxfunctionality, | ||
bool | banked | ||
) |
void Mount::Activate | ( | bool | Missile) |
Definition at line 5373 of file unit_generic.cpp.
References isMissile().
Definition at line 50 of file mount.cpp.
References weapon_info::BEAM, Mesh::getFramesPerSecond(), getNewTime(), Mount::REF::gun, interpolation_blend_factor, Beam::Ready(), ref, weapon_info::Refire(), Mount::REF::refire, Beam::refireTime(), SIMULATION_ATOM, weapon_info::type, and type.
void Mount::DeActive | ( | bool | Missile) |
Sets this gun to inactive, unless unchosen or destroyed.
Definition at line 5381 of file unit_generic.cpp.
References isMissile().
bool Mount::Fire | ( | Unit * | firer, |
void * | owner, | ||
bool | Missile = false , |
||
bool | collide_only_with_target = false |
||
) |
Definition at line 448 of file mount.cpp.
References _Universe, Universe::AccessCockpit(), ACTIVE, ammo, weapon_info::BEAM, FIRED, forcefeedback, Cockpit::GetParent(), Mount::REF::gun, isMissile(), Beam::ListenToOwner(), orient, ForceFeedback::playLaser(), pos, processed, Beam::Ready(), ref, weapon_info::Refire(), Mount::REF::refire, sound, status, weapon_info::type, type, and UNFIRED.
Referenced by Unit::Fire().
|
inline |
Definition at line 171 of file unit_generic.h.
References pos.
Referenced by UnitWrapper::GetMountInfo(), and ReplaceMounts().
|
inline |
Definition at line 175 of file unit_generic.h.
References orient.
Referenced by UnitWrapper::GetMountInfo(), and ReplaceMounts().
|
inline |
Definition at line 199 of file unit_generic.h.
References ACTIVE, INACTIVE, and status.
Referenced by UnitWrapper::GetMountInfo().
Definition at line 431 of file mount.cpp.
References Matrix::getR(), Unit::LocalCoordinates(), orient, pos, Unit::Target(), Quaternion::to_matrix(), and Vector.
Referenced by Unit::Fire().
double Mount::Percentage | ( | const Mount * | newammo) | const |
Definition at line 147 of file mount.cpp.
References ammo, weapon_info::Damage, DESTROYED, weapon_info::PhaseDamage, weapon_info::Range, status, type, UNCHOSEN, and weapon_info::weapon_name.
bool Mount::PhysicsAlignedFire | ( | Unit * | caller, |
const Transformation & | Cumulative, | ||
const Matrix & | mat, | ||
const Vector & | Velocity, | ||
void * | owner, | ||
Unit * | target, | ||
signed char | autotrack, | ||
float | trackingcone, | ||
CollideMap::iterator | hint[] | ||
) |
Definition at line 190 of file mount.cpp.
References _Universe, Universe::activeStarSystem(), StarSystem::AddUnit(), AdjustMatrix(), VSFileSystem::AiFile, ammo, AUDAdjustSound(), AUDCreateSound(), AUDDeleteSound(), AUDIsPlaying(), AUDListenerLocation(), AUDPlay(), AUDSoundGain(), AUDStopPlaying(), weapon_info::AUTOTRACKING, weapon_info::BALL, weapon_info::BEAM, weapon_info::BOLT, Transformation::Compose(), CopyMatrix(), CP_RIGHT, UnitFactory::createMissile(), UnitFactory::createUnit(), Unit::cumulative_transformation, Unit::cumulative_transformation_matrix, Unit::curr_physical_state, weapon_info::Damage, Flightgroup::directive, Unit::energy, weapon_info::EnergyRate, Unit::EnqueueAI(), Unit::faction, weapon_info::file, FIRED, Unit::GetComputerData(), FactionUtil::GetFactionName(), Unit::getFlightgroup(), GetMadAt(), Unit::getRelation(), VegaConfig::getVariable(), Unit::GetVelocity(), Mount::REF::gun, i, Beam::Init(), is_null(), isMissile(), Universe::isPlayerStarshipVoid(), Unit::isSubUnit(), last_sound_refire_time, Bolt::location, Unit::location, weapon_info::LockTime, VSFileSystem::LookForFile(), Unit::Computer::max_combat_ab_speed, Unit::Computer::max_combat_speed, mission, Flightgroup::name, Network, Flightgroup::newFlightgroup(), Flightgroup::nr_ships, Flightgroup::nr_ships_left, Unit::NUM_COLLIDE_MAPS, weapon_info::offset, VSFileSystem::Ok, orient, Unit::owner, Matrix::p, XMLSupport::parse_bool(), XMLSupport::parse_float(), weapon_info::PhaseDamage, pos, Unit::prev_physical_state, PROCESSED, processed, weapon_info::PROJECTILE, weapon_info::PulseSpeed, QVector, Matrix::r, weapon_info::RadialSpeed, weapon_info::Radius, weapon_info::Range, realTime(), ref, weapon_info::Refire(), Mount::REF::refire, serial, SERVER, Unit::SetOwner(), Unit::SetSerial(), Unit::SetTurretAI(), UnitContainer::SetUnit(), Unit::SetVelocity(), size, sound, weapon_info::Speed, Flightgroup::target, Unit::Target(), Unit::TargetTurret(), time_to_lock, Transform(), Unit::TurretFAW(), weapon_info::type, type, Unit::UNIT_BOLT, weapon_info::UNKNOWN, Unit::UpdateCollideQueue(), Vector, Unit::Velocity, Unit::Computer::velocity_ref, vs_config, and VSFileSystem::vs_dprintf().
void Mount::PhysicsAlignedUnfire | ( | ) |
Fires a beam when the firing unit is at the Cumulative location/transformation owner (won't crash into) as owner and target as missile target. bool Missile indicates if it is a missile should it fire
Definition at line 475 of file mount.cpp.
References AUDIsPlaying(), AUDStopPlaying(), processed, sound, and UNFIRED.
Definition at line 120 of file mount.cpp.
References ammo, bank, weapon_info::BEAM, GetMountLocation(), GetMountOrientation(), Mount::REF::gun, q, ref, weapon_info::Refire(), Mount::REF::refire, ReplaceSound(), Unit::setAverageGunSpeed(), SetMountOrientation(), SetMountPosition(), size, weapon_info::type, type, v, Vector, volume, xyscale, and zscale.
|
protected |
Definition at line 483 of file mount.cpp.
References AUDCreateSound(), and sound.
Referenced by ReplaceMounts().
void Mount::SetMountOrientation | ( | const Quaternion & | t) |
Definition at line 74 of file unit_generic.cpp.
Referenced by AddMounts(), and ReplaceMounts().
void Mount::SetMountPosition | ( | const Vector & | v) |
Definition at line 69 of file unit_generic.cpp.
References v.
Referenced by AddMounts(), and ReplaceMounts().
void Mount::UnFire | ( | ) |
Definition at line 112 of file mount.cpp.
References ACTIVE, weapon_info::BEAM, Beam::Destabilize(), Mount::REF::gun, processed, ref, status, weapon_info::type, type, and UNFIRED.
Referenced by DestroyMount(), and Unit::Fire().
int Mount::ammo |
Definition at line 138 of file unit_generic.h.
Referenced by Fire(), Unit::Fire(), UnitWrapper::GetMountInfo(), Mount(), MountColor(), Percentage(), PhysicsAlignedFire(), ReplaceMounts(), and Unit::UpgradeMounts().
bool Mount::bank |
Definition at line 146 of file unit_generic.h.
Referenced by Unit::Fire(), UnitWrapper::GetMountInfo(), and ReplaceMounts().
float Mount::functionality |
Definition at line 149 of file unit_generic.h.
Referenced by UnitWrapper::GetMountInfo(), Mount(), and MountColor().
|
protected |
Definition at line 114 of file unit_generic.h.
Referenced by Mount(), and PhysicsAlignedFire().
float Mount::maxfunctionality |
Definition at line 150 of file unit_generic.h.
Referenced by UnitWrapper::GetMountInfo(), and Mount().
|
protected |
Definition at line 113 of file unit_generic.h.
Referenced by Fire(), GetMountOrientation(), NextMountCloser(), and PhysicsAlignedFire().
|
protected |
Definition at line 112 of file unit_generic.h.
Referenced by Fire(), GetMountLocation(), NextMountCloser(), and PhysicsAlignedFire().
enum Mount::MOUNTSTATUS Mount::processed |
Referenced by Fire(), Unit::Fire(), Mount(), PhysicsAlignedFire(), PhysicsAlignedUnfire(), and UnFire().
union Mount::REF Mount::ref |
Referenced by ComputeAnimatedFrame(), Fire(), Unit::Fire(), MountColor(), PhysicsAlignedFire(), ReplaceMounts(), and UnFire().
ObjSerial Mount::serial |
Definition at line 118 of file unit_generic.h.
Referenced by Unit::Fire(), Mount(), and PhysicsAlignedFire().
unsigned int Mount::size |
Definition at line 136 of file unit_generic.h.
Referenced by AddMounts(), Unit::Fire(), UnitWrapper::GetMountInfo(), Mount(), PhysicsAlignedFire(), and ReplaceMounts().
int Mount::sound |
Definition at line 151 of file unit_generic.h.
Referenced by DestroyMount(), Fire(), Mount(), PhysicsAlignedFire(), PhysicsAlignedUnfire(), and ReplaceSound().
enum Mount::STATUS Mount::status |
Referenced by DestroyMount(), Fire(), Unit::Fire(), UnitWrapper::GetMountInfo(), IsEmpty(), Mount(), MountColor(), Percentage(), and UnFire().
float Mount::time_to_lock |
Definition at line 153 of file unit_generic.h.
Referenced by Unit::Fire(), and PhysicsAlignedFire().
const weapon_info* Mount::type |
Definition at line 148 of file unit_generic.h.
Referenced by AddMounts(), ComputeAnimatedFrame(), Fire(), Unit::Fire(), UnitWrapper::GetMountInfo(), WeaponComparator< FORWARD >::isSpecial(), Mount(), MountColor(), Percentage(), UnitUtil::PercentOperational(), PhysicsAlignedFire(), Unit::RepairUpgradeCargo(), ReplaceMounts(), UnFire(), and Unit::UpgradeMounts().
int Mount::volume |
Definition at line 139 of file unit_generic.h.
Referenced by UnitWrapper::GetMountInfo(), and ReplaceMounts().
float Mount::xyscale |
Definition at line 120 of file unit_generic.h.
Referenced by UnitWrapper::GetMountInfo(), Mount(), and ReplaceMounts().
float Mount::zscale |
Definition at line 121 of file unit_generic.h.
Referenced by UnitWrapper::GetMountInfo(), Mount(), and ReplaceMounts().