diff --git a/Content/Blueprints/OptiXGameModeBP.uasset b/Content/Blueprints/OptiXGameModeBP.uasset new file mode 100644 index 0000000000000000000000000000000000000000..f54c2d1bc83c9824531808236efdc41e19284d8a Binary files /dev/null and b/Content/Blueprints/OptiXGameModeBP.uasset differ diff --git a/Content/Blueprints/OptiXObjects/SelectableLensBP.uasset b/Content/Blueprints/OptiXObjects/SelectableLensBP.uasset index 32b38ab55ba46369aec475cded46c077bec1bb79..104bf21c0330acb6ac9ad3568c4fc0f65ed608d6 100644 Binary files a/Content/Blueprints/OptiXObjects/SelectableLensBP.uasset and b/Content/Blueprints/OptiXObjects/SelectableLensBP.uasset differ diff --git a/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset b/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset index 85eb9af14c8ea1ab56e73777bd65a3ea07accf86..6f15a576b9883bcf96096b35eff98ca102de424f 100644 Binary files a/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset and b/Content/Blueprints/OptiXVRPawnStandaloneBP.uasset differ diff --git a/Content/Blueprints/OpticalTable.uasset b/Content/Blueprints/OpticalTable.uasset index ea173175cb8d2e338799557b019833b4f530eb5f..14a2a9921cab20cf3fb78f00d3b30d1edbfeca5e 100644 Binary files a/Content/Blueprints/OpticalTable.uasset and b/Content/Blueprints/OpticalTable.uasset differ diff --git a/Content/Blueprints/TabletBP.uasset b/Content/Blueprints/TabletBP.uasset index da7bc0365b0371302ad7bd1e0d74dacd784c10c2..3c2fc8f021c61b63a83d956eada5b026dbed197a 100644 Binary files a/Content/Blueprints/TabletBP.uasset and b/Content/Blueprints/TabletBP.uasset differ diff --git a/Content/OptiXGameModeBP.uasset b/Content/OptiXGameModeBP.uasset new file mode 100644 index 0000000000000000000000000000000000000000..4fa259c02869980cea47647c573b243177cb4e63 Binary files /dev/null and b/Content/OptiXGameModeBP.uasset differ diff --git a/Content/UI/Tablet/CreateMenuWidget.uasset b/Content/UI/Tablet/CreateMenuWidget.uasset index 91a788962e4da7ed6c2e4ffe65599d135b5c28c6..cf579a81bec816a22ae4ad5005a175545d4dc150 100644 Binary files a/Content/UI/Tablet/CreateMenuWidget.uasset and b/Content/UI/Tablet/CreateMenuWidget.uasset differ diff --git a/Content/UI/Tablet/LensMenuWidget.uasset b/Content/UI/Tablet/LensMenuWidget.uasset index b952ef1033923e2ad54969cc65f4272f6aaadc3e..e00a2c46770840021e040c9396a6aa987d1c998e 100644 Binary files a/Content/UI/Tablet/LensMenuWidget.uasset and b/Content/UI/Tablet/LensMenuWidget.uasset differ diff --git a/Content/UI/Tablet/SceneDataUI.uasset b/Content/UI/Tablet/SceneDataUI.uasset new file mode 100644 index 0000000000000000000000000000000000000000..9c5c7547a235ab1f1c2d65ef63ced2d474d1e60c Binary files /dev/null and b/Content/UI/Tablet/SceneDataUI.uasset differ diff --git a/Content/UI/Tablet/ScenesWidget.uasset b/Content/UI/Tablet/ScenesWidget.uasset new file mode 100644 index 0000000000000000000000000000000000000000..43338aed06b3976e6fcff8b13c412cc662835066 Binary files /dev/null and b/Content/UI/Tablet/ScenesWidget.uasset differ diff --git a/Content/UI/Tablet/ScreenWidgetTabs.uasset b/Content/UI/Tablet/ScreenWidgetTabs.uasset new file mode 100644 index 0000000000000000000000000000000000000000..07394843f3e7de81d63338a565aee2de5af146fb Binary files /dev/null and b/Content/UI/Tablet/ScreenWidgetTabs.uasset differ diff --git a/Content/UI/Tablet/TileViewWidget.uasset b/Content/UI/Tablet/TileViewWidget.uasset new file mode 100644 index 0000000000000000000000000000000000000000..c6c16f8b84307cca6ed9a92b44eb91237a3484c6 Binary files /dev/null and b/Content/UI/Tablet/TileViewWidget.uasset differ diff --git a/Source/OptiX/Private/OptiXGameModeBase.cpp b/Source/OptiX/Private/OptiXGameModeBase.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3e245395034ede23f992711cb657ed6070b499b0 --- /dev/null +++ b/Source/OptiX/Private/OptiXGameModeBase.cpp @@ -0,0 +1,28 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "OptiXGameModeBase.h" + +#include "OptiXModule.h" +#include "OptiXPlayerController.h" + +AOptiXGameModeBase::AOptiXGameModeBase(const FObjectInitializer& ObjectInitializer) +{ + PlayerControllerClass = AOptiXPlayerController::StaticClass(); +} + +void AOptiXGameModeBase::InitGame(const FString & MapName, const FString & Options, FString & ErrorMessage) +{ + Super::InitGame(MapName, Options, ErrorMessage); + // Init the context + if (GetWorld() == nullptr) + { + UE_LOG(LogTemp, Error, TEXT("GetWorld was null in gamemode")); + } + FOptiXModule::Get().Init(); +} + +const TArray<FSceneData>& AOptiXGameModeBase::GetOptiXSceneDataArray() +{ + return FOptiXModule::Get().GetSceneDataArray(); +} \ No newline at end of file diff --git a/Source/OptiX/Private/OptiXObjectComponent.cpp b/Source/OptiX/Private/OptiXObjectComponent.cpp index e572cfe3deaa2ca6cfba7dfa9be78ed1fa14ccca..12a9da996a981f25d5dab29c190d061eb90473cd 100644 --- a/Source/OptiX/Private/OptiXObjectComponent.cpp +++ b/Source/OptiX/Private/OptiXObjectComponent.cpp @@ -304,7 +304,7 @@ void UOptiXCubemapComponent::CleanOptiXComponent() //OptiXGeometryGroup = nullptr; // This should trigger the GC and eat the object if this is the last reference OptiXGeometryInstance->RemoveFromRoot(); - //OptiXGeometryInstance->DestroyOptiXObject(); + OptiXGeometryInstance->DestroyOptiXObject(); OptiXGeometryInstance = nullptr; OptiXGeometry->RemoveFromRoot(); diff --git a/Source/OptiX/Private/SelectableActorBase.cpp b/Source/OptiX/Private/SelectableActorBase.cpp index 01b465f0d500d52bb660bec9ed3daa408896aea4..29bf7a23abcde7cabf37840cc1d239e9b0d9b4f7 100644 --- a/Source/OptiX/Private/SelectableActorBase.cpp +++ b/Source/OptiX/Private/SelectableActorBase.cpp @@ -282,7 +282,7 @@ ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectIniti Socket->SetGenerateOverlapEvents(false); Socket->SetMaterial(0, MetalMaterial.Object); Socket->SetCollisionEnabled(ECollisionEnabled::NoCollision); - Socket->SetWorldScale3D(FVector(0.03, 0.03, 0.03)); + Socket->SetWorldScale3D(FVector(0.02, 0.02, 0.02)); //Socket->SetRelativeLocation(FVector(0, 0, 0)); Socket->SetCanEverAffectNavigation(false); Socket->CastShadow = 0; @@ -293,7 +293,7 @@ ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectIniti ConnectorV->SetupAttachment(Socket); ConnectorV->SetStaticMesh(Cylinder2.Object); - ConnectorV->SetWorldScale3D(FVector(0.5, 0.5, -1)); + ConnectorV->SetWorldScale3D(FVector(0.4, 0.4, -1)); ConnectorV->SetGenerateOverlapEvents(false); ConnectorV->SetCollisionEnabled(ECollisionEnabled::NoCollision); ConnectorV->SetMaterial(0, MetalMaterial.Object); @@ -310,7 +310,7 @@ ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectIniti Sphere->SetGenerateOverlapEvents(false); Sphere->SetMaterial(0, MetalMaterial.Object); Sphere->SetCollisionEnabled(ECollisionEnabled::NoCollision); - Sphere->SetWorldScale3D(FVector(0.03, 0.03, 0.03)); + Sphere->SetWorldScale3D(FVector(0.02, 0.02, 0.02)); Sphere->SetRelativeLocation(FVector(0, 0, 100)); Sphere->SetCanEverAffectNavigation(false); Sphere->CastShadow = 0; @@ -322,7 +322,7 @@ ASelectableActorBase::ASelectableActorBase(const FObjectInitializer& ObjectIniti ConnectorH->SetStaticMesh(Cylinder2.Object); ConnectorH->SetGenerateOverlapEvents(false); ConnectorH->SetRelativeLocation(FVector(0, 0, 100)); - ConnectorH->SetWorldScale3D(FVector(0.5, 0.5, 1.0)); + ConnectorH->SetWorldScale3D(FVector(0.4, 0.4, 1.0)); ConnectorH->SetMaterial(0, MetalMaterial.Object); ConnectorH->SetMaterial(1, MetalMaterial.Object); ConnectorH->SetGenerateOverlapEvents(false); @@ -482,17 +482,17 @@ void ASelectableActorBase::SetRodPosition(FVector TablePosition) if ( (Socket->GetComponentLocation().Z <= TableZero.Z) || (Socket->GetComponentLocation() - TableZero).Size() > 200) { ConnectorH->SetWorldScale3D(FVector(0, 0, 0)); - ConnectorV->SetWorldScale3D(FVector(1, 1, -10)); + ConnectorV->SetWorldScale3D(FVector(0.4, 0.4, -10)); return; } float ScaleFactorV = FMath::Abs(ConnectorV->GetComponentLocation().Z - TableZero.Z) / 100.0f; - ConnectorV->SetWorldScale3D(FVector(1, 1, -ScaleFactorV)); + ConnectorV->SetWorldScale3D(FVector(0.4, 0.4, -ScaleFactorV)); FVector DistanceToSphere = TableZero - Sphere->GetComponentLocation(); float ScaleFactorH = DistanceToSphere.Size() / 100.0f; - ConnectorH->SetWorldScale3D(FVector(1, 1, ScaleFactorH)); + ConnectorH->SetWorldScale3D(FVector(0.4, 0.4, ScaleFactorH)); ConnectorH->SetWorldRotation(FRotationMatrix::MakeFromZ(DistanceToSphere).Rotator()); diff --git a/Source/OptiX/Public/OptiXGameModeBase.h b/Source/OptiX/Public/OptiXGameModeBase.h new file mode 100644 index 0000000000000000000000000000000000000000..c5f147c6af51637b1b251f1d4ac46db25c869b4b --- /dev/null +++ b/Source/OptiX/Public/OptiXGameModeBase.h @@ -0,0 +1,27 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/GameModeBase.h" + +#include "OptiXGlassDefinitions.h" + +#include "OptiXGameModeBase.generated.h" + +/** + * + */ +UCLASS() +class OPTIX_API AOptiXGameModeBase : public AGameModeBase +{ + GENERATED_BODY() + +public: + AOptiXGameModeBase(const FObjectInitializer& ObjectInitializer); + + virtual void InitGame(const FString & MapName, const FString & Options, FString & ErrorMessage) override; + + UFUNCTION(BlueprintCallable, BlueprintPure) + const TArray<FSceneData>& GetOptiXSceneDataArray(); +}; diff --git a/Source/OptiX/Public/OptiXGlassDefinitions.h b/Source/OptiX/Public/OptiXGlassDefinitions.h index 93dd0965309f478942961fe2770ca42e47a35f58..e64dd72f63eb2c88488422ef332795935f9be095 100644 --- a/Source/OptiX/Public/OptiXGlassDefinitions.h +++ b/Source/OptiX/Public/OptiXGlassDefinitions.h @@ -67,6 +67,25 @@ struct FSceneData TArray<FLensData> LensData; }; + +UCLASS(BlueprintType, Blueprintable) +class OPTIX_API USceneDataObject : public UObject +{ + GENERATED_BODY() + + +public: + + UPROPERTY(BlueprintReadWrite) + FString SceneName; + + UPROPERTY(BlueprintReadWrite) + int32 Index; + + UPROPERTY(BlueprintReadWrite) + int32 NumberLenses; +}; + // Okay, for some crazy reason glass definitions have been originally saved here... TODOOOOO USTRUCT(BlueprintType) struct FGlassDefinition