Skip to content
Snippets Groups Projects
Commit 2377f22e authored by Daniel Rupp's avatar Daniel Rupp
Browse files

feature(scaling): makes cave setup actor public and attaches including scale, adjust scale manually

parent c48e4d79
No related branches found
No related tags found
No related merge requests found
Pipeline #424062 failed
...@@ -84,6 +84,15 @@ void UScalingComponent::BeginPlay() ...@@ -84,6 +84,15 @@ void UScalingComponent::BeginPlay()
AddEqualSizedComponent(VRPawn->LeftHand); AddEqualSizedComponent(VRPawn->LeftHand);
AddEqualSizedComponent(VRPawn->RightHand); AddEqualSizedComponent(VRPawn->RightHand);
// in case of cave, also at this to the equal sized components
if(VRPawn->CaveSetupActor)
{
UE_LOG(LogTemp,Display,TEXT("Cave Setup Actor is valid and will be added to equal Sized objects"))
//AddEqualSizedActor(VRPawn->CaveSetupActor);
} else
{
UE_LOG(LogTemp,Display,TEXT("Cave Setup Actor is invalid in ScalingComponent::BeginPlay()"))
}
} }
...@@ -239,6 +248,14 @@ void UScalingComponent::AdjustEqualSizedWorldObjects(float ScaleRatio) ...@@ -239,6 +248,14 @@ void UScalingComponent::AdjustEqualSizedWorldObjects(float ScaleRatio)
CurrActor->SetActorScale3D(CurrentScaling * ScaleRatio); CurrActor->SetActorScale3D(CurrentScaling * ScaleRatio);
} }
if(VRPawn->CaveSetupActor)
{
UE_LOG(LogTemp,Display,TEXT("Adjust Equal Sized World Objects: cave setup is scaled manually"))
FVector CurrentScaling = VRPawn->CaveSetupActor->GetActorScale3D();
VRPawn->CaveSetupActor->SetActorScale3D(CurrentScaling * ScaleRatio);
}
// adjust scene components // adjust scene components
for (USceneComponent* CurrComponent : EqualSizedSceneComponents) for (USceneComponent* CurrComponent : EqualSizedSceneComponents)
{ {
......
...@@ -248,8 +248,8 @@ void ARWTHVRPawn::AttachDCRAtoPawn() ...@@ -248,8 +248,8 @@ void ARWTHVRPawn::AttachDCRAtoPawn()
if (!FoundActors.IsEmpty()) if (!FoundActors.IsEmpty())
{ {
const auto CaveSetupActor = FoundActors[0]; CaveSetupActor = FoundActors[0];
FAttachmentTransformRules AttachmentRules = FAttachmentTransformRules::SnapToTargetNotIncludingScale; FAttachmentTransformRules AttachmentRules = FAttachmentTransformRules::SnapToTargetIncludingScale;
CaveSetupActor->AttachToActor(this, AttachmentRules); CaveSetupActor->AttachToActor(this, AttachmentRules);
UE_LOGFMT(Toolkit, Display, "VirtualRealityPawn: Attaching CaveSetup to our pawn!"); UE_LOGFMT(Toolkit, Display, "VirtualRealityPawn: Attaching CaveSetup to our pawn!");
} }
......
...@@ -83,6 +83,9 @@ public: ...@@ -83,6 +83,9 @@ public:
UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Pawn|LiveLink") UPROPERTY(BlueprintReadOnly, EditAnywhere, Category = "Pawn|LiveLink")
TSubclassOf<AActor> CaveSetupActorClass; TSubclassOf<AActor> CaveSetupActorClass;
UPROPERTY()
AActor* CaveSetupActor;
protected: protected:
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override; virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
void AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const; void AddInputMappingContext(const APlayerController* PC, const UInputMappingContext* Context) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment