From 3593f3782d96eb72bb0b95dba1be717a251b6a47 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 14 Nov 2000 20:43:38 +0000 Subject: [PATCH] Fixes for better control over external aircraft 3d model control. --- src/Cockpit/panel_io.cxx | 2 +- src/Main/main.cxx | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Cockpit/panel_io.cxx b/src/Cockpit/panel_io.cxx index 38e103613..f010f9b16 100644 --- a/src/Cockpit/panel_io.cxx +++ b/src/Cockpit/panel_io.cxx @@ -113,7 +113,7 @@ public: FGMagRibbon::FGMagRibbon (int w, int h) : FGTexturedLayer(w, h) { - FGCroppedTexture texture("Instruments/Default/Textures/compass-ribbon.rgb"); + FGCroppedTexture texture("Aircraft/c172/Instruments/Textures/compass-ribbon.rgb"); setTexture(texture); } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index edfe87715..54c42190e 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1560,15 +1560,25 @@ int main( int argc, char **argv ) { // align the model properly for FGFS ssgTransform *tux_align = new ssgTransform; tux_align->addKid(tux_obj); - sgMat4 tux_matrix; + sgMat4 rot_matrix; + sgMat4 off_matrix; + sgMat4 res_matrix; float h_rot = current_properties.getFloatValue("/sim/model/h-rotation", 0.0); - /* float p_rot = - current_properties.getFloatValue("/sim/model/p-rotation", 0.0); */ + float p_rot = + current_properties.getFloatValue("/sim/model/p-rotation", 0.0); float r_rot = current_properties.getFloatValue("/sim/model/r-rotation", 0.0); - sgMakeRotMat4(tux_matrix, h_rot, h_rot, r_rot); - tux_align->setTransform(tux_matrix); + float x_off = + 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_sel->addKid( penguin_pos ); -- 2.39.5