diff --git a/Content/Blueprints/OptiXObjects/SelectableLensBP.uasset b/Content/Blueprints/OptiXObjects/SelectableLensBP.uasset index bbb787bd6c9567ff024291f596aeb1c06b6fdc2a..6886e118de8fc72d3edb72fe899aa92bfc9e427d 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 44332b96ae551cc7dff67408d2e2756ba80d920a..f542f83efa30009ee89233fe71d8158451a5504d 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 bba7c43bcee8ab047ea366a19d8937952ced2756..2abe0034ea4d690c667a7b302f4ca795960a023e 100644 Binary files a/Content/Blueprints/OpticalTable.uasset and b/Content/Blueprints/OpticalTable.uasset differ diff --git a/Content/UI/SupportSwapWidget.uasset b/Content/UI/SupportSwapWidget.uasset index e5fa640c411ec3633c2b6f21a8a087b03df1f1fb..c5e829dbb54d85aaea7a235f3446d0c5d6b2feca 100644 Binary files a/Content/UI/SupportSwapWidget.uasset and b/Content/UI/SupportSwapWidget.uasset differ diff --git a/Source/OptiX/Private/OptiXLensComponent.cpp b/Source/OptiX/Private/OptiXLensComponent.cpp index 5420a6f45fd4d5f35ff211dc03e7317f4f42da66..64d5a240093d998e634efe319a12d20a2d7fbf5c 100644 --- a/Source/OptiX/Private/OptiXLensComponent.cpp +++ b/Source/OptiX/Private/OptiXLensComponent.cpp @@ -258,6 +258,8 @@ void UOptiXLensComponent::SetThickness(float Thickness) UE_LOG(LogTemp, Display, TEXT("Setting Thickness: %f"), Thickness); LensThickness = Thickness; QueueOptiXContextUpdate(); + if(IsInGameThread()) + OnLensThicknessChanged.Broadcast(LensThickness); } float UOptiXLensComponent::GetThickness() const @@ -296,6 +298,8 @@ void UOptiXLensComponent::SetLensRadius(float Radius) UE_LOG(LogTemp, Display, TEXT("Setting Lens Radius: %f"), Radius); LensRadius = Radius; QueueOptiXContextUpdate(); + if (IsInGameThread()) + OnLensRadiusChanged.Broadcast(Radius); } float UOptiXLensComponent::GetLensRadius() const diff --git a/Source/OptiX/Private/SelectableActorBase.cpp b/Source/OptiX/Private/SelectableActorBase.cpp index 1ad61d9c6c8bf22860c71594ca7947e759f3ac5f..8a84870ba5d566877056d2ad24b0f1d715178647 100644 --- a/Source/OptiX/Private/SelectableActorBase.cpp +++ b/Source/OptiX/Private/SelectableActorBase.cpp @@ -485,18 +485,18 @@ void ASelectableActorBase::SetRodPosition(FVector TablePosition) // TODO Material highlighting - swap material slots? void ASelectableActorBase::OnOverlapBegin(UPrimitiveComponent * OverlapComponent, AActor * OtherActor, UPrimitiveComponent * OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult) { - int32 N = OverlapComponent->GetNumMaterials(); - for (int32 i = 0; i < N; i++) - { - Cast<UMaterialInstanceDynamic>(OverlapComponent->GetMaterial(i))->SetVectorParameterValue("Color", FLinearColor(0.5, 0.5, 0.8)); - } + //int32 N = OverlapComponent->GetNumMaterials(); + //for (int32 i = 0; i < N; i++) + //{ + // Cast<UMaterialInstanceDynamic>(OverlapComponent->GetMaterial(i))->SetVectorParameterValue("Color", FLinearColor(0.5, 0.5, 0.8)); + //} } void ASelectableActorBase::OnOverlapEnd(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) { - int32 N = OverlappedComp->GetNumMaterials(); - for (int32 i = 0; i < N; i++) - { - Cast<UMaterialInstanceDynamic>(OverlappedComp->GetMaterial(i))->SetVectorParameterValue("Color", FLinearColor(0.4, 0.4, 0.4)); - } + //int32 N = OverlappedComp->GetNumMaterials(); + //for (int32 i = 0; i < N; i++) + //{ + // Cast<UMaterialInstanceDynamic>(OverlappedComp->GetMaterial(i))->SetVectorParameterValue("Color", FLinearColor(0.4, 0.4, 0.4)); + //} } diff --git a/Source/OptiX/Public/OptiXLensComponent.h b/Source/OptiX/Public/OptiXLensComponent.h index 2249e9a92087a7a11f8f2694842ede0b39371ec2..30c035a0e1509fbb8ece911c610639e626b9281b 100644 --- a/Source/OptiX/Public/OptiXLensComponent.h +++ b/Source/OptiX/Public/OptiXLensComponent.h @@ -8,6 +8,9 @@ #include "OptiXLensComponent.generated.h" +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnLensRadiusChanged, float, Radius); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnLensThicknessChanged, float, Thickness); + /** * Lens Type Enum */ @@ -122,6 +125,13 @@ public: UFUNCTION() void OnWavelengthChangedEvent(float WL); + // Event callbacks: + UPROPERTY(BlueprintAssignable, Category = "OptiXLensComponent") + FOnLensRadiusChanged OnLensRadiusChanged; + + UPROPERTY(BlueprintAssignable, Category = "OptiXLensComponent") + FOnLensThicknessChanged OnLensThicknessChanged; + public: // Lens Properties