Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
flybywire.cpp File Reference
#include "flybywire.h"
#include "vegastrike.h"
#include <math.h>
#include <stdio.h>
#include "cmd/unit_generic.h"
#include "lin_time.h"
#include "gfx/cockpit_generic.h"
#include "vs_globals.h"
#include "config_xml.h"

Go to the source code of this file.

Macros

#define VELTHRESHOLD   .1
 
#define ANGVELTHRESHOLD   .01
 
#define MATCHLINVELSETUP()
 
#define MATCHLINVELEXECUTE()
 
#define FBWABS(m)   (m >= 0 ? m : -m)
 

Functions

static bool getControlType ()
 

Macro Definition Documentation

#define ANGVELTHRESHOLD   .01
#define FBWABS (   m)    (m >= 0 ? m : -m)

Definition at line 260 of file flybywire.cpp.

#define MATCHLINVELEXECUTE ( )
Value:
do { \
parent->Thrust( (parent->GetMass() \
*(parent->ClampVelocity( desired, \
afterburn )+FrameOfRef-velocity)/SIMULATION_ATOM), \
afterburn ); \
} \
while (0)

Definition at line 40 of file flybywire.cpp.

Referenced by Orders::MatchLinearVelocity::Execute(), and Orders::MatchVelocity::Execute().

#define MATCHLINVELSETUP ( )
Value:
Unit *match = parent->VelocityReference(); Vector desired( desired_velocity ); Vector FrameOfRef( 0, \
0, \
0 ); \
if (match != NULL) {float dif1, dif2; match->GetVelocityDifficultyMult( dif1 ); dif1 *= \
match->graphicOptions.WarpFieldStrength; \
parent->GetVelocityDifficultyMult( dif2 ); \
if (match->graphicOptions.WarpFieldStrength > 1) {dif2 *= parent->graphicOptions.WarpFieldStrength; \
} \
FrameOfRef = \
parent->ToLocalCoordinates( match->GetWarpVelocity()*dif1 \
/dif2 ); } \
if (!LocalVelocity) {desired = parent->ToLocalCoordinates( \
desired ); } \
Vector velocity( \
parent->UpCoordinateLevel( parent->GetVelocity() ) )

Definition at line 23 of file flybywire.cpp.

Referenced by Orders::MatchLinearVelocity::Execute(), and Orders::MatchVelocity::Execute().

#define VELTHRESHOLD   .1

Function Documentation

static bool getControlType ( )
static

Definition at line 143 of file flybywire.cpp.

References VegaConfig::getVariable(), XMLSupport::parse_bool(), and vs_config.

144 {
145  static bool control = XMLSupport::parse_bool( vs_config->getVariable( "physics", "CarControl",
146 #ifdef CAR_SIM
147  "true"
148 #else
149  "false"
150 #endif
151  ) );
152  return control;
153 }