Fixes for default chase view values.
This commit is contained in:
parent
abc6f642a2
commit
5586d12e26
2 changed files with 52 additions and 3 deletions
|
@ -286,8 +286,7 @@ sgVec3Slider::sgVec3Slider ( int x, int y, sgVec3 vec, const char *title,
|
||||||
dialer_x = dialer_x + 170;
|
dialer_x = dialer_x + 170;
|
||||||
|
|
||||||
/* pitch */
|
/* pitch */
|
||||||
// HS1 = new FloatDial ( dialer_x, dialer_y, dialer_size, vec[1], Ytitle, 89.99f, -89.99f );
|
HS1 = new FloatDial ( dialer_x, dialer_y, dialer_size, vec[1], Ytitle, 89.99f, -89.99f );
|
||||||
HS1 = new FloatDial ( dialer_x, dialer_y, dialer_size, vec[1], Ytitle, 179.99f, -179.99f );
|
|
||||||
|
|
||||||
/* radius */
|
/* radius */
|
||||||
HS2 = new FloatSlider ( slider_x, slider_y, slider_width, vec[2], Ztitle, 100.0f, 0.0f );
|
HS2 = new FloatSlider ( slider_x, slider_y, slider_width, vec[2], Ztitle, 100.0f, 0.0f );
|
||||||
|
@ -367,6 +366,7 @@ void PilotOffsetInit() {
|
||||||
fgGetFloat("/sim/view[1]/default/pilot-offset/pitch-deg"),
|
fgGetFloat("/sim/view[1]/default/pilot-offset/pitch-deg"),
|
||||||
fgGetFloat("/sim/view[1]/default/pilot-offset/radius-m")
|
fgGetFloat("/sim/view[1]/default/pilot-offset/radius-m")
|
||||||
);
|
);
|
||||||
|
|
||||||
PilotOffsetInit(v);
|
PilotOffsetInit(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -374,8 +374,16 @@ void PilotOffsetInit( sgVec3 vec )
|
||||||
{
|
{
|
||||||
// Only one of these things for now
|
// Only one of these things for now
|
||||||
if( PO_vec == 0 ) {
|
if( PO_vec == 0 ) {
|
||||||
sgVec3Slider *PO = new sgVec3Slider ( 200, 200, vec, "Pilot Offset" );
|
/* make change so this gets done once for each vector */
|
||||||
|
fgSetFloat("/sim/view[1]/current/pilot-offset/heading-deg",fgGetFloat("/sim/view[1]/default/pilot-offset/heading-deg"));
|
||||||
|
fgSetFloat("/sim/view[1]/current/pilot-offset/pitch-deg",fgGetFloat("/sim/view[1]/default/pilot-offset/pitch-deg"));
|
||||||
|
fgSetFloat("/sim/view[1]/current/pilot-offset/radius-m",fgGetFloat("/sim/view[1]/default/pilot-offset/radius-m"));
|
||||||
|
sgVec3Slider *PO = new sgVec3Slider ( 200, 200, vec, "Pilot Offset" );
|
||||||
PO_vec = PO;
|
PO_vec = PO;
|
||||||
|
// Bindings for Pilot Offset
|
||||||
|
fgTie("/sim/view[1]/current/pilot-offset/heading-deg", getPilotOffsetHeadingDeg, setPilotOffsetHeadingDeg);
|
||||||
|
fgTie("/sim/view[1]/current/pilot-offset/pitch-deg", getPilotOffsetPitchDeg, setPilotOffsetPitchDeg);
|
||||||
|
fgTie("/sim/view[1]/current/pilot-offset/radius-m", getPilotOffsetRadiusM, setPilotOffsetRadiusM);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,3 +24,44 @@ void PilotOffsetSet( int opt, float setting);
|
||||||
float PilotOffsetGetSetting( int opt );
|
float PilotOffsetGetSetting( int opt );
|
||||||
|
|
||||||
#endif // _VEC3_SLIDER_H
|
#endif // _VEC3_SLIDER_H
|
||||||
|
|
||||||
|
/* binding functions for chase view offset */
|
||||||
|
|
||||||
|
static void
|
||||||
|
setPilotOffsetHeadingDeg (float value)
|
||||||
|
{
|
||||||
|
PilotOffsetSet(0, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static float
|
||||||
|
getPilotOffsetHeadingDeg ()
|
||||||
|
{
|
||||||
|
return( PilotOffsetGetSetting(0) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
setPilotOffsetPitchDeg (float value)
|
||||||
|
{
|
||||||
|
PilotOffsetSet(1, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static float
|
||||||
|
getPilotOffsetPitchDeg ()
|
||||||
|
{
|
||||||
|
return( PilotOffsetGetSetting(1) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
setPilotOffsetRadiusM (float value)
|
||||||
|
{
|
||||||
|
PilotOffsetSet(2, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static float
|
||||||
|
getPilotOffsetRadiusM ()
|
||||||
|
{
|
||||||
|
return( PilotOffsetGetSetting(2) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue