Skip to content

Commit e0640eb

Browse files
author
Matthew Reid
committed
JsbSim plugin available. FlightSimApp has command line arg for selecting aircraft type.
1 parent 0589ee5 commit e0640eb

10 files changed

Lines changed: 381 additions & 15 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"components": [
3+
{"node": {
4+
}},
5+
{"motion": {
6+
}},
7+
{"controlInputs": {
8+
}},
9+
{"kinematicBody": {
10+
"size": [19.8, 4, 2.5]
11+
}},
12+
{"jsbSimAircraft": {
13+
"model": "F80C"
14+
}},
15+
{"visualModel": {
16+
"model": "Models/SepecatJaguar/SepecatJaguar_Fuselage.osgb",
17+
"positionRelBody": [0, 0, 0]
18+
}},
19+
{"attachmentPoint": {
20+
"name": "cockpit",
21+
"positionRelBody": [4.9818, 0, -0.6165]
22+
}},
23+
{"assetDescription": {
24+
"description": "3d model licenced under Creative Commons Attribution (CC BY)",
25+
"sourceUrl":"http://helijah.free.fr",
26+
"authors": ["3d model: BARANGER Emmanuel (helijah)"]
27+
}}
28+
]
29+
}

Tools/BuildScripts/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def build(skybolt_source_dir: Path, skybolt_build_dir: Path):
1515
Build Skybolt using conan. This will also build dependencies if required.
1616
"""
1717
logging.info(f"Building...")
18-
sp.run(f"conan build {skybolt_source_dir} --output-folder={skybolt_build_dir} -o openscenegraph-mr/*:shared=True -o qt/*:shared=True -o enable_python=True -o enable_bullet=True --build=missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True --lockfile={skybolt_source_dir}/conan-shared.lock --lockfile-partial", shell=True, check=True)
18+
sp.run(f"conan build {skybolt_source_dir} --output-folder={skybolt_build_dir} -o openscenegraph-mr/*:shared=True -o qt/*:shared=True -o enable_python=True -o enable_bullet=True -o enable_jsbsim=True --build=missing -c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True --lockfile={skybolt_source_dir}/conan-shared.lock --lockfile-partial", shell=True, check=True)
1919

2020

2121
def copy_tree(source_dir: Path, destination_dir: Path):

conanfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class SkyboltConan(ConanFile):
1010
options = {
1111
"enable_bullet": [True, False],
1212
"enable_fft_ocean": [True, False],
13+
"enable_jsbsim": [True, False],
1314
"enable_map_features_converter": [True, False],
1415
"enable_python": [True, False],
1516
"enable_qt": [True, False],
@@ -20,6 +21,7 @@ class SkyboltConan(ConanFile):
2021
default_options = {
2122
"enable_bullet": False,
2223
"enable_fft_ocean": True,
24+
"enable_jsbsim": False,
2325
"enable_map_features_converter": True,
2426
"enable_python": True,
2527
"enable_qt": True,
@@ -68,6 +70,9 @@ def requirements(self):
6870
self.include_package("mufft", "1.0.0")
6971
self.include_package("xsimd", "7.4.10", transitive_headers=True)
7072

73+
if self.options.enable_jsbsim:
74+
self.requires("jsbsim/1.1.13")
75+
7176
if self.options.enable_map_features_converter:
7277
self.requires("readosm/1.1.0a")
7378

@@ -85,6 +90,9 @@ def generate(self):
8590
tc.variables["SKYBOLT_PLUGINS_STATIC_BUILD"] = str(not self.options.shared_plugins)
8691
tc.variables["Skybolt_VERSION"] = self.version
8792

93+
if self.options.enable_bullet:
94+
tc.variables["BUILD_JSBSIM_PLUGIN"] = "true"
95+
8896
if self.options.enable_bullet:
8997
tc.variables["BUILD_BULLET_PLUGIN"] = "true"
9098

src/Skybolt/SkyboltEngine/ComponentFactory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static sim::ComponentPtr loadFuselage(Entity* entity, const ComponentFactoryCont
8484
if (inputs && hasControlSurfaces)
8585
{
8686
config.stickInput = inputs->createOrGet("stick", glm::vec2(0), posNegUnitRange<glm::vec2>());
87-
config.rudderInput = inputs->createOrGet("rudder", 0.0f, posNegUnitRange<float>());
87+
config.rudderInput = inputs->createOrGet("pedal", 0.0f, posNegUnitRange<float>());
8888

8989
}
9090
return std::make_shared<FuselageComponent>(config);

src/Skybolt/SkyboltEnginePlugins/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ if (BUILD_FFT_OCEAN_PLUGIN)
99
add_subdirectory(FftOceanTests)
1010
endif()
1111

12+
OPTION(BUILD_JSBSIM_PLUGIN "Build JSBSim Component Plugin")
13+
if (BUILD_JSBSIM_PLUGIN)
14+
add_subdirectory(JsbSim)
15+
endif()
16+
1217
OPTION(BUILD_PYTHON_PLUGIN "Build Python Plugin")
1318
if (BUILD_PYTHON_PLUGIN)
1419
add_subdirectory(Python)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set(TARGET_NAME SkyboltJsbSim)
2+
add_source_group_tree(. SrcFiles)
3+
4+
include_directories("./")
5+
include_directories("../")
6+
include_directories("../../")
7+
8+
find_package(jsbsim REQUIRED)
9+
10+
add_library(${TARGET_NAME} ${SKYBOLT_PLUGINS_LIBRARY_TYPE} ${SrcFiles})
11+
12+
target_include_directories(${TARGET_NAME} PUBLIC ${jsbsim_INCLUDE_DIR}/..)
13+
target_link_libraries (${TARGET_NAME} SkyboltEngine jsbsim::jsbsim)
14+
15+
set_engine_plugin_target_properties(${TARGET_NAME})
16+
skybolt_plugin_install(${TARGET_NAME})

0 commit comments

Comments
 (0)