10 #define VELTHRESHOLD .1
11 #define ANGVELTHRESHOLD .01
23 #define MATCHLINVELSETUP() \
24 Unit *match = parent->VelocityReference(); Vector desired( desired_velocity ); Vector FrameOfRef( 0, \
27 if (match != NULL) {float dif1, dif2; match->GetVelocityDifficultyMult( dif1 ); dif1 *= \
28 match->graphicOptions.WarpFieldStrength; \
29 parent->GetVelocityDifficultyMult( dif2 ); \
30 if (match->graphicOptions.WarpFieldStrength > 1) {dif2 *= parent->graphicOptions.WarpFieldStrength; \
33 parent->ToLocalCoordinates( match->GetWarpVelocity()*dif1 \
35 if (!LocalVelocity) {desired = parent->ToLocalCoordinates( \
38 parent->UpCoordinateLevel( parent->GetVelocity() ) )
40 #define MATCHLINVELEXECUTE() \
42 parent->Thrust( (parent->GetMass() \
43 *(parent->ClampVelocity( desired, \
44 afterburn )+FrameOfRef-velocity)/SIMULATION_ATOM), \
57 void MatchLinearVelocity::Execute()
66 if ( (
done = fabs( desired.i+FrameOfRef.i-velocity.i ) <
VELTHRESHOLD && fabs( desired.j+FrameOfRef.j-velocity.j )
86 Vector angvel( parent->UpCoordinateLevel( parent->GetAngularVelocity() ) );
91 parent->ApplyLocalTorque( parent->GetMoment()*
Vector( 0, 0, desired_roll-angvel.k )/
SIMULATION_ATOM );
92 parent->ApplyLocalTorque( parent->GetMoment()*
Vector( 0, 0, desired_roll-angvel.k )/
SIMULATION_ATOM );
156 , sheltonslide( false )
164 static bool static_inertial_flight_model =
166 static bool static_inertial_flight_enable =
260 #define FBWABS( m ) (m >= 0 ? m : -m)
297 bool desireThrust =
false;
305 if (Limit.i <= 1) Limit.i = 1;
306 if (Limit.j <= 1) Limit.j = 1;
307 if (Limit.k <= 1) Limit.k = 1;
342 || ( tempcp &&
Network == NULL && ( (
getNewTime()-tempcp->TimeOfLastCollision) < collidepanic ) ) ) {
343 MatchAngularVelocity::Execute();
347 MatchVelocity::Execute();