Regarding this part of my code...
What would I do to make sure that this animation continues on until I press the command key that activated it? Would I need to delete STOPPING and RUNNING? Then what would I substitute for it since I got rid of the previous words I just explained.
Code:
void Spacecraft::DefineAnimations (void)
{
static UINT EngineGrp[2] = {8,11};
static MGROUP_ROTATE Engine (0, EngineGrp, 2, _V(-0.432,0,0), _V(0,-1,0), (float)(PI*2));
anim_eng = CreateAnimation (6);
AddAnimationComponent (anim_eng, 0, 6, &Engine);
}
void Spacecraft::ActivateEngine(EngineStatus action)
{
engine_status = action;
}
void Spacecraft::RevertEngine (void)
{
ActivateEngine((engine_status == ENGINE_IDLE || engine_status == ENGINE_STOPPING) ?
ENGINE_RUNNING : ENGINE_STOPPING);
}
void Spacecraft::clbkPostStep (double simt, double simdt, double mjd)
{
if (engine_status >= ENGINE_STOPPING) {
double da = simdt * ENGINE_SPEED;
if (engine_status == ENGINE_STOPPING) {
if (eng_proc > 0.0) eng_proc = max (0.0, eng_proc-da);
else engine_status = ENGINE_IDLE;
} else {
if (eng_proc < 1.0) eng_proc = min (1.0, eng_proc+da);
else engine_status = ENGINE_ON;
}
SetAnimation (anim_eng, eng_proc);
}
}