JMW
Aspiring Addon Developer
Help (Again),
I'm trying to animate a nosecone (Concorde), but can't figure the code to do it in 5 degree increments. I would appreciate some help.
I need it to drop down 5 degrees on key press and then stop. Then the next 5 degrees and so on. up to 15 degrees, and then back up again incrementally.
For your amusement, I ended last night with this frustrated mess!:
This in
void ShuttlePB::clbkPostStep (double simt, double simdt, double mjd)
And this in
int ShuttlePB::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
Regards,
JMW
I'm trying to animate a nosecone (Concorde), but can't figure the code to do it in 5 degree increments. I would appreciate some help.
I need it to drop down 5 degrees on key press and then stop. Then the next 5 degrees and so on. up to 15 degrees, and then back up again incrementally.
For your amusement, I ended last night with this frustrated mess!:
This in
void ShuttlePB::clbkPostStep (double simt, double simdt, double mjd)
Code:
// Variable Geometry
if( animactive5 ) {PlayVesselWave3(MySoundID,BRAKE,NOLOOP,255);
if( animactive5 == 1 ) {
vario += 0.001;
if (variofirst > 0)
if( vario > 0.33 ){
vario = 0.33;
}
if (variofirst < 1)
animactive5 = 0;
if (variofirst > 1)
animactive5 = 1;
vario += 0.001;
if( vario > 0.66 ){
vario = 0.66;
}
if (variofirst < 2)
animactive5 = 0;
}
else {
vario -= 0.001;
if( vario < 0.0 ){
vario = 0.0;
animactive5 = 0;
}
}
SetAnimation( anim_vario, vario );
SetAnimation( anim_vario1, vario );
SetAnimation( anim_variolever, vario );
}
And this in
int ShuttlePB::clbkConsumeBufferedKey (DWORD key, bool down, char *kstate)
Code:
case OAPI_KEY_V: // Geom Fully Up or Down
if( vario > 0.5 )
animactive5 = 2;
else
if (GetAirspeed() <139)//safe speed
animactive5 = 1;
variofirst = (variofirst + 1);
//{
//PlayVesselWave3(MySoundID,FLAPS,NOLOOP,255);
//}
return 1;
//////////////////////////////////////////////////////////////////
case OAPI_KEY_C: // Down 5 deg
if (variofirst > 3)
variofirst = 3;
if (variofirst < 0)
variofirst = 0;
if (variofirst = 3)
{if (vario > 1)
vario = 1;
animactive5 = 1;
variofirst = (variofirst +1);
}
else
if (variofirst = 3)
{if (vario < 1)
vario = 1;
animactive5 = 2;
variofirst = (variofirst -1);
}
if (variofirst = 2)
{if (vario > 0.66)
vario = 0.66;
animactive5 = 1;
variofirst = (variofirst +1);
}
else
if (variofirst = 2)
{if (vario < 0.66)
vario = 0.66;
animactive5 = 2;
variofirst = (variofirst -1);
}
if (variofirst = 1)
{if (vario > 0.33)
vario = 0.33;
animactive5 = 1;
variofirst = (variofirst +1);
}
else
if (variofirst = 1)
{if (vario < 0.33)
vario = 0.33;
animactive5 = 2;
variofirst = (variofirst -1);
}
if (variofirst = 0)
{if (vario > 0)
vario = 0;
animactive5 = 1;
variofirst = (variofirst +1);
}
else
if (variofirst = 0)
{if (vario < 0.33)
vario = 0.33;
animactive5 = 2;
variofirst = (variofirst -1);
}
// return 1;
Regards,
JMW