diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.cpp index 6a8b808..9a60b58 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.cpp @@ -1,11 +1,12 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapImporting.h" #include "OSMFile.h" - +#include "Misc/FeedbackContext.h" FOSMFile::FOSMFile() - : ParsingState( ParsingState::Root ) + : ParsingState(ParsingState::Root), + CurrentNodeID(0), + CurrentNodeInfo(nullptr), + CurrentWayInfo(nullptr), + CurrentWayTagKey(nullptr) { } diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.h index 2b1aafd..3c31d01 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/OSMFile.h @@ -1,9 +1,6 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once - #include "FastXml.h" - /** OpenStreetMap file loader */ class FOSMFile : public IFastXmlCallback { diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.cpp index 774e2e8..9222a1c 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.cpp @@ -1,18 +1,9 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. - -#include "StreetMapImporting.h" -#include "AssetData.h" #include "StreetMapActorFactory.h" +#include "AssetRegistry/AssetData.h" #include "StreetMapActor.h" #include "StreetMapComponent.h" #include "StreetMap.h" - -////////////////////////////////////////////////////////////////////////// -// UStreetMapActorFactory - UStreetMapActorFactory::UStreetMapActorFactory(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { @@ -32,17 +23,6 @@ void UStreetMapActorFactory::PostSpawnActor(UObject* Asset, AActor* NewActor) } } -void UStreetMapActorFactory::PostCreateBlueprint(UObject* Asset, AActor* CDO) -{ - if (Asset != nullptr && CDO != nullptr) - { - UStreetMap* StreetMapAsset = CastChecked(Asset); - AStreetMapActor* StreetMapActor = CastChecked(CDO); - UStreetMapComponent* StreetMapComponent = StreetMapActor->GetStreetMapComponent(); - StreetMapComponent->SetStreetMap(StreetMapAsset, true, false); - } -} - bool UStreetMapActorFactory::CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg) { return (AssetData.IsValid() && AssetData.GetClass()->IsChildOf(UStreetMap::StaticClass())); diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.h index a45a707..15c2f39 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapActorFactory.h @@ -1,8 +1,6 @@ // Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once - -#include "CoreMinimal.h" #include "ActorFactories/ActorFactory.h" #include "StreetMapActorFactory.generated.h" @@ -11,9 +9,8 @@ class UStreetMapActorFactory : public UActorFactory { GENERATED_UCLASS_BODY() - //~ Begin UActorFactory Interface - virtual void PostSpawnActor(UObject* Asset, AActor* NewActor) override; - virtual void PostCreateBlueprint(UObject* Asset, AActor* CDO) override; + //~ Begin UActorFactory Interface + virtual void PostSpawnActor(UObject* Asset, AActor* NewActor) override; virtual bool CanCreateActorFrom(const FAssetData& AssetData, FText& OutErrorMsg) override; //~ End UActorFactory Interface }; diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.cpp index 16dd2e1..b7e026a 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.cpp @@ -1,10 +1,7 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapImporting.h" #include "StreetMapAssetTypeActions.h" #include "StreetMap.h" -#include "AssetData.h" - +#include "AssetRegistry/AssetData.h" +#include "EditorFramework/AssetImportData.h" #define LOCTEXT_NAMESPACE "StreetMapImporting" diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.h index 294936d..50d6f2d 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapAssetTypeActions.h @@ -1,6 +1,4 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once - #include "AssetTypeActions_Base.h" class FStreetMapAssetTypeActions : public FAssetTypeActions_Base diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.cpp index a201f2a..f3365a9 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.cpp @@ -1,29 +1,19 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapImporting.h" - #include "StreetMapComponentDetails.h" - -#include "SlateBasics.h" +#include "AssetToolsModule.h" #include "RawMesh.h" #include "PropertyEditorModule.h" #include "DetailLayoutBuilder.h" #include "DetailCategoryBuilder.h" #include "DetailWidgetRow.h" -#include "PropertyCustomizationHelpers.h" #include "IDetailsView.h" #include "IDetailCustomization.h" -#include "AssetRegistryModule.h" -#include "DlgPickAssetPath.h" -#include "IDetailCustomization.h" -#include "SNotificationList.h" -#include "NotificationManager.h" -#include "AssertionMacros.h" - - +#include "AssetRegistry/AssetRegistryModule.h" +#include "Dialogs/DlgPickAssetPath.h" +#include "Widgets/Notifications/SNotificationList.h" +#include "Framework/Notifications/NotificationManager.h" +#include "Misc/AssertionMacros.h" #include "StreetMapComponent.h" - #define LOCTEXT_NAMESPACE "StreetMapComponentDetails" @@ -254,9 +244,9 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() const FStreetMapVertex& StreetMapVertex = RawMeshVertices[VertexIndex]; - FVector TangentX = StreetMapVertex.TangentX; - FVector TangentZ = StreetMapVertex.TangentZ; - FVector TangentY = (TangentX ^ TangentZ).GetSafeNormal(); + FVector3f TangentX = StreetMapVertex.TangentX; + FVector3f TangentZ = StreetMapVertex.TangentZ; + FVector3f TangentY = (TangentX ^ TangentZ).GetSafeNormal(); RawMesh.WedgeTangentX.Add(TangentX); RawMesh.WedgeTangentY.Add(TangentY); @@ -278,17 +268,16 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() if (RawMesh.VertexPositions.Num() > 3 && RawMesh.WedgeIndices.Num() > 3) { // Then find/create it. - UPackage* Package = CreatePackage(NULL, *UserPackageName); + UPackage* Package = CreatePackage(*UserPackageName); check(Package); // Create StaticMesh object UStaticMesh* StaticMesh = NewObject(Package, MeshName, RF_Public | RF_Standalone); StaticMesh->InitResources(); - StaticMesh->SetLightingGuid(); + StaticMesh->SetLightingGuid(FGuid::NewGuid()); // Add source to new StaticMesh - // 4.23+ : SourceModels est prive, on passe par AddSourceModel() FStaticMeshSourceModel* SrcModel = &StaticMesh->AddSourceModel(); SrcModel->BuildSettings.bRecomputeNormals = false; SrcModel->BuildSettings.bRecomputeTangents = false; @@ -306,7 +295,7 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() StaticMesh->GetStaticMaterials().Add(FStaticMaterial(Material)); } - //Set the Imported version before calling the build + // Set the Imported version before calling the build StaticMesh->ImportVersion = EImportStaticMeshVersion::LastVersion; // Build mesh from source @@ -325,7 +314,10 @@ FReply FStreetMapComponentDetails::OnCreateStaticMeshAssetClicked() FNotificationInfo Info(FText::Format(LOCTEXT("StreetMapMeshConverted", "Successfully Converted Mesh"), FText::FromString(StaticMesh->GetName()))); Info.ExpireDuration = 8.0f; Info.bUseLargeFont = false; - Info.Hyperlink = FSimpleDelegate::CreateLambda([=]() { FAssetEditorManager::Get().OpenEditorForAssets(TArray({ StaticMesh })); }); + + UAssetEditorSubsystem* AssetEditorSubsystem = GEditor->GetEditorSubsystem(); + Info.Hyperlink = FSimpleDelegate::CreateLambda([=]() { AssetEditorSubsystem->OpenEditorForAssets(TArray({ StaticMesh })); }); + Info.HyperlinkText = FText::Format(LOCTEXT("OpenNewAnimationHyperlink", "Open {0}"), FText::FromString(StaticMesh->GetName())); TSharedPtr Notification = FSlateNotificationManager::Get().AddNotification(Info); if (Notification.IsValid()) diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.h index 4967bbf..2fb24bc 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapComponentDetails.h @@ -1,7 +1,4 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - #pragma once - #include "IDetailCustomization.h" class FStreetMapComponentDetails : public IDetailCustomization diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.cpp index 3a289bb..865d98d 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.cpp @@ -1,11 +1,8 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapImporting.h" #include "StreetMapFactory.h" +#include "EditorFramework/AssetImportData.h" #include "OSMFile.h" #include "StreetMap.h" - // Latitude/longitude scale factor // - https://en.wikipedia.org/wiki/Equator#Exact_length static const double EarthCircumference = 40075036.0; @@ -41,7 +38,7 @@ UObject* UStreetMapFactory::FactoryCreateText( UClass* Class, UObject* Parent, F if( !bLoadedOkay ) { - StreetMap->MarkPendingKill(); + StreetMap->MarkAsGarbage(); StreetMap = nullptr; } @@ -54,7 +51,7 @@ bool UStreetMapFactory::LoadFromOpenStreetMapXMLFile( UStreetMap* StreetMap, FSt // OSM data is stored in meters. This is the scale factor to convert those units into UE4's native units (cm) // Keep in mind that if this is changed, UStreetMapComponent sizes for roads may need to be updated too! // @todo: We should make this scale factor customizable as an import option - const float OSMToCentimetersScaleFactor = 100.0f; + const double OSMToCentimetersScaleFactor = 100.0; // Converts latitude to meters @@ -77,9 +74,9 @@ bool UStreetMapFactory::LoadFromOpenStreetMapXMLFile( UStreetMap* StreetMap, FSt const double RelativeToLongitude ) -> FVector2D { // Applies Sanson-Flamsteed (sinusoidal) Projection (see http://www.progonos.com/furuti/MapProj/Normal/CartHow/HowSanson/howSanson.html) - return FVector2D( - (float)( ConvertLongitudeToMeters( Longitude, Latitude ) - ConvertLongitudeToMeters( RelativeToLongitude, Latitude ) ), - (float)( ConvertLatitudeToMeters( Latitude ) - ConvertLatitudeToMeters( RelativeToLatitude ) ) ); + return FVector2d( + ConvertLongitudeToMeters( Longitude, Latitude ) - ConvertLongitudeToMeters( RelativeToLongitude, Latitude ), + ConvertLatitudeToMeters( Latitude ) - ConvertLatitudeToMeters( RelativeToLatitude ) ); }; // Adds a Park to the street map using the OpenStreetMap data, flattening the road's coordinates into our map's space @@ -212,6 +209,9 @@ bool UStreetMapFactory::LoadFromOpenStreetMapXMLFile( UStreetMap* StreetMap, FSt case FOSMFile::EOSMWayType::Road: // @todo: Consider excluding "Road" from our data set, as it could be a highway that wasn't properly tagged in OSM yet RoadType = EStreetMapRoadType::Street; break; + + default: + RoadType = EStreetMapRoadType::Other; } if( RoadType != EStreetMapRoadType::Other ) @@ -334,7 +334,7 @@ bool UStreetMapFactory::LoadFromOpenStreetMapXMLFile( UStreetMap* StreetMap, FSt // we get as much precision as possible. const double RelativeToLatitude = OSMFile.AverageLatitude; const double RelativeToLongitude = OSMFile.AverageLongitude; - const FVector2D NodePos = ConvertLatLongToMetersRelative( + const FVector2d NodePos = ConvertLatLongToMetersRelative( OSMNode.Latitude, OSMNode.Longitude, RelativeToLatitude, diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.h index a9df2ff..1b86bd4 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapFactory.h @@ -1,10 +1,7 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once - #include "Factories/Factory.h" #include "StreetMapFactory.generated.h" - /** * Import factory object for OpenStreetMap assets */ diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.Build.cs b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.Build.cs index d353906..3f2d3bc 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.Build.cs +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.Build.cs @@ -7,8 +7,6 @@ namespace UnrealBuildTool.Rules public StreetMapImporting(ReadOnlyTargetRules Target) : base(Target) { - PrivatePCHHeaderFile = "StreetMapImporting.h"; - PrivateDependencyModuleNames.AddRange( new string[] { "Core", diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.cpp index 4115829..86460f9 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.cpp @@ -1,12 +1,9 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - #include "StreetMapImporting.h" #include "StreetMapAssetTypeActions.h" -#include "ModuleManager.h" +#include "Modules/ModuleManager.h" #include "StreetMapStyle.h" #include "StreetMapComponentDetails.h" - class FStreetMapImportingModule : public IModuleInterface { diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.h index 07df060..45dcbb0 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapImporting.h @@ -1,5 +1,3 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once -#include "UnrealEd.h" diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.cpp index 94b1bed..37fb947 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.cpp @@ -1,9 +1,6 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapImporting.h" #include "StreetMapReimportFactory.h" #include "StreetMap.h" - +#include "EditorFramework/AssetImportData.h" UStreetMapReimportFactory::UStreetMapReimportFactory(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) @@ -17,8 +14,9 @@ bool UStreetMapReimportFactory::CanReimport( UObject* Obj, TArray& OutF if( StreetMap != nullptr ) { OutFilenames.Add( StreetMap->AssetImportData->GetFirstFilename() ); + return true; } - return true; + return false; } diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.h index 1218746..1f1e587 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapReimportFactory.h @@ -1,11 +1,8 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once - #include "StreetMapFactory.h" #include "EditorReimportHandler.h" #include "StreetMapReimportFactory.generated.h" - /** * Import factory object for OpenStreetMap assets */ diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.cpp index ed9df1b..950813c 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.cpp @@ -1,9 +1,7 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapImporting.h" #include "StreetMapStyle.h" -#include "SlateStyle.h" -#include "IPluginManager.h" +#include "Styling/SlateStyle.h" +#include "Styling/SlateStyleRegistry.h" +#include "Interfaces/IPluginManager.h" #define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush( FStreetMapStyle::InContent( RelativePath, ".png" ), __VA_ARGS__ ) @@ -13,7 +11,7 @@ FString FStreetMapStyle::InContent(const FString& RelativePath, const ANSICHAR* return (IconsDir / RelativePath) + Extension; } -TSharedPtr< FSlateStyleSet > FStreetMapStyle::StyleSet = NULL; +TSharedPtr< FSlateStyleSet > FStreetMapStyle::StyleSet = nullptr; TSharedPtr< class ISlateStyle > FStreetMapStyle::Get() { return StyleSet; } void FStreetMapStyle::Initialize() diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.h index 831666d..bfaf846 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapImporting/StreetMapStyle.h @@ -1,5 +1,3 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - #pragma once /** StreetMap Editor Style Helper Class. */ diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.cpp index 5f115cb..d2ca47c 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.cpp @@ -1,9 +1,5 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapRuntime.h" #include "PolygonTools.h" - // Based off "Efficient Polygon Triangulation" algorithm by John W. Ratcliff (http://flipcode.net/archives/Efficient_Polygon_Triangulation.shtml) bool FPolygonTools::TriangulatePolygon( const TArray& Polygon, TArray& TempIndices, TArray& TriangulatedIndices, bool& OutWindsClockwise ) { diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.h index 72e2bed..dd028c0 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/PolygonTools.h @@ -1,9 +1,7 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once class FPolygonTools { - public: /** Triangulate a polygon given a list of contour points, then places results as indices into the original polygon array. Does not support polygons with holes. */ diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMap.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMap.h index c89f500..fba6972 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMap.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMap.h @@ -1,10 +1,7 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - #pragma once - +#include "Math/MathFwd.h" #include "StreetMap.generated.h" - USTRUCT(BlueprintType) struct STREETMAPRUNTIME_API FStreetMapCollisionSettings { @@ -44,17 +41,17 @@ public: /** Roads base vertical offset */ UPROPERTY(Category = StreetMap, EditAnywhere, meta = (ClampMin = "0", UIMin = "0"), DisplayName = "Road Vertical Offset") - float RoadOffesetZ; + float RoadOffesetZ; /** if true buildings mesh will be 3D instead of flat representation. */ UPROPERTY(Category = StreetMap, EditAnywhere, DisplayName = "Create 3D Buildings") - uint32 bWant3DBuildings : 1; + uint32 bWant3DBuildings : 1; /** building level floor conversion factor in centimeters @todo: harmonize with OSMToCentimetersScaleFactor refactoring */ UPROPERTY(Category = StreetMap, EditAnywhere, DisplayName = "Building Level Floor Factor") - float BuildingLevelFloorFactor = 300.0f; + float BuildingLevelFloorFactor = 300.0f; /** * If true, buildings mesh will receive light information. @@ -65,48 +62,47 @@ public: /** Streets thickness */ UPROPERTY(Category = StreetMap, EditAnywhere, meta = (ClampMin = "0", UIMin = "0")) - float StreetThickness; + float StreetThickness; /** Street vertex color */ UPROPERTY(Category = StreetMap, EditAnywhere) - FLinearColor StreetColor; + FLinearColor StreetColor; /** Major road thickness */ UPROPERTY(Category = StreetMap, EditAnywhere, meta = (ClampMin = "0", UIMin = "0")) - float MajorRoadThickness; + float MajorRoadThickness; /** Major road vertex color */ UPROPERTY(Category = StreetMap, EditAnywhere) - FLinearColor MajorRoadColor; + FLinearColor MajorRoadColor; /** Highway thickness */ UPROPERTY(Category = StreetMap, EditAnywhere, meta = (ClampMin = "0", UIMin = "0")) - float HighwayThickness; + float HighwayThickness; /** Highway vertex color */ UPROPERTY(Category = StreetMap, EditAnywhere) - FLinearColor HighwayColor; + FLinearColor HighwayColor; /** Streets Thickness */ UPROPERTY(Category = StreetMap, EditAnywhere, meta = (ClampMin = "0", UIMin = "0")) - float BuildingBorderThickness; + float BuildingBorderThickness; /** Building border vertex color */ UPROPERTY(Category = StreetMap, EditAnywhere) - FLinearColor BuildingBorderLinearColor; + FLinearColor BuildingBorderLinearColor; /** Buildings border vertical offset */ UPROPERTY(Category = StreetMap, EditAnywhere, meta = (ClampMin = "0", UIMin = "0")) - float BuildingBorderZ; - - - /** Water vertex color */ + float BuildingBorderZ; + + /** Water vertex color */ UPROPERTY(Category = StreetMap, EditAnywhere) - FLinearColor WaterColor; - - /** Park vertex color */ + FLinearColor WaterColor; + + /** Park vertex color */ UPROPERTY(Category = StreetMap, EditAnywhere) - FLinearColor ParkColor; + FLinearColor ParkColor; FStreetMapMeshBuildSettings() : @@ -122,11 +118,10 @@ public: BuildingBorderThickness(20.0f), BuildingBorderLinearColor(0.85f, 0.85f, 0.85f), BuildingBorderZ(10.0f), - ParkColor(0.00f, 0.55f, 0.27f), - WaterColor(0.26f, 0.75f, 0.98f) + WaterColor(0.26f, 0.75f, 0.98f), + ParkColor(0.00f, 0.55f, 0.27f) { } - }; @@ -222,6 +217,17 @@ struct STREETMAPRUNTIME_API FStreetMapRoad { return bIsOneWay == 1 ? true : false; } + + FStreetMapRoad() : + RoadName(), + RoadType(EStreetMapRoadType::Street), + NodeIndices(), + RoadPoints(), + BoundsMin(FVector2D::ZeroVector), + BoundsMax(FVector2D::ZeroVector), + bIsOneWay(0) + { + } }; @@ -234,11 +240,11 @@ struct STREETMAPRUNTIME_API FStreetMapRoadRef /** Index of road in the list of all roads in this street map */ UPROPERTY( Category=StreetMap, EditAnywhere ) - int32 RoadIndex; + int32 RoadIndex = INDEX_NONE; /** Index of the point along road where this node exists */ UPROPERTY( Category=StreetMap, EditAnywhere ) - int32 RoadPointIndex; + int32 RoadPointIndex = INDEX_NONE; }; @@ -297,29 +303,29 @@ struct STREETMAPRUNTIME_API FStreetMapBuilding /** Height of the building in meters (if known, otherwise zero) */ UPROPERTY( Category=StreetMap, EditAnywhere ) - float Height; + double Height = 0.0; /** Levels of the building (if known, otherwise zero) */ UPROPERTY(Category = StreetMap, EditAnywhere) - int BuildingLevels; - - /** The amenity of the building */ - UPROPERTY( Category=StreetMap, EditAnywhere, BlueprintReadWrite ) + int BuildingLevels = 0; + + /** The amenity of the building */ + UPROPERTY( Category=StreetMap, EditAnywhere, BlueprintReadWrite ) FString Amenity; - - /** The building type */ - UPROPERTY( Category=StreetMap, EditAnywhere, BlueprintReadWrite ) + + /** The building type */ + UPROPERTY( Category=StreetMap, EditAnywhere, BlueprintReadWrite ) FString Building; // @todo: Performance: Bounding information could be computed at load time if we want to avoid the memory cost of storing it /** 2D bounds (min) of this building's points */ UPROPERTY( Category=StreetMap, EditAnywhere ) - FVector2D BoundsMin; + FVector2D BoundsMin = FVector2D::ZeroVector; /** 2D bounds (max) of this building's points */ UPROPERTY( Category=StreetMap, EditAnywhere ) - FVector2D BoundsMax; + FVector2D BoundsMax = FVector2D::ZeroVector; }; @@ -342,11 +348,11 @@ struct STREETMAPRUNTIME_API FStreetMapWater /** 2D bounds (min) of this water's points */ UPROPERTY( Category=StreetMap, EditAnywhere ) - FVector2D BoundsMin; + FVector2D BoundsMin = FVector2D::ZeroVector; /** 2D bounds (max) of this water's points */ UPROPERTY( Category=StreetMap, EditAnywhere ) - FVector2D BoundsMax; + FVector2D BoundsMax = FVector2D::ZeroVector; }; USTRUCT( BlueprintType ) @@ -366,11 +372,11 @@ struct STREETMAPRUNTIME_API FStreetMapPark /** 2D bounds (min) of this water's points */ UPROPERTY( Category=StreetMap, EditAnywhere ) - FVector2D BoundsMin; + FVector2D BoundsMin = FVector2D::ZeroVector; /** 2D bounds (max) of this water's points */ UPROPERTY( Category=StreetMap, EditAnywhere ) - FVector2D BoundsMax; + FVector2D BoundsMax = FVector2D::ZeroVector; }; @@ -386,7 +392,10 @@ public: UStreetMap(); // UObject overrides - virtual void GetAssetRegistryTags( TArray& OutTags ) const override; + // Portage 5.5 : la surcharge TArray& est depreciee (C4996) et + // disparait a la version suivante du moteur. FAssetRegistryTagsContext est declare + // par UObject/Object.h, aucun include supplementaire n'est necessaire ici. + virtual void GetAssetRegistryTags( FAssetRegistryTagsContext Context ) const override; /** Gets the roads in this street map (read only) */ const TArray& GetRoads() const @@ -681,8 +690,6 @@ inline float FStreetMapRoad::FindPositionAlongRoadForNode( const class UStreetMa { float CurrentPointPositionAlongRoad = 0.0f; - bool bFoundLocation = false; - const int32 NumPoints = RoadPoints.Num(); for( int32 CurrentPointIndex = 0; CurrentPointIndex < PointIndexForNode; ++CurrentPointIndex ) { const FVector2D CurrentPointLocation = RoadPoints[ CurrentPointIndex ]; diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapActor.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapActor.h index e8bae48..7435f91 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapActor.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapActor.h @@ -1,7 +1,4 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - #pragma once - #include "StreetMapActor.generated.h" /** An actor that renders a street map mesh component */ @@ -12,7 +9,7 @@ class STREETMAPRUNTIME_API AStreetMapActor : public AActor /** Component that represents a section of street map roads and buildings */ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "StreetMap") - class UStreetMapComponent* StreetMapComponent; + class UStreetMapComponent* StreetMapComponent; public: FORCEINLINE class UStreetMapComponent* GetStreetMapComponent() { return StreetMapComponent; } diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapComponent.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapComponent.h index ea7ebb1..875a1d1 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapComponent.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/Public/StreetMapComponent.h @@ -1,14 +1,11 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once - #include "StreetMap.h" #include "Components/MeshComponent.h" #include "Interfaces/Interface_CollisionDataProvider.h" -#include "StreetMapSceneProxy.h" +#include "MaterialDomain.h" +#include "../StreetMapSceneProxy.h" #include "StreetMapComponent.generated.h" - - class UBodySetup; /** @@ -141,10 +138,10 @@ protected: void GenerateMesh(); /** Adds a 2D line to the raw mesh */ - void AddThick2DLine(const FVector2D Start, const FVector2D End, const float Z, const float Thickness, const FColor& StartColor, const FColor& EndColor, FBox& MeshBoundingBox); + void AddThick2DLine(const FVector2f Start, const FVector2f End, const float Z, const float Thickness, const FColor& StartColor, const FColor& EndColor, FBox3f& MeshBoundingBox); /** Adds 3D triangles to the raw mesh */ - void AddTriangles(const TArray& Points, const TArray& PointIndices, const FVector& ForwardVector, const FVector& UpVector, const FColor& Color, FBox& MeshBoundingBox); + void AddTriangles(const TArray& Points, const TArray& PointIndices, const FVector3f& ForwardVector, const FVector3f& UpVector, const FColor& Color, FBox3f& MeshBoundingBox); protected: @@ -171,18 +168,17 @@ protected: /** Cached raw mesh vertices */ UPROPERTY() - TArray< struct FStreetMapVertex > Vertices; + TArray< struct FStreetMapVertex > Vertices; /** Cached raw mesh triangle indices */ UPROPERTY() - TArray< uint32 > Indices; + TArray< uint32 > Indices; /** Cached bounding box */ UPROPERTY() - FBoxSphereBounds CachedLocalBounds; + FBoxSphereBounds CachedLocalBounds; /** Cached StreetMap DefaultMaterial */ UPROPERTY() - UMaterialInterface* StreetMapDefaultMaterial; - + UMaterialInterface* StreetMapDefaultMaterial; }; diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMap.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMap.cpp index a998c3a..537e8bb 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMap.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMap.cpp @@ -1,14 +1,11 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapRuntime.h" #include "StreetMap.h" +#include "UObject/AssetRegistryTagsContext.h" #include "EditorFramework/AssetImportData.h" #include "PolygonTools.h" -#include "Runtime/Engine/Classes/Engine/StaticMesh.h" -#include "Runtime/Engine/Public/StaticMeshResources.h" +#include "Engine/StaticMesh.h" +#include "StaticMeshResources.h" #include "PhysicsEngine/BodySetup.h" - UStreetMap::UStreetMap() { #if WITH_EDITORONLY_DATA @@ -20,16 +17,18 @@ UStreetMap::UStreetMap() } -void UStreetMap::GetAssetRegistryTags( TArray& OutTags ) const +// Portage 5.5 : voir StreetMap.h. Meme corps, la seule difference est que le tag est +// pousse dans le contexte au lieu d'etre ajoute a un tableau fourni par l'appelant. +void UStreetMap::GetAssetRegistryTags( FAssetRegistryTagsContext Context ) const { #if WITH_EDITORONLY_DATA if( AssetImportData ) { - OutTags.Add( FAssetRegistryTag( SourceFileTagName(), AssetImportData->GetSourceData().ToJson(), FAssetRegistryTag::TT_Hidden ) ); + Context.AddTag( FAssetRegistryTag( SourceFileTagName(), AssetImportData->GetSourceData().ToJson(), FAssetRegistryTag::TT_Hidden ) ); } #endif - Super::GetAssetRegistryTags( OutTags ); + Super::GetAssetRegistryTags( Context ); } diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapActor.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapActor.cpp index 735f8a0..991f6b3 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapActor.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapActor.cpp @@ -1,10 +1,6 @@ -// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. - -#include "StreetMapRuntime.h" #include "StreetMapActor.h" #include "StreetMapComponent.h" - AStreetMapActor::AStreetMapActor(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) { diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapComponent.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapComponent.cpp index fa8f9d4..6b3a669 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapComponent.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapComponent.cpp @@ -1,21 +1,16 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapRuntime.h" #include "StreetMapComponent.h" #include "StreetMapSceneProxy.h" -#include "Runtime/Engine/Classes/Engine/StaticMesh.h" -#include "Runtime/Engine/Public/StaticMeshResources.h" +#include "NavigationSystem.h" +#include "Engine/StaticMesh.h" +#include "StaticMeshResources.h" #include "PolygonTools.h" - #include "PhysicsEngine/BodySetup.h" #if WITH_EDITOR -#include "ModuleManager.h" +#include "Modules/ModuleManager.h" #include "PropertyEditorModule.h" #endif //WITH_EDITOR - - UStreetMapComponent::UStreetMapComponent(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer), StreetMap(nullptr), @@ -242,7 +237,7 @@ void UStreetMapComponent::GenerateMesh() if( StreetMap != nullptr ) { - FBox MeshBoundingBox; + FBox3f MeshBoundingBox; MeshBoundingBox.Init(); const auto& Roads = StreetMap->GetRoads(); @@ -279,8 +274,8 @@ void UStreetMapComponent::GenerateMesh() for( int32 PointIndex = 0; PointIndex < Road.RoadPoints.Num() - 1; ++PointIndex ) { AddThick2DLine( - Road.RoadPoints[ PointIndex ], - Road.RoadPoints[ PointIndex + 1 ], + FVector2f(Road.RoadPoints[ PointIndex ]), + FVector2f(Road.RoadPoints[ PointIndex + 1 ]), RoadZ, RoadThickness, RoadColor, @@ -291,7 +286,7 @@ void UStreetMapComponent::GenerateMesh() TArray< int32 > TempIndices; TArray< int32 > TriangulatedVertexIndices; - TArray< FVector > TempPoints; + TArray< FVector3f > TempPoints; for( int32 BuildingIndex = 0; BuildingIndex < Buildings.Num(); ++BuildingIndex ) { const auto& Building = Buildings[ BuildingIndex ]; @@ -323,12 +318,12 @@ void UStreetMapComponent::GenerateMesh() // Top of building { - TempPoints.SetNum( Building.BuildingPoints.Num(), false ); + TempPoints.SetNum( Building.BuildingPoints.Num(), EAllowShrinking::No ); for( int32 PointIndex = 0; PointIndex < Building.BuildingPoints.Num(); ++PointIndex ) { - TempPoints[ PointIndex ] = FVector( Building.BuildingPoints[ ( Building.BuildingPoints.Num() - PointIndex ) - 1 ], BuildingFillZ ); + TempPoints[ PointIndex ] = FVector3f( FVector2f(Building.BuildingPoints[ ( Building.BuildingPoints.Num() - PointIndex ) - 1 ]), BuildingFillZ ); } - AddTriangles( TempPoints, TriangulatedVertexIndices, FVector::ForwardVector, FVector::UpVector, BuildingFillColor, MeshBoundingBox ); + AddTriangles( TempPoints, TriangulatedVertexIndices, FVector3f::ForwardVector, FVector3f::UpVector, BuildingFillColor, MeshBoundingBox ); } if( bWant3DBuildings && (Building.Height > KINDA_SMALL_NUMBER || Building.BuildingLevels > 0) ) @@ -341,22 +336,22 @@ void UStreetMapComponent::GenerateMesh() { const int32 RightPointIndex = ( LeftPointIndex + 1 ) % Building.BuildingPoints.Num(); - TempPoints.SetNum( 4, false ); + TempPoints.SetNum( 4, EAllowShrinking::No ); const int32 TopLeftVertexIndex = 0; - TempPoints[ TopLeftVertexIndex ] = FVector( Building.BuildingPoints[ WindsClockwise ? RightPointIndex : LeftPointIndex ], BuildingFillZ ); + TempPoints[ TopLeftVertexIndex ] = FVector3f( FVector2f(Building.BuildingPoints[ WindsClockwise ? RightPointIndex : LeftPointIndex ]), BuildingFillZ ); const int32 TopRightVertexIndex = 1; - TempPoints[ TopRightVertexIndex ] = FVector( Building.BuildingPoints[ WindsClockwise ? LeftPointIndex : RightPointIndex ], BuildingFillZ ); + TempPoints[ TopRightVertexIndex ] = FVector3f( FVector2f(Building.BuildingPoints[ WindsClockwise ? LeftPointIndex : RightPointIndex ]), BuildingFillZ ); const int32 BottomRightVertexIndex = 2; - TempPoints[ BottomRightVertexIndex ] = FVector( Building.BuildingPoints[ WindsClockwise ? LeftPointIndex : RightPointIndex ], 0.0f ); + TempPoints[ BottomRightVertexIndex ] = FVector3f( FVector2f(Building.BuildingPoints[ WindsClockwise ? LeftPointIndex : RightPointIndex ]), 0.0f ); const int32 BottomLeftVertexIndex = 3; - TempPoints[ BottomLeftVertexIndex ] = FVector( Building.BuildingPoints[ WindsClockwise ? RightPointIndex : LeftPointIndex ], 0.0f ); + TempPoints[ BottomLeftVertexIndex ] = FVector3f( FVector2f(Building.BuildingPoints[ WindsClockwise ? RightPointIndex : LeftPointIndex ]), 0.0f ); - TempIndices.SetNum( 6, false ); + TempIndices.SetNum( 6, EAllowShrinking::No ); TempIndices[ 0 ] = BottomLeftVertexIndex; TempIndices[ 1 ] = TopLeftVertexIndex; @@ -366,9 +361,9 @@ void UStreetMapComponent::GenerateMesh() TempIndices[ 4 ] = TopLeftVertexIndex; TempIndices[ 5 ] = TopRightVertexIndex; - const FVector FaceNormal = FVector::CrossProduct( ( TempPoints[ 0 ] - TempPoints[ 2 ] ).GetSafeNormal(), ( TempPoints[ 0 ] - TempPoints[ 1 ] ).GetSafeNormal() ); - const FVector ForwardVector = FVector::UpVector; - const FVector UpVector = FaceNormal; + const FVector3f FaceNormal = FVector3f::CrossProduct( ( TempPoints[ 0 ] - TempPoints[ 2 ] ).GetSafeNormal(), ( TempPoints[ 0 ] - TempPoints[ 1 ] ).GetSafeNormal() ); + const FVector3f ForwardVector = FVector3f::UpVector; + const FVector3f UpVector = FaceNormal; AddTriangles( TempPoints, TempIndices, ForwardVector, UpVector, BuildingFillColor, MeshBoundingBox ); } } @@ -381,10 +376,10 @@ void UStreetMapComponent::GenerateMesh() const FVector2D Point = Building.BuildingPoints[ PointIndex ]; FStreetMapVertex& NewVertex = *new( this->Vertices )FStreetMapVertex(); - NewVertex.Position = FVector( Point, 0.0f ); - NewVertex.TextureCoordinate = FVector2D( 0.0f, 0.0f ); // NOTE: We're not using texture coordinates for anything yet - NewVertex.TangentX = FVector::ForwardVector; // NOTE: Tangents aren't important for these unlit buildings - NewVertex.TangentZ = FVector::UpVector; + NewVertex.Position = FVector3f( FVector2f(Point), 0.0f ); + NewVertex.TextureCoordinate = FVector2f( 0.0f, 0.0f ); // NOTE: We're not using texture coordinates for anything yet + NewVertex.TangentX = FVector3f::ForwardVector; // NOTE: Tangents aren't important for these unlit buildings + NewVertex.TangentZ = FVector3f::UpVector; NewVertex.Color = BuildingFillColor; MeshBoundingBox += NewVertex.Position; @@ -423,8 +418,8 @@ void UStreetMapComponent::GenerateMesh() for( int32 PointIndex = 0; PointIndex < Building.BuildingPoints.Num(); ++PointIndex ) { AddThick2DLine( - Building.BuildingPoints[ PointIndex ], - Building.BuildingPoints[ ( PointIndex + 1 ) % Building.BuildingPoints.Num() ], + FVector2f(Building.BuildingPoints[ PointIndex ]), + FVector2f(Building.BuildingPoints[ ( PointIndex + 1 ) % Building.BuildingPoints.Num() ]), BuildingBorderZ, BuildingBorderThickness, // Thickness BuildingBorderColor, @@ -438,7 +433,7 @@ void UStreetMapComponent::GenerateMesh() TArray< int32 > TempIndicesW; TArray< int32 > TriangulatedVertexIndicesW; - TArray< FVector > TempPointsW; + TArray< FVector3f > TempPointsW; for( int32 WaterIndex = 0; WaterIndex < Waters.Num(); ++WaterIndex ) { const auto& Water = Waters[ WaterIndex ]; @@ -462,12 +457,12 @@ void UStreetMapComponent::GenerateMesh() // Top of Water { - TempPointsW.SetNum( Water.WaterPoints.Num(), false ); + TempPointsW.SetNum( Water.WaterPoints.Num(), EAllowShrinking::No ); for( int32 PointIndex = 0; PointIndex < Water.WaterPoints.Num(); ++PointIndex ) { - TempPointsW[ PointIndex ] = FVector( Water.WaterPoints[ ( Water.WaterPoints.Num() - PointIndex ) - 1 ], WaterFillZ ); + TempPointsW[ PointIndex ] = FVector3f( FVector2f(Water.WaterPoints[ ( Water.WaterPoints.Num() - PointIndex ) - 1 ]), WaterFillZ ); } - AddTriangles( TempPointsW, TriangulatedVertexIndicesW, FVector::ForwardVector, FVector::UpVector, WaterColor, MeshBoundingBox ); + AddTriangles( TempPointsW, TriangulatedVertexIndicesW, FVector3f::ForwardVector, FVector3f::UpVector, WaterColor, MeshBoundingBox ); } } @@ -485,7 +480,7 @@ void UStreetMapComponent::GenerateMesh() TArray< int32 > TempIndicesP; TArray< int32 > TriangulatedVertexIndicesP; - TArray< FVector > TempPointsP; + TArray< FVector3f > TempPointsP; for( int32 ParkIndex = 0; ParkIndex < Parks.Num(); ++ParkIndex ) { const auto& Park = Parks[ ParkIndex ]; @@ -509,12 +504,12 @@ void UStreetMapComponent::GenerateMesh() // Top of Park { - TempPointsP.SetNum( Park.ParkPoints.Num(), false ); + TempPointsP.SetNum( Park.ParkPoints.Num(), EAllowShrinking::No ); for( int32 PointIndex = 0; PointIndex < Park.ParkPoints.Num(); ++PointIndex ) { - TempPointsP[ PointIndex ] = FVector( Park.ParkPoints[ ( Park.ParkPoints.Num() - PointIndex ) - 1 ], ParkFillZ ); + TempPointsP[ PointIndex ] = FVector3f( FVector2f(Park.ParkPoints[ ( Park.ParkPoints.Num() - PointIndex ) - 1 ]), ParkFillZ ); } - AddTriangles( TempPointsP, TriangulatedVertexIndicesP, FVector::ForwardVector, FVector::UpVector, ParkColor, MeshBoundingBox ); + AddTriangles( TempPointsP, TriangulatedVertexIndicesP, FVector3f::ForwardVector, FVector3f::UpVector, ParkColor, MeshBoundingBox ); } } @@ -527,7 +522,7 @@ void UStreetMapComponent::GenerateMesh() // Park border } - CachedLocalBounds = MeshBoundingBox; + CachedLocalBounds = FBox(MeshBoundingBox); } } @@ -646,46 +641,46 @@ FBoxSphereBounds UStreetMapComponent::CalcBounds( const FTransform& LocalToWorld } -void UStreetMapComponent::AddThick2DLine( const FVector2D Start, const FVector2D End, const float Z, const float Thickness, const FColor& StartColor, const FColor& EndColor, FBox& MeshBoundingBox ) +void UStreetMapComponent::AddThick2DLine( const FVector2f Start, const FVector2f End, const float Z, const float Thickness, const FColor& StartColor, const FColor& EndColor, FBox3f& MeshBoundingBox ) { const float HalfThickness = Thickness * 0.5f; - const FVector2D LineDirection = ( End - Start ).GetSafeNormal(); - const FVector2D RightVector( -LineDirection.Y, LineDirection.X ); + const FVector2f LineDirection = ( End - Start ).GetSafeNormal(); + const FVector2f RightVector( -LineDirection.Y, LineDirection.X ); const int32 BottomLeftVertexIndex = Vertices.Num(); FStreetMapVertex& BottomLeftVertex = *new( Vertices )FStreetMapVertex(); - BottomLeftVertex.Position = FVector( Start - RightVector * HalfThickness, Z ); - BottomLeftVertex.TextureCoordinate = FVector2D( 0.0f, 0.0f ); - BottomLeftVertex.TangentX = FVector( LineDirection, 0.0f ); - BottomLeftVertex.TangentZ = FVector::UpVector; + BottomLeftVertex.Position = FVector3f( Start - RightVector * HalfThickness, Z ); + BottomLeftVertex.TextureCoordinate = FVector2f( 0.0f, 0.0f ); + BottomLeftVertex.TangentX = FVector3f( LineDirection, 0.0f ); + BottomLeftVertex.TangentZ = FVector3f::UpVector; BottomLeftVertex.Color = StartColor; MeshBoundingBox += BottomLeftVertex.Position; const int32 BottomRightVertexIndex = Vertices.Num(); FStreetMapVertex& BottomRightVertex = *new( Vertices )FStreetMapVertex(); - BottomRightVertex.Position = FVector( Start + RightVector * HalfThickness, Z ); - BottomRightVertex.TextureCoordinate = FVector2D( 1.0f, 0.0f ); - BottomRightVertex.TangentX = FVector( LineDirection, 0.0f ); - BottomRightVertex.TangentZ = FVector::UpVector; + BottomRightVertex.Position = FVector3f( Start + RightVector * HalfThickness, Z ); + BottomRightVertex.TextureCoordinate = FVector2f( 1.0f, 0.0f ); + BottomRightVertex.TangentX = FVector3f( LineDirection, 0.0f ); + BottomRightVertex.TangentZ = FVector3f::UpVector; BottomRightVertex.Color = StartColor; MeshBoundingBox += BottomRightVertex.Position; const int32 TopRightVertexIndex = Vertices.Num(); FStreetMapVertex& TopRightVertex = *new( Vertices )FStreetMapVertex(); - TopRightVertex.Position = FVector( End + RightVector * HalfThickness, Z ); - TopRightVertex.TextureCoordinate = FVector2D( 1.0f, 1.0f ); - TopRightVertex.TangentX = FVector( LineDirection, 0.0f ); - TopRightVertex.TangentZ = FVector::UpVector; + TopRightVertex.Position = FVector3f( End + RightVector * HalfThickness, Z ); + TopRightVertex.TextureCoordinate = FVector2f( 1.0f, 1.0f ); + TopRightVertex.TangentX = FVector3f( LineDirection, 0.0f ); + TopRightVertex.TangentZ = FVector3f::UpVector; TopRightVertex.Color = EndColor; MeshBoundingBox += TopRightVertex.Position; const int32 TopLeftVertexIndex = Vertices.Num(); FStreetMapVertex& TopLeftVertex = *new( Vertices )FStreetMapVertex(); - TopLeftVertex.Position = FVector( End - RightVector * HalfThickness, Z ); - TopLeftVertex.TextureCoordinate = FVector2D( 0.0f, 1.0f ); - TopLeftVertex.TangentX = FVector( LineDirection, 0.0f ); - TopLeftVertex.TangentZ = FVector::UpVector; + TopLeftVertex.Position = FVector3f( End - RightVector * HalfThickness, Z ); + TopLeftVertex.TextureCoordinate = FVector2f( 0.0f, 1.0f ); + TopLeftVertex.TangentX = FVector3f( LineDirection, 0.0f ); + TopLeftVertex.TangentZ = FVector3f::UpVector; TopLeftVertex.Color = EndColor; MeshBoundingBox += TopLeftVertex.Position; @@ -699,15 +694,15 @@ void UStreetMapComponent::AddThick2DLine( const FVector2D Start, const FVector2D }; -void UStreetMapComponent::AddTriangles( const TArray& Points, const TArray& PointIndices, const FVector& ForwardVector, const FVector& UpVector, const FColor& Color, FBox& MeshBoundingBox ) +void UStreetMapComponent::AddTriangles( const TArray& Points, const TArray& PointIndices, const FVector3f& ForwardVector, const FVector3f& UpVector, const FColor& Color, FBox3f& MeshBoundingBox ) { const int32 FirstVertexIndex = Vertices.Num(); - for( FVector Point : Points ) + for( FVector3f Point : Points ) { FStreetMapVertex& NewVertex = *new( Vertices )FStreetMapVertex(); NewVertex.Position = Point; - NewVertex.TextureCoordinate = FVector2D( 0.0f, 0.0f ); // NOTE: We're not using texture coordinates for anything yet + NewVertex.TextureCoordinate = FVector2f( 0.0f, 0.0f ); // NOTE: We're not using texture coordinates for anything yet NewVertex.TangentX = ForwardVector; NewVertex.TangentZ = UpVector; NewVertex.Color = Color; diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.Build.cs b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.Build.cs index 2a5b5dd..cf7cdb9 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.Build.cs +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.Build.cs @@ -7,8 +7,6 @@ namespace UnrealBuildTool.Rules public StreetMapRuntime(ReadOnlyTargetRules Target) : base(Target) { - PrivatePCHHeaderFile = "StreetMapRuntime.h"; - PrivateDependencyModuleNames.AddRange( new string[] { "Core", @@ -16,15 +14,9 @@ namespace UnrealBuildTool.Rules "Engine", "RHI", "RenderCore", + "NavigationSystem" } ); - - if (Target.bBuildEditor == true) - { - //@TODO: Needed for FPropertyEditorModule::NotifyCustomizationModuleChanged() - //@TOOD: To move/implement in FStreetMapComponentDetails - PrivateDependencyModuleNames.Add("PropertyEditor"); - } - } + } } } \ No newline at end of file diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.cpp index 1b41c09..4a6de7c 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.cpp @@ -1,8 +1,5 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - #include "StreetMapRuntime.h" -#include "ModuleManager.h" - +#include "Modules/ModuleManager.h" class FStreetMapRuntimeModule : public IModuleInterface { diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.h b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.h index cf30db0..45dcbb0 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.h +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapRuntime.h @@ -1,7 +1,3 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. #pragma once -#include "EngineMinimal.h" -#include "Classes/Engine/Engine.h" // For UEngine -#include "EngineGlobals.h" // For GEngine diff --git a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapSceneProxy.cpp b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapSceneProxy.cpp index 3a1c4f5..c1b31b7 100644 --- a/D:/Game/LifePlay-master 4.27/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapSceneProxy.cpp +++ b/D:/Game/LifePlay-master 5.5/Plugins/StreetMap/Source/StreetMapRuntime/StreetMapSceneProxy.cpp @@ -1,18 +1,15 @@ -// Copyright 2017 Mike Fricker. All Rights Reserved. - -#include "StreetMapRuntime.h" #include "StreetMapSceneProxy.h" #include "StreetMapComponent.h" -#include "Runtime/Engine/Public/SceneManagement.h" - +#include "Materials/MaterialRenderProxy.h" +#include "SceneManagement.h" FStreetMapSceneProxy::FStreetMapSceneProxy(const UStreetMapComponent* InComponent) : FPrimitiveSceneProxy(InComponent), - StreetMapComp(InComponent), - CollisionResponse(InComponent->GetCollisionResponseToChannels()), - VertexFactory(GetScene().GetFeatureLevel(), "FStreetMapSceneProxy") + VertexFactory(GetScene().GetFeatureLevel(), "FStreetMapSceneProxy"), + MaterialInterface(nullptr), + StreetMapComp(InComponent), + CollisionResponse(InComponent->GetCollisionResponseToChannels()) { - } void FStreetMapSceneProxy::Init(const UStreetMapComponent* InComponent, const TArray< FStreetMapVertex >& Vertices, const TArray< uint32 >& Indices) @@ -87,9 +84,9 @@ void FStreetMapSceneProxy::InitResources() } -bool FStreetMapSceneProxy::MustDrawMeshDynamically(const FSceneView& View) const +bool FStreetMapSceneProxy::MustDrawMeshDynamically( const FSceneView& View ) const { - return (AllowDebugViewmodes() && View.Family->EngineShowFlags.Wireframe) || IsSelected(); + return ( AllowDebugViewmodes() && View.Family->EngineShowFlags.Wireframe ) || IsSelected(); } @@ -98,18 +95,16 @@ bool FStreetMapSceneProxy::IsInCollisionView(const FEngineShowFlags& EngineShowF return EngineShowFlags.CollisionVisibility || EngineShowFlags.CollisionPawn; } -FPrimitiveViewRelevance FStreetMapSceneProxy::GetViewRelevance(const FSceneView* View) const +FPrimitiveViewRelevance FStreetMapSceneProxy::GetViewRelevance( const FSceneView* View ) const { FPrimitiveViewRelevance Result; Result.bDrawRelevance = IsShown(View); Result.bShadowRelevance = IsShadowCast(View); - - const bool bAlwaysHasDynamicData = false; - + // Only draw dynamically if we're drawing in wireframe or we're selected in the editor - Result.bDynamicRelevance = MustDrawMeshDynamically(*View) || bAlwaysHasDynamicData; - Result.bStaticRelevance = !MustDrawMeshDynamically(*View); - + Result.bDynamicRelevance = MustDrawMeshDynamically( *View ); + Result.bStaticRelevance = !MustDrawMeshDynamically( *View ); + MaterialRelevance.SetPrimitiveViewRelevance(Result); return Result; } @@ -121,33 +116,16 @@ bool FStreetMapSceneProxy::CanBeOccluded() const } -void FStreetMapSceneProxy::MakeMeshBatch(FMeshBatch& Mesh, FMaterialRenderProxy* WireframeMaterialRenderProxyOrNull, bool bDrawCollision) const +void FStreetMapSceneProxy::MakeMeshBatch( FMeshBatch& Mesh, FMaterialRenderProxy* MaterialRenderProxy, bool bInWireframe) const { - FMaterialRenderProxy* MaterialProxy = NULL; - if (WireframeMaterialRenderProxyOrNull != nullptr) - { - MaterialProxy = WireframeMaterialRenderProxyOrNull; - } - else - { - if (bDrawCollision) - { - MaterialProxy = new FColoredMaterialRenderProxy(GEngine->ShadedLevelColorationUnlitMaterial->GetRenderProxy(), FColor::Cyan); - } - else if (MaterialProxy == nullptr) - { - MaterialProxy = StreetMapComp->GetDefaultMaterial()->GetRenderProxy(); - } - } + FMaterialRenderProxy* MaterialProxy = MaterialRenderProxy != nullptr ? MaterialRenderProxy : StreetMapComp->GetDefaultMaterial()->GetRenderProxy(); FMeshBatchElement& BatchElement = Mesh.Elements[0]; BatchElement.IndexBuffer = &IndexBuffer32; - Mesh.bWireframe = WireframeMaterialRenderProxyOrNull != nullptr; + Mesh.bWireframe = bInWireframe; Mesh.VertexFactory = &VertexFactory; Mesh.MaterialRenderProxy = MaterialProxy; Mesh.CastShadow = true; - // 4.22+ : on utilise le uniform buffer du proxy (CreatePrimitiveUniformBufferImmediate a change de signature, UseEditorDepthTest a disparu) - BatchElement.PrimitiveUniformBuffer = GetUniformBuffer(); BatchElement.FirstIndex = 0; const int IndexCount = IndexBuffer32.Indices.Num(); BatchElement.NumPrimitives = IndexCount / 3; @@ -156,19 +134,20 @@ void FStreetMapSceneProxy::MakeMeshBatch(FMeshBatch& Mesh, FMaterialRenderProxy* Mesh.ReverseCulling = IsLocalToWorldDeterminantNegative(); Mesh.Type = PT_TriangleList; Mesh.DepthPriorityGroup = SDPG_World; + Mesh.LODIndex = 0; } -void FStreetMapSceneProxy::DrawStaticElements(FStaticPrimitiveDrawInterface* PDI) +void FStreetMapSceneProxy::DrawStaticElements( FStaticPrimitiveDrawInterface* PDI ) { const int IndexCount = IndexBuffer32.Indices.Num(); - if (VertexBuffer.PositionVertexBuffer.GetNumVertices() > 0 && IndexCount > 0) + if( VertexBuffer.PositionVertexBuffer.GetNumVertices() > 0 && IndexCount > 0 ) { const float ScreenSize = 1.0f; FMeshBatch MeshBatch; - MakeMeshBatch(MeshBatch, nullptr); - PDI->DrawMesh(MeshBatch, ScreenSize); + MakeMeshBatch( MeshBatch, nullptr, false ); + PDI->DrawMesh( MeshBatch, ScreenSize ); } } @@ -184,8 +163,13 @@ void FStreetMapSceneProxy::GetDynamicMeshElements(const TArrayEngineShowFlags.Wireframe; - FColoredMaterialRenderProxy* WireframeMaterialRenderProxy = GEngine->WireframeMaterial && bIsWireframe ? new FColoredMaterialRenderProxy(GEngine->WireframeMaterial->GetRenderProxy(), FLinearColor(0, 0.5f, 1.f)) : NULL; - + FMaterialRenderProxy* WireframeMaterialRenderProxy = nullptr; + if (GEngine->WireframeMaterial && bIsWireframe) + { + // 5.5 : RegisterOneFrameMaterialProxy renvoie void (il renvoie le pointeur a partir de 5.6) + WireframeMaterialRenderProxy = new FColoredMaterialRenderProxy(GEngine->WireframeMaterial->GetRenderProxy(), FLinearColor(0, 0.5f, 1.f)); + Collector.RegisterOneFrameMaterialProxy(WireframeMaterialRenderProxy); + } if (MustDrawMeshDynamically(View)) { @@ -197,9 +181,16 @@ void FStreetMapSceneProxy::GetDynamicMeshElements(const TArrayShadedLevelColorationUnlitMaterial->GetRenderProxy(), FColor::Cyan); + Collector.RegisterOneFrameMaterialProxy(MaterialProxy); + } + // Draw the mesh! FMeshBatch& MeshBatch = Collector.AllocateMesh(); - MakeMeshBatch(MeshBatch, WireframeMaterialRenderProxy, bCanDrawCollision); + MakeMeshBatch(MeshBatch, MaterialProxy, bIsWireframe); Collector.AddMesh(ViewIndex, MeshBatch); } } @@ -207,7 +198,7 @@ void FStreetMapSceneProxy::GetDynamicMeshElements(const TArray