Fixes for better control over external aircraft 3d model control.
This commit is contained in:
parent
5ed389238a
commit
3593f3782d
2 changed files with 16 additions and 6 deletions
|
@ -113,7 +113,7 @@ public:
|
||||||
FGMagRibbon::FGMagRibbon (int w, int h)
|
FGMagRibbon::FGMagRibbon (int w, int h)
|
||||||
: FGTexturedLayer(w, h)
|
: FGTexturedLayer(w, h)
|
||||||
{
|
{
|
||||||
FGCroppedTexture texture("Instruments/Default/Textures/compass-ribbon.rgb");
|
FGCroppedTexture texture("Aircraft/c172/Instruments/Textures/compass-ribbon.rgb");
|
||||||
setTexture(texture);
|
setTexture(texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1560,15 +1560,25 @@ int main( int argc, char **argv ) {
|
||||||
// align the model properly for FGFS
|
// align the model properly for FGFS
|
||||||
ssgTransform *tux_align = new ssgTransform;
|
ssgTransform *tux_align = new ssgTransform;
|
||||||
tux_align->addKid(tux_obj);
|
tux_align->addKid(tux_obj);
|
||||||
sgMat4 tux_matrix;
|
sgMat4 rot_matrix;
|
||||||
|
sgMat4 off_matrix;
|
||||||
|
sgMat4 res_matrix;
|
||||||
float h_rot =
|
float h_rot =
|
||||||
current_properties.getFloatValue("/sim/model/h-rotation", 0.0);
|
current_properties.getFloatValue("/sim/model/h-rotation", 0.0);
|
||||||
/* float p_rot =
|
float p_rot =
|
||||||
current_properties.getFloatValue("/sim/model/p-rotation", 0.0); */
|
current_properties.getFloatValue("/sim/model/p-rotation", 0.0);
|
||||||
float r_rot =
|
float r_rot =
|
||||||
current_properties.getFloatValue("/sim/model/r-rotation", 0.0);
|
current_properties.getFloatValue("/sim/model/r-rotation", 0.0);
|
||||||
sgMakeRotMat4(tux_matrix, h_rot, h_rot, r_rot);
|
float x_off =
|
||||||
tux_align->setTransform(tux_matrix);
|
current_properties.getFloatValue("/sim/model/x-offset", 0.0);
|
||||||
|
float y_off =
|
||||||
|
current_properties.getFloatValue("/sim/model/y-offset", 0.0);
|
||||||
|
float z_off =
|
||||||
|
current_properties.getFloatValue("/sim/model/z-offset", 0.0);
|
||||||
|
sgMakeRotMat4(rot_matrix, h_rot, p_rot, r_rot);
|
||||||
|
sgMakeTransMat4(off_matrix, x_off, y_off, z_off);
|
||||||
|
sgMultMat4(res_matrix, off_matrix, rot_matrix);
|
||||||
|
tux_align->setTransform(res_matrix);
|
||||||
|
|
||||||
penguin_pos->addKid( tux_align );
|
penguin_pos->addKid( tux_align );
|
||||||
penguin_sel->addKid( penguin_pos );
|
penguin_sel->addKid( penguin_pos );
|
||||||
|
|
Loading…
Add table
Reference in a new issue