C++ Question How to create verniers?

NOMAD

Member
Joined
Aug 10, 2009
Messages
111
Reaction score
1
Points
18
I want to create a rocket which has a main engine and four verniers.
But which thruster group type I should define for these verniers after I grouping the main engine in THGROUP_MAIN?
And how can I change the direction of the thrust by pressing the NUM key?
How to add the visual when the verniers changing its direction?

There is a tutorial on wiki about creating verniers,but I still puzzled.
I hope someone can help me.Thanks!
 

NOMAD

Member
Joined
Aug 10, 2009
Messages
111
Reaction score
1
Points
18
The main problem is that which group type I should group for those verniers after I grouping the main engine in THGROUP_MAIN.Can I group these verniers in THGROUP_MAIN again? If not,how can I do ? Thanks.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,617
Reaction score
2,337
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
The main problem is that which group type I should group for those verniers after I grouping the main engine in THGROUP_MAIN.Can I group these verniers in THGROUP_MAIN again? If not,how can I do ? Thanks.

Yes, then the thruster level of the verniers is the same as the main engine thruster level. But for gimballing, you have to get the user inputs somehow.
 

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Yes, then the thruster level of the verniers is the same as the main engine thruster level. But for gimballing, you have to get the user inputs somehow.
That is covered in the wiki tutorial:
Code:
double P,Y,R;
  P=GetThrusterGroupLevel(THGROUP_ATT_PITCHUP)-GetThrusterGroupLevel(THGROUP_ATT_PITCHDOWN);
  Y=GetThrusterGroupLevel(THGROUP_ATT_YAWRIGHT)-GetThrusterGroupLevel(THGROUP_ATT_YAWLEFT);
  R=GetThrusterGroupLevel(THGROUP_ATT_BANKRIGHT)-GetThrusterGroupLevel(THGROUP_ATT_BANKLEFT);
  sprintf(oapiDebugString(),"Pitch %f Yaw %f Roll %f",P,Y,R);
  SetThrusterDir(th_vernier[0],_V(0.087*R,0,1));
  SetThrusterDir(th_vernier[1],_V(0,0,1.0+0.05*(P-Y)));
  SetThrusterDir(th_vernier[2],_V(0,0,1.0+0.05*(P+Y)));
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,617
Reaction score
2,337
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
That is covered in the wiki tutorial:
Code:
double P,Y,R;
  P=GetThrusterGroupLevel(THGROUP_ATT_PITCHUP)-GetThrusterGroupLevel(THGROUP_ATT_PITCHDOWN);
  Y=GetThrusterGroupLevel(THGROUP_ATT_YAWRIGHT)-GetThrusterGroupLevel(THGROUP_ATT_YAWLEFT);
  R=GetThrusterGroupLevel(THGROUP_ATT_BANKRIGHT)-GetThrusterGroupLevel(THGROUP_ATT_BANKLEFT);
  sprintf(oapiDebugString(),"Pitch %f Yaw %f Roll %f",P,Y,R);
  SetThrusterDir(th_vernier[0],_V(0.087*R,0,1));
  SetThrusterDir(th_vernier[1],_V(0,0,1.0+0.05*(P-Y)));
  SetThrusterDir(th_vernier[2],_V(0,0,1.0+0.05*(P+Y)));

But that required virtual thrusters for reacting properly, AFAIR.
 
Top