codemp/game/bg_vehicles.h File Reference

#include "q_shared.h"
#include "../namespace_begin.h"
#include "../namespace_end.h"

Go to the source code of this file.

Data Structures

struct  turretStats_t
struct  Vehicle_s
struct  vehicleInfo_t
struct  vehTurretStatus_t
struct  vehWeaponInfo_t
struct  vehWeaponStats_t
struct  vehWeaponStatus_t

Defines

#define NUM_VWEAP_PARMS   25
#define VWFOFS(x)   ((int)&(((vehWeaponInfo_t *)0)->x))
#define MAX_VEH_WEAPONS   16
#define VEH_WEAPON_BASE   0
#define VEH_WEAPON_NONE   -1
#define MAX_VEHICLE_MUZZLES   12
#define MAX_VEHICLE_EXHAUSTS   12
#define MAX_VEHICLE_WEAPONS   2
#define MAX_VEHICLE_TURRETS   2
#define MAX_VEHICLE_TURRET_MUZZLES   2
#define VFOFS(x)   ((int)&(((vehicleInfo_t *)0)->x))
#define MAX_VEHICLES   16
#define VEHICLE_BASE   0
#define VEHICLE_NONE   -1
#define VEH_DEFAULT_SPEED_MAX   800.0f
#define VEH_DEFAULT_ACCEL   10.0f
#define VEH_DEFAULT_DECEL   10.0f
#define VEH_DEFAULT_STRAFE_PERC   0.5f
#define VEH_DEFAULT_BANKING_SPEED   0.5f
#define VEH_DEFAULT_ROLL_LIMIT   60.0f
#define VEH_DEFAULT_PITCH_LIMIT   90.0f
#define VEH_DEFAULT_BRAKING   10.0f
#define VEH_DEFAULT_TURNING_SPEED   1.0f
#define VEH_DEFAULT_TRACTION   8.0f
#define VEH_DEFAULT_FRICTION   1.0f
#define VEH_DEFAULT_MAX_SLOPE   0.85f
#define VEH_DEFAULT_MASS   200
#define VEH_DEFAULT_MAX_ARMOR   200
#define VEH_DEFAULT_TOUGHNESS   2.5f
#define VEH_DEFAULT_GRAVITY   800
#define VEH_DEFAULT_HOVER_HEIGHT   64.0f
#define VEH_DEFAULT_HOVER_STRENGTH   10.0f
#define VEH_DEFAULT_VISIBILITY   0
#define VEH_DEFAULT_LOUDNESS   0
#define VEH_DEFAULT_EXP_RAD   400.0f
#define VEH_DEFAULT_EXP_DMG   1000
#define VEH_MAX_PASSENGERS   10
#define MAX_STRAFE_TIME   2000.0f
#define MIN_LANDING_SPEED   200
#define MIN_LANDING_SLOPE   0.8f
#define VEH_MOUNT_THROW_LEFT   -5
#define VEH_MOUNT_THROW_RIGHT   -6
#define SHIPSURF_FRONT   0
#define SHIPSURF_BACK   1
#define SHIPSURF_RIGHT   2
#define SHIPSURF_LEFT   3
#define SHIPSURF_DAMAGE_FRONT_LIGHT   0
#define SHIPSURF_DAMAGE_BACK_LIGHT   1
#define SHIPSURF_DAMAGE_RIGHT_LIGHT   2
#define SHIPSURF_DAMAGE_LEFT_LIGHT   3
#define SHIPSURF_DAMAGE_FRONT_HEAVY   4
#define SHIPSURF_DAMAGE_BACK_HEAVY   5
#define SHIPSURF_DAMAGE_RIGHT_HEAVY   6
#define SHIPSURF_DAMAGE_LEFT_HEAVY   7
#define SHIPSURF_BROKEN_A   (1<<0)
#define SHIPSURF_BROKEN_B   (1<<1)
#define SHIPSURF_BROKEN_C   (1<<2)
#define SHIPSURF_BROKEN_D   (1<<3)
#define SHIPSURF_BROKEN_E   (1<<4)
#define SHIPSURF_BROKEN_F   (1<<5)
#define SHIPSURF_BROKEN_G   (1<<6)

Typedefs

typedef Vehicle_s Vehicle_t
typedef bgEntity_s bgEntity_t

Enumerations

enum  vehicleType_t {
  VH_NONE = 0, VH_WALKER, VH_FIGHTER, VH_SPEEDER,
  VH_ANIMAL, VH_FLIER, VH_NUM_VEHICLES
}
enum  EWeaponPose { WPOSE_NONE = 0, WPOSE_BLASTER, WPOSE_SABERLEFT, WPOSE_SABERRIGHT }
enum  {
  VEH_EJECT_LEFT, VEH_EJECT_RIGHT, VEH_EJECT_FRONT, VEH_EJECT_REAR,
  VEH_EJECT_TOP, VEH_EJECT_BOTTOM
}
enum  vehFlags_t {
  VEH_NONE = 0, VEH_FLYING = 0x00000001, VEH_CRASHING = 0x00000002, VEH_LANDING = 0x00000004,
  VEH_BUCKING = 0x00000010, VEH_WINGSOPEN = 0x00000020, VEH_GEARSOPEN = 0x00000040, VEH_SLIDEBREAKING = 0x00000080,
  VEH_SPINNING = 0x00000100, VEH_OUTOFCONTROL = 0x00000200, VEH_SABERINLEFTHAND = 0x00000400
}

Functions

int BG_VehicleGetIndex (const char *vehicleName)

Variables

stringID_table_t VehicleTable [VH_NUM_VEHICLES+1]
vehWeaponInfo_t g_vehWeaponInfo [MAX_VEH_WEAPONS]
int numVehicleWeapons
vehicleInfo_t g_vehicleInfo [MAX_VEHICLES]
int numVehicles


Define Documentation

#define MAX_STRAFE_TIME   2000.0f
 

Definition at line 398 of file bg_vehicles.h.

Referenced by WP_GetVehicleCamPos().

#define MAX_VEH_WEAPONS   16
 

Definition at line 70 of file bg_vehicles.h.

Referenced by FireVehicleWeapon(), and VEH_VehWeaponIndexForName().

#define MAX_VEHICLE_EXHAUSTS   12
 

Definition at line 84 of file bg_vehicles.h.

Referenced by CG_G2AnimEntModelLoad(), Initialize(), SetupGameGhoul2Model(), and Update().

#define MAX_VEHICLE_MUZZLES   12
 

Definition at line 83 of file bg_vehicles.h.

Referenced by CG_G2AnimEntModelLoad(), CG_VehMuzzleFireFX(), FireVehicleWeapon(), Initialize(), and SetupGameGhoul2Model().

#define MAX_VEHICLE_TURRET_MUZZLES   2
 

Definition at line 87 of file bg_vehicles.h.

Referenced by CG_CalcVehicleMuzzlePoint(), and SetupGameGhoul2Model().

#define MAX_VEHICLE_TURRETS   2
 

Definition at line 86 of file bg_vehicles.h.

Referenced by CG_CalcVehicleMuzzlePoint(), CG_CheckPassengerTurretView(), CG_G2AnimEntModelLoad(), CG_VehMuzzleFireFX(), Initialize(), and PM_VehicleViewAngles().

#define MAX_VEHICLE_WEAPONS   2
 

Definition at line 85 of file bg_vehicles.h.

Referenced by Initialize().

#define MAX_VEHICLES   16
 

Definition at line 365 of file bg_vehicles.h.

Referenced by VEH_VehicleIndexForName().

#define MIN_LANDING_SLOPE   0.8f
 

Definition at line 400 of file bg_vehicles.h.

Referenced by BG_VehicleTurnRateForSpeed(), FighterOverValidLandingSurface(), and PM_VehicleImpact().

#define MIN_LANDING_SPEED   200
 

Definition at line 399 of file bg_vehicles.h.

Referenced by FighterIsLanding(), and PM_VehicleImpact().

#define NUM_VWEAP_PARMS   25
 

Definition at line 66 of file bg_vehicles.h.

#define SHIPSURF_BACK   1
 

Definition at line 428 of file bg_vehicles.h.

Referenced by G_Damage().

#define SHIPSURF_BROKEN_A   (1<<0)
 

Definition at line 442 of file bg_vehicles.h.

#define SHIPSURF_BROKEN_B   (1<<1)
 

Definition at line 443 of file bg_vehicles.h.

#define SHIPSURF_BROKEN_C   (1<<2)
 

Definition at line 444 of file bg_vehicles.h.

#define SHIPSURF_BROKEN_D   (1<<3)
 

Definition at line 445 of file bg_vehicles.h.

#define SHIPSURF_BROKEN_E   (1<<4)
 

Definition at line 446 of file bg_vehicles.h.

#define SHIPSURF_BROKEN_F   (1<<5)
 

Definition at line 447 of file bg_vehicles.h.

#define SHIPSURF_BROKEN_G   (1<<6)
 

Definition at line 448 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_BACK_HEAVY   5
 

Definition at line 437 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_BACK_LIGHT   1
 

Definition at line 433 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_FRONT_HEAVY   4
 

Definition at line 436 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_FRONT_LIGHT   0
 

Definition at line 432 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_LEFT_HEAVY   7
 

Definition at line 439 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_LEFT_LIGHT   3
 

Definition at line 435 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_RIGHT_HEAVY   6
 

Definition at line 438 of file bg_vehicles.h.

#define SHIPSURF_DAMAGE_RIGHT_LIGHT   2
 

Definition at line 434 of file bg_vehicles.h.

#define SHIPSURF_FRONT   0
 

Definition at line 427 of file bg_vehicles.h.

Referenced by ClientCommand(), and G_Damage().

#define SHIPSURF_LEFT   3
 

Definition at line 430 of file bg_vehicles.h.

Referenced by G_Damage().

#define SHIPSURF_RIGHT   2
 

Definition at line 429 of file bg_vehicles.h.

Referenced by G_Damage().

#define VEH_DEFAULT_ACCEL   10.0f
 

Definition at line 375 of file bg_vehicles.h.

#define VEH_DEFAULT_BANKING_SPEED   0.5f
 

Definition at line 378 of file bg_vehicles.h.

#define VEH_DEFAULT_BRAKING   10.0f
 

Definition at line 381 of file bg_vehicles.h.

#define VEH_DEFAULT_DECEL   10.0f
 

Definition at line 376 of file bg_vehicles.h.

#define VEH_DEFAULT_EXP_DMG   1000
 

Definition at line 395 of file bg_vehicles.h.

#define VEH_DEFAULT_EXP_RAD   400.0f
 

Definition at line 394 of file bg_vehicles.h.

#define VEH_DEFAULT_FRICTION   1.0f
 

Definition at line 384 of file bg_vehicles.h.

#define VEH_DEFAULT_GRAVITY   800
 

Definition at line 389 of file bg_vehicles.h.

#define VEH_DEFAULT_HOVER_HEIGHT   64.0f
 

Definition at line 390 of file bg_vehicles.h.

#define VEH_DEFAULT_HOVER_STRENGTH   10.0f
 

Definition at line 391 of file bg_vehicles.h.

#define VEH_DEFAULT_LOUDNESS   0
 

Definition at line 393 of file bg_vehicles.h.

#define VEH_DEFAULT_MASS   200
 

Definition at line 386 of file bg_vehicles.h.

#define VEH_DEFAULT_MAX_ARMOR   200
 

Definition at line 387 of file bg_vehicles.h.

#define VEH_DEFAULT_MAX_SLOPE   0.85f
 

Definition at line 385 of file bg_vehicles.h.

#define VEH_DEFAULT_PITCH_LIMIT   90.0f
 

Definition at line 380 of file bg_vehicles.h.

#define VEH_DEFAULT_ROLL_LIMIT   60.0f
 

Definition at line 379 of file bg_vehicles.h.

#define VEH_DEFAULT_SPEED_MAX   800.0f
 

Definition at line 374 of file bg_vehicles.h.

#define VEH_DEFAULT_STRAFE_PERC   0.5f
 

Definition at line 377 of file bg_vehicles.h.

#define VEH_DEFAULT_TOUGHNESS   2.5f
 

Definition at line 388 of file bg_vehicles.h.

#define VEH_DEFAULT_TRACTION   8.0f
 

Definition at line 383 of file bg_vehicles.h.

#define VEH_DEFAULT_TURNING_SPEED   1.0f
 

Definition at line 382 of file bg_vehicles.h.

#define VEH_DEFAULT_VISIBILITY   0
 

Definition at line 392 of file bg_vehicles.h.

#define VEH_MAX_PASSENGERS   10
 

Definition at line 396 of file bg_vehicles.h.

Referenced by BG_VehicleClampData().

#define VEH_MOUNT_THROW_LEFT   -5
 

Definition at line 402 of file bg_vehicles.h.

Referenced by AnimateRiders(), and ValidateBoard().

#define VEH_MOUNT_THROW_RIGHT   -6
 

Definition at line 403 of file bg_vehicles.h.

Referenced by AnimateRiders(), and ValidateBoard().

#define VEH_WEAPON_BASE   0
 

Definition at line 71 of file bg_vehicles.h.

Referenced by CG_BracketEntity(), and VEH_VehWeaponIndexForName().

#define VEH_WEAPON_NONE   -1
 

Definition at line 72 of file bg_vehicles.h.

Referenced by FireVehicleWeapon(), VEH_LoadVehWeapon(), and VEH_VehWeaponIndexForName().

#define VEHICLE_BASE   0
 

Definition at line 366 of file bg_vehicles.h.

Referenced by BG_VehicleLoadParms(), Update(), and VEH_VehicleIndexForName().

#define VEHICLE_NONE   -1
 

Definition at line 367 of file bg_vehicles.h.

Referenced by BG_GetVehicleModelName(), BG_GetVehicleSkinName(), NPC_Spawn_Do(), NPC_VehiclePrecache(), VEH_LoadVehicle(), and VEH_VehicleIndexForName().

#define VFOFS  )     ((int)&(((vehicleInfo_t *)0)->x))
 

Definition at line 363 of file bg_vehicles.h.

#define VWFOFS  )     ((int)&(((vehWeaponInfo_t *)0)->x))
 

Definition at line 68 of file bg_vehicles.h.


Typedef Documentation

typedef struct bgEntity_s bgEntity_t
 

Definition at line 7 of file bg_vehicles.h.

typedef struct Vehicle_s Vehicle_t
 

Definition at line 6 of file bg_vehicles.h.

Referenced by AddPassenger(), Animate(), AnimateRiders(), AnimateVehicle(), BG_ExternThisSoICanRecompileInDebug(), BG_FighterUpdate(), BG_UnrestrainedPitchRoll(), BG_VehicleAdjustBBoxForOrientation(), BG_VehicleTurnRateForSpeed(), Board(), CG_CalcVehMuzzle(), CG_Player(), CG_VehMuzzleFireFX(), Eject(), EjectAll(), FighterIsLanded(), FighterIsLanding(), FighterIsLaunching(), FighterOverValidLandingSurface(), FighterSuspended(), FireVehicleWeapon(), G_AllocateVehicleObject(), G_CanJumpToEnemyVeh(), G_CreateAnimalNPC(), G_CreateFighterNPC(), G_CreateSpeederNPC(), G_CreateWalkerNPC(), G_EjectDroidUnit(), G_FreeVehicleObject(), G_IsRidingVehicle(), G_KnockOffVehicle(), G_VehMuzzleFireFX(), Inhabited(), Initialize(), NPC_Use(), PM_HoverTrace(), PM_pitch_roll_for_slope(), PM_VehicleImpact(), PM_VehicleViewAngles(), PM_VehicleWeaponAnimate(), ProcessOrientCommands(), Q3_RemoveEnt(), RegisterAssets(), SetParent(), SetPilot(), shipboundary_think(), TryUse(), Update(), ValidateBoard(), VEH_StartStrafeRam(), VEH_TryEject(), VEH_TurretAim(), VEH_TurretAnglesToEnemy(), VEH_TurretCheckFire(), VEH_TurretObeyPassengerControl(), VEH_TurretThink(), and WP_CalcVehMuzzle().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
VEH_EJECT_LEFT 
VEH_EJECT_RIGHT 
VEH_EJECT_FRONT 
VEH_EJECT_REAR 
VEH_EJECT_TOP 
VEH_EJECT_BOTTOM 

Definition at line 406 of file bg_vehicles.h.

00407 {
00408         VEH_EJECT_LEFT, 
00409         VEH_EJECT_RIGHT, 
00410         VEH_EJECT_FRONT, 
00411         VEH_EJECT_REAR, 
00412         VEH_EJECT_TOP, 
00413         VEH_EJECT_BOTTOM
00414 };

enum EWeaponPose
 

Enumeration values:
WPOSE_NONE 
WPOSE_BLASTER 
WPOSE_SABERLEFT 
WPOSE_SABERRIGHT 

Definition at line 20 of file bg_vehicles.h.

Referenced by AnimateRiders().

00021 {
00022         WPOSE_NONE      = 0,
00023         WPOSE_BLASTER,
00024         WPOSE_SABERLEFT,
00025         WPOSE_SABERRIGHT,
00026 } EWeaponPose;

enum vehFlags_t
 

Enumeration values:
VEH_NONE 
VEH_FLYING 
VEH_CRASHING 
VEH_LANDING 
VEH_BUCKING 
VEH_WINGSOPEN 
VEH_GEARSOPEN 
VEH_SLIDEBREAKING 
VEH_SPINNING 
VEH_OUTOFCONTROL 
VEH_SABERINLEFTHAND 

Definition at line 417 of file bg_vehicles.h.

00418 {
00419         VEH_NONE = 0, VEH_FLYING = 0x00000001, VEH_CRASHING = 0x00000002,
00420         VEH_LANDING = 0x00000004, VEH_BUCKING = 0x00000010, VEH_WINGSOPEN = 0x00000020,
00421         VEH_GEARSOPEN = 0x00000040, VEH_SLIDEBREAKING = 0x00000080, VEH_SPINNING = 0x00000100,
00422         VEH_OUTOFCONTROL = 0x00000200,
00423         VEH_SABERINLEFTHAND = 0x00000400
00424 } vehFlags_t;

enum vehicleType_t
 

Enumeration values:
VH_NONE 
VH_WALKER 
VH_FIGHTER 
VH_SPEEDER 
VH_ANIMAL 
VH_FLIER 
VH_NUM_VEHICLES 

Definition at line 9 of file bg_vehicles.h.

00010 {
00011         VH_NONE = 0,    //0 just in case anyone confuses VH_NONE and VEHICLE_NONE below
00012         VH_WALKER,              //something you ride inside of, it walks like you, like an AT-ST
00013         VH_FIGHTER,             //something you fly inside of, like an X-Wing or TIE fighter
00014         VH_SPEEDER,             //something you ride on that hovers, like a speeder or swoop
00015         VH_ANIMAL,              //animal you ride on top of that walks, like a tauntaun
00016         VH_FLIER,               //animal you ride on top of that flies, like a giant mynoc?
00017         VH_NUM_VEHICLES
00018 } vehicleType_t;


Function Documentation

int BG_VehicleGetIndex const char *  vehicleName  ) 
 

Definition at line 1590 of file bg_vehicleLoad.c.

References VEH_VehicleIndexForName().

Referenced by BG_GetVehicleModelName(), BG_GetVehicleSkinName(), CG_G2AnimEntModelLoad(), G_CreateAnimalNPC(), G_CreateFighterNPC(), G_CreateSpeederNPC(), G_CreateWalkerNPC(), NPC_Spawn_Do(), and NPC_VehiclePrecache().

01591 {
01592         return (VEH_VehicleIndexForName( vehicleName ));
01593 }


Variable Documentation

vehicleInfo_t g_vehicleInfo[MAX_VEHICLES]
 

Definition at line 370 of file bg_vehicles.h.

Referenced by BG_GetVehicleModelName(), BG_GetVehicleSkinName(), BG_VehicleLoadParms(), CG_G2AnimEntModelLoad(), G_CreateAnimalNPC(), G_CreateFighterNPC(), G_CreateSpeederNPC(), G_CreateWalkerNPC(), NPC_Spawn_Do(), NPC_VehiclePrecache(), Update(), VEH_LoadVehicle(), and VEH_VehicleIndexForName().

vehWeaponInfo_t g_vehWeaponInfo[MAX_VEH_WEAPONS]
 

Definition at line 75 of file bg_vehicles.h.

Referenced by CG_BracketEntity(), CG_G2MarkEvent(), CG_VehicleWeaponImpact(), CG_VehMuzzleFireFX(), FireVehicleWeapon(), VEH_LoadVehWeapon(), VEH_TurretObeyPassengerControl(), VEH_TurretThink(), VEH_VehWeaponIndexForName(), and WP_FireVehicleWeapon().

int numVehicles
 

Definition at line 371 of file bg_vehicles.h.

Referenced by BG_VehicleLoadParms(), VEH_LoadVehicle(), and VEH_VehicleIndexForName().

int numVehicleWeapons
 

Definition at line 76 of file bg_vehicles.h.

Referenced by VEH_LoadVehWeapon(), and VEH_VehWeaponIndexForName().

stringID_table_t VehicleTable[VH_NUM_VEHICLES+1]
 

Definition at line 29 of file bg_vehicles.h.