FlightGear飞行模拟器

标题: flightgear属性树 [打印本页]

作者: freeyun    时间: 2013-4-12 23:53
标题: flightgear属性树
本帖最后由 freeyun 于 2013-4-13 00:31 编辑

   关于FG的属性系统。
属性树整合各个子系统,是FG中枢神经,它是全局的,属性树包括飞机的位置,方向,速度 ,动力模型 声音等
这个是关于它的维基http://www.flightgear.org.cn/wiki/%E5%B1%9E%E6%80%A7%E6%A0%91
获取的它的值用Get,设置是用Set
菜单-DeBug->browse internal Properties

下面这段代码是FG初始化属性树fgSetDefaults() 函数
    // Position (deliberately out of range)
    fgSetDouble("/position/longitude-deg", 9999.0);
    fgSetDouble("/position/latitude-deg", 9999.0);
    fgSetDouble("/position/altitude-ft", -9999.0);
    // Orientation
    fgSetDouble("/orientation/heading-deg", 9999.0);
    fgSetDouble("/orientation/roll-deg", 0.0);
    fgSetDouble("/orientation/pitch-deg", 0.424);
    // Velocities
    fgSetDouble("/velocities/uBody-fps", 0.0);
    fgSetDouble("/velocities/vBody-fps", 0.0);
    fgSetDouble("/velocities/wBody-fps", 0.0);
    fgSetDouble("/velocities/speed-north-fps", 0.0);
    fgSetDouble("/velocities/speed-east-fps", 0.0);
    fgSetDouble("/velocities/speed-down-fps", 0.0);
    fgSetDouble("/velocities/airspeed-kt", 0.0);
    fgSetDouble("/velocities/mach", 0.0);
                                // Presets
    fgSetDouble("/sim/presets/longitude-deg", 9999.0);
    fgSetDouble("/sim/presets/latitude-deg", 9999.0);
    fgSetDouble("/sim/presets/altitude-ft", -9999.0);
    fgSetDouble("/sim/presets/heading-deg", 9999.0);
    fgSetDouble("/sim/presets/roll-deg", 0.0);
    fgSetDouble("/sim/presets/pitch-deg", 0.424);
    fgSetString("/sim/presets/speed-set", "knots");
    fgSetDouble("/sim/presets/airspeed-kt", 0.0);
    fgSetDouble("/sim/presets/mach", 0.0);
    fgSetDouble("/sim/presets/uBody-fps", 0.0);
    fgSetDouble("/sim/presets/vBody-fps", 0.0);
    fgSetDouble("/sim/presets/wBody-fps", 0.0);
    fgSetDouble("/sim/presets/speed-north-fps", 0.0);
    fgSetDouble("/sim/presets/speed-east-fps", 0.0);
    fgSetDouble("/sim/presets/speed-down-fps", 0.0);
    fgSetBool("/sim/presets/onground", true);
    fgSetBool("/sim/presets/trim", false);
    // Miscellaneous
    fgSetBool("/sim/startup/game-mode", false);
    fgSetBool("/sim/startup/splash-screen", true);
    fgSetBool("/sim/startup/intro-music", true);
    // we want mouse-pointer to have an undefined value if nothing is
    // specified so we can do the right thing for voodoo-1/2 cards.
    // fgSetString("/sim/startup/mouse-pointer", "disabled");
    fgSetString("/sim/control-mode", "joystick");
    fgSetBool("/controls/flight/auto-coordination", false);
    fgSetString("/sim/logging/priority", "alert");
    // Features
    fgSetBool("/sim/hud/color/antialiased", false);
    fgSetBool("/sim/hud/enable3d[1]", true);
    fgSetBool("/sim/hud/visibility[1]", false);
    fgSetBool("/sim/panel/visibility", true);
    fgSetBool("/sim/sound/enabled", true);
    fgSetBool("/sim/sound/working", true);
    // Flight Model options
    fgSetString("/sim/flight-model", "jsb");
    fgSetString("/sim/aero", "c172");
    fgSetInt("/sim/model-hz", NEW_DEFAULT_MODEL_HZ);
    fgSetDouble("/sim/speed-up", 1.0);
    // Rendering options
    fgSetString("/sim/rendering/fog", "nicest");
    fgSetBool("/environment/clouds/status", true);
    fgSetBool("/sim/startup/fullscreen", false);
    fgSetBool("/sim/rendering/shading", true);
    fgSetBool("/sim/rendering/skyblend", true);
    fgSetBool("/sim/rendering/textures", true);
    fgTie( "/sim/rendering/filtering", SGGetTextureFilter, SGSetTextureFilter, false);
    fgSetInt("/sim/rendering/filtering", 1);
    fgSetBool("/sim/rendering/wireframe", false);
    fgSetBool("/sim/rendering/horizon-effect", false);
    fgSetBool("/sim/rendering/enhanced-lighting", false);
    fgSetBool("/sim/rendering/distance-attenuation", false);
    fgSetBool("/sim/rendering/specular-highlight", true);
    fgSetString("/sim/rendering/materials-file", "materials.xml");
    fgSetInt("/sim/startup/xsize", 800);
    fgSetInt("/sim/startup/ysize", 600);
    fgSetInt("/sim/rendering/bits-per-pixel", 16);
    fgSetString("/sim/view-mode", "pilot");
    fgSetDouble("/sim/current-view/heading-offset-deg", 0);
    // HUD options
    fgSetString("/sim/startup/units", "feet");
    fgSetString("/sim/hud/frame-stat-type", "tris");
    // Time options
    fgSetInt("/sim/startup/time-offset", 0);
    fgSetString("/sim/startup/time-offset-type", "system-offset");
    fgSetLong("/sim/time/cur-time-override", 0);
                                // Freeze options
    fgSetBool("/sim/freeze/master", false);
    fgSetBool("/sim/freeze/position", false);
    fgSetBool("/sim/freeze/clock", false);
    fgSetBool("/sim/freeze/fuel", false);
    fgSetString("/sim/multiplay/callsign", "callsign");
    fgSetString("/sim/multiplay/rxhost", "");
    fgSetString("/sim/multiplay/txhost", "");
    fgSetInt("/sim/multiplay/rxport", 0);
    fgSetInt("/sim/multiplay/txport", 0);
   
    fgSetString("/sim/version/flightgear", FLIGHTGEAR_VERSION);
    fgSetString("/sim/version/simgear", SG_STRINGIZE(SIMGEAR_VERSION));
    fgSetString("/sim/version/openscenegraph", osgGetVersion());
    fgSetString("/sim/version/revision", REVISION);
    fgSetInt("/sim/version/build-number", HUDSON_BUILD_NUMBER);
    fgSetString("/sim/version/build-id", HUDSON_BUILD_ID);

作者: freeyun    时间: 2013-4-13 00:03
输入事件(键盘,摇杆)和属性树和动力模型FDM ,三者关系!有待进一步研究中!
作者: kgdjszx    时间: 2013-4-15 19:57
实时输出用Get,那在用VC编程时都需要哪些头文件、库等等呢???
工程里该如何设置呢?
有做过的朋友说明下啦,谢谢!~
作者: freeyun    时间: 2013-4-15 21:02
kgdjszx 发表于 2013-4-15 19:57
实时输出用Get,那在用VC编程时都需要哪些头文件、库等等呢???
工程里该如何设置呢?
有做过的朋友说明 ...

GET什么?
作者: kgdjszx    时间: 2013-4-15 23:05
就是要获取“高度”“速度”“经纬度”“爬升率”等等,就是与Position 、Velocities等相关的信息,
怎样取出来?一边我在vc工程中能够实时显示出来。

谢谢您的回复。
作者: freeyun    时间: 2013-4-15 23:47
本帖最后由 freeyun 于 2013-4-16 00:05 编辑
kgdjszx 发表于 2013-4-15 23:05
就是要获取“高度”“速度”“经纬度”“爬升率”等等,就是与Position 、Velocities等相关的信息,
怎样取 ...

你是想获取FDM的数据吧!只能给你做参考!http://wiki.flightgear.org/Property_Tree/Reference#Flight_Dynamics_Model,具体也没有去写过。!
不过根据你意思,你是想通过网络方式实时获取所有的FDM的数据
我个人认为FG在协议上有这个东西提供:我还没有仔细去了解过它FGIO,它所有的协议都在这个目录下:flightgear\src\Network
作者: kgdjszx    时间: 2013-4-16 00:05
看到了,非常感谢您的迅速回复!
我好好看看去。

研究出东西来,上网给大家分享下。
作者: freeyun    时间: 2013-4-16 00:09
kgdjszx 发表于 2013-4-16 00:05
看到了,非常感谢您的迅速回复!
我好好看看去。

共同讨论,刚好我,我在研究它的这个属性树!有个帖子写过关于FGIO,你可以去看看!
作者: Breaking_Dawn    时间: 2013-4-16 20:51
壮哉我大楼主!
作者: freeyun    时间: 2013-4-16 23:03
Breaking_Dawn 发表于 2013-4-16 20:51
壮哉我大楼主!


作者: angel6501103    时间: 2013-5-4 08:00
楼主太厉害了,谢谢分享!
作者: 从前有个人    时间: 2013-5-7 17:19
楼主威武,刚好有用,多谢分享
作者: shark1986    时间: 2019-4-11 15:27
摸索学习,共同进步!!!!!!!!!!!!!!!!!!
作者: nhzxy    时间: 2021-3-2 10:24
学习学习




欢迎光临 FlightGear飞行模拟器 (https://www.flightgear.org.cn/) Powered by Discuz! X3.2