Skip to content

Commit

Permalink
iOS support WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickNovelab committed Jan 30, 2024
1 parent 5801fec commit 788fa3a
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ UnrealEngine/UEReferenceApp.sln
UnrealEngine/.idea
UnrealEngine/Plugins/Developer
UnrealEngine/Plugins/Developer/RiderLink
UnrealEngine/UEReferenceApp (IOS).xcworkspace
UnrealEngine/UEReferenceApp (Mac).xcworkspace
12 changes: 1 addition & 11 deletions JSBSimForIOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,4 @@ rm -rf build
mkdir -p build
cd build

cmake .. \
-B_builds -GXcode \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_SYSTEM_NAME=iOS \
#-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
#-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
"-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" \
-DCMAKE_OSX_DEPLOYMENT_TARGET=17 \
-DCMAKE_INSTALL_PREFIX=`pwd`/_install \
-DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
-DCMAKE_IOS_INSTALL_COMBINED=YES
cmake .. -B_builds -GXcode -DCMAKE_SYSTEM_NAME=iOS "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=17 -DCMAKE_INSTALL_PREFIX=`pwd`/_install -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO -DCMAKE_IOS_INSTALL_COMBINED=YES
12 changes: 11 additions & 1 deletion UnrealEngine/Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ r.GPUSkin.UnlimitedBoneInfluences=False
r.GPUSkin.UnlimitedBoneInfluencesThreshold=8
MaxSkinBones=(Default=65536,PerPlatform=(("Mobile", 256)))
r.Mobile.PlanarReflectionMode=0
r.Mobile.SupportsGen4TAA=True
r.Mobile.SupportsGen4TAA=False
bStreamSkeletalMeshLODs=(Default=False,PerPlatform=())
bDiscardSkeletalMeshOptionalLODs=(Default=False,PerPlatform=())
VisualizeCalibrationColorMaterialPath=/Engine/EngineMaterials/PPM_DefaultCalibrationColor.PPM_DefaultCalibrationColor
Expand Down Expand Up @@ -239,3 +239,13 @@ bExplicitCanvasChildZOrder=True
PackageName=com.epic.jsbsim
bPackageDataInsideApk=True

[/Script/MacTargetPlatform.XcodeProjectSettings]
CodeSigningTeam=7YTM7475NW
ApplicationDisplayName=JSBSim Unreal
CodeSigningPrefix=net.demonixis

[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
BundleDisplayName=JSBSimUnreal
BundleName=JSBSimUnreal
bUseRSync=False

90 changes: 90 additions & 0 deletions UnrealEngine/Config/DefaultGame.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


[/Script/EngineSettings.GeneralProjectSettings]
ProjectID=DDA3238A4B288A12484323B86BA5BFA4
CompanyName=Epic Games
Expand All @@ -8,3 +9,92 @@ CopyrightNotice=This application is provided as is, without any support
ProjectDisplayedTitle=NSLOCTEXT("[/Script/EngineSettings]", "F0A0333F4826F67EE00D0CA454DA5449", "Unreal Engine Reference App for JSBSim")
Homepage="https://www.unrealengine.com/"

[/Script/UnrealEd.ProjectPackagingSettings]
Build=IfProjectHasCode
BuildConfiguration=PPBC_Development
BuildTarget=
FullRebuild=False
ForDistribution=False
IncludeDebugFiles=False
BlueprintNativizationMethod=Disabled
bIncludeNativizedAssetsInProjectGeneration=False
bExcludeMonolithicEngineHeadersInNativizedCode=False
UsePakFile=False
bUseIoStore=False
bUseZenStore=False
bMakeBinaryConfig=False
bGenerateChunks=False
bGenerateNoChunks=False
bChunkHardReferencesOnly=False
bForceOneChunkPerFile=False
MaxChunkSize=0
bBuildHttpChunkInstallData=False
HttpChunkInstallDataDirectory=(Path="")
WriteBackMetadataToAssetRegistry=Disabled
bCompressed=True
PackageCompressionFormat=Oodle
bForceUseProjectCompressionFormatIgnoreHardwareOverride=False
PackageAdditionalCompressionOptions=
PackageCompressionMethod=Kraken
PackageCompressionLevel_DebugDevelopment=4
PackageCompressionLevel_TestShipping=5
PackageCompressionLevel_Distribution=7
PackageCompressionMinBytesSaved=1024
PackageCompressionMinPercentSaved=5
bPackageCompressionEnableDDC=False
PackageCompressionMinSizeToConsiderDDC=0
HttpChunkInstallDataVersion=
IncludePrerequisites=True
IncludeAppLocalPrerequisites=False
bShareMaterialShaderCode=True
bDeterministicShaderCodeOrder=False
bSharedMaterialNativeLibraries=True
ApplocalPrerequisitesDirectory=(Path="")
IncludeCrashReporter=False
InternationalizationPreset=English
-CulturesToStage=en
+CulturesToStage=en
LocalizationTargetCatchAllChunkId=0
bCookAll=False
bCookMapsOnly=False
bSkipEditorContent=False
bSkipMovies=False
-IniKeyDenylist=KeyStorePassword
-IniKeyDenylist=KeyPassword
-IniKeyDenylist=rsa.privateexp
-IniKeyDenylist=rsa.modulus
-IniKeyDenylist=rsa.publicexp
-IniKeyDenylist=aes.key
-IniKeyDenylist=SigningPublicExponent
-IniKeyDenylist=SigningModulus
-IniKeyDenylist=SigningPrivateExponent
-IniKeyDenylist=EncryptionKey
-IniKeyDenylist=DevCenterUsername
-IniKeyDenylist=DevCenterPassword
-IniKeyDenylist=IOSTeamID
-IniKeyDenylist=SigningCertificate
-IniKeyDenylist=MobileProvision
-IniKeyDenylist=IniKeyDenylist
-IniKeyDenylist=IniSectionDenylist
+IniKeyDenylist=KeyStorePassword
+IniKeyDenylist=KeyPassword
+IniKeyDenylist=rsa.privateexp
+IniKeyDenylist=rsa.modulus
+IniKeyDenylist=rsa.publicexp
+IniKeyDenylist=aes.key
+IniKeyDenylist=SigningPublicExponent
+IniKeyDenylist=SigningModulus
+IniKeyDenylist=SigningPrivateExponent
+IniKeyDenylist=EncryptionKey
+IniKeyDenylist=DevCenterUsername
+IniKeyDenylist=DevCenterPassword
+IniKeyDenylist=IOSTeamID
+IniKeyDenylist=SigningCertificate
+IniKeyDenylist=MobileProvision
+IniKeyDenylist=IniKeyDenylist
+IniKeyDenylist=IniSectionDenylist
-IniSectionDenylist=HordeStorageServers
-IniSectionDenylist=StorageServers
+IniSectionDenylist=HordeStorageServers
+IniSectionDenylist=StorageServers

3 changes: 3 additions & 0 deletions UnrealEngine/Config/DefaultInput.ini
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ DoubleClickTime=0.200000
+ActionMappings=(ActionName="Elevator Trim Up",bShift=False,bCtrl=True,bAlt=False,bCmd=False,Key=Down)
+ActionMappings=(ActionName="Toggle Aircraft Trace",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=T)
+ActionMappings=(ActionName="CycleMagnetos",bShift=False,bCtrl=True,bAlt=False,bCmd=False,Key=M)
+ActionMappings=(ActionName="SwitchCamera",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_Special_Left)
+AxisMappings=(AxisName="MouseLeftRight",Scale=1.000000,Key=MouseX)
+AxisMappings=(AxisName="MouseUpDown",Scale=1.000000,Key=MouseY)
+AxisMappings=(AxisName="Left Brake Axis",Scale=1.000000,Key=GenericUSBController_Axis4)
Expand Down Expand Up @@ -179,6 +180,8 @@ DoubleClickTime=0.200000
+AxisMappings=(AxisName="ThrottleIncrease",Scale=-1.000000,Key=Gamepad_FaceButton_Bottom)
+AxisMappings=(AxisName="Flaps Increase",Scale=-1.000000,Key=Gamepad_LeftShoulder)
+AxisMappings=(AxisName="Flaps Axis",Scale=1.000000,Key=None)
+AxisMappings=(AxisName="MouseLeftRight",Scale=1.000000,Key=Gamepad_RightX)
+AxisMappings=(AxisName="MouseUpDown",Scale=1.000000,Key=Gamepad_RightY)
DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
Expand Down
Binary file modified UnrealEngine/Content/Blueprints/BP_Airliner.uasset
Binary file not shown.
Binary file not shown.
Binary file modified UnrealEngine/Content/Levels/StartupLevel.umap
Binary file not shown.
Binary file added UnrealEngine/Content/Materials/GrassUV01.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added UnrealEngine/Content/Materials/GrassUV01_N.uasset
Binary file not shown.
Binary file not shown.
Binary file modified UnrealEngine/Content/Terrain/Runway/M_Marking.uasset
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ void UJSBSimMovementComponent::InitializeJSBSim()
PropertyManager = Exec->GetPropertyManager();

// Initialize the Models location, relatively to this plugin

// Get the base directory of this plugin
FString BaseDir = IPluginManager::Get().FindPlugin("JSBSimFlightDynamicsModel")->GetBaseDir();
// Add on the relative location of the third party dll and load it
FString RootDirRelative = FPaths::Combine(*BaseDir, TEXT("Resources/JSBSim"));
const FString& RootDir = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*RootDirRelative);
UE_LOG(LogJSBSim, Display, TEXT("Initializing JSBSimFlightDynamicsModel using Data in '%s'"), *RootDir);

UE_LOG(LogJSBSim, Display, TEXT("Initializing JSBSimFlightDynamicsModel using Data in '%s'"), *RootDir);

// Set data paths...
FString AircraftPath(TEXT("aircraft"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public JSBSim(ReadOnlyTargetRules Target) : base(Target)
if (Target.Platform == UnrealTargetPlatform.Win64)
SetupWindowsPlatform();
else if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS)
SetupApplePlatform();
SetupApplePlatform(Target.Platform == UnrealTargetPlatform.IOS);
else if (Target.Platform == UnrealTargetPlatform.Linux || Target.Platform == UnrealTargetPlatform.Android)
SetupUnixPlatform();
}
Expand Down Expand Up @@ -46,7 +46,7 @@ private void SetupWindowsPlatform()
RuntimeDependencies.Add("$(BinaryOutputDir)/" + "JSBSim.dll", DllFullPath);
}

private void SetupApplePlatform()
private void SetupApplePlatform(bool bIOS)
{
string JSBSimLocalFolder = "JSBSim";
string LibFolderName = "Lib";
Expand All @@ -56,12 +56,15 @@ private void SetupApplePlatform()
string IncludePath = Path.Combine(ModuleDirectory, JSBSimLocalFolder, "Include");
PublicSystemIncludePaths.Add(IncludePath);

string[] DarwinLibs = new [] { "libJSBSim.dylib", "libJSBSim.1.dylib", "libJSBSim.1.2.0.dev1.dylib" };
for(int i = 0; i < DarwinLibs.Length; i++)
if (bIOS)
{
string lib = CheckForFile(LibPath, DarwinLibs[i]);
var lib = CheckForFile(LibPath, "libJSBSim.a");
PublicAdditionalLibraries.Add(lib);
}
else
{
var lib = CheckForFile(LibPath, "libJSBSim.dylib");
PublicAdditionalLibraries.Add(lib);
RuntimeDependencies.Add(lib);
}
}

Expand Down
3 changes: 2 additions & 1 deletion UnrealEngine/UEReferenceApp.uproject
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"Linux",
"Mac",
"Android",
"IOS"
"IOS",
"Windows"
]
}

0 comments on commit 788fa3a

Please sign in to comment.