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

feature(scaling): cave actor should scale according to vr pawn

parent c7b2dfc2
No related branches found
No related tags found
No related merge requests found
Pipeline #424729 failed
...@@ -87,8 +87,8 @@ void UScalingComponent::BeginPlay() ...@@ -87,8 +87,8 @@ void UScalingComponent::BeginPlay()
// in case of cave, also at this to the equal sized components // in case of cave, also at this to the equal sized components
if(VRPawn->CaveSetupActor) if(VRPawn->CaveSetupActor)
{ {
//UE_LOG(LogTemp,Display,TEXT("Cave Setup Actor is valid and will be added to equal Sized objects")) UE_LOG(LogTemp,Display,TEXT("Cave Setup Actor is valid and will be added to equal Sized objects"))
//AddEqualSizedActor(VRPawn->CaveSetupActor); AddEqualSizedActor(VRPawn->CaveSetupActor);
} else } else
{ {
UE_LOG(LogTemp,Display,TEXT("Cave Setup Actor is invalid in ScalingComponent::BeginPlay()")) UE_LOG(LogTemp,Display,TEXT("Cave Setup Actor is invalid in ScalingComponent::BeginPlay()"))
...@@ -126,7 +126,7 @@ void UScalingComponent::OnGrow(const FInputActionValue& InputActionValue) ...@@ -126,7 +126,7 @@ void UScalingComponent::OnGrow(const FInputActionValue& InputActionValue)
float PreviousScale = CurrentW2MScale; // store for computing scale ratio float PreviousScale = CurrentW2MScale; // store for computing scale ratio
CurrentW2MScale = CurrentW2MScale * (1 + ScaleStepSize); CurrentW2MScale = CurrentW2MScale * (1 + ScaleStepSize);
GNearClippingPlane = CurrentW2MScale; //GNearClippingPlane = CurrentW2MScale;
FloatingPawnMovement->Acceleration = DefaultAcceleration * CurrentW2MScale/100; FloatingPawnMovement->Acceleration = DefaultAcceleration * CurrentW2MScale/100;
FloatingPawnMovement->Deceleration = DefaultDeceleration* CurrentW2MScale/100; FloatingPawnMovement->Deceleration = DefaultDeceleration* CurrentW2MScale/100;
...@@ -156,7 +156,7 @@ void UScalingComponent::OnShrink(const FInputActionValue& InputActionValue) ...@@ -156,7 +156,7 @@ void UScalingComponent::OnShrink(const FInputActionValue& InputActionValue)
float PreviousScale = CurrentW2MScale; // store for computing scale ratio float PreviousScale = CurrentW2MScale; // store for computing scale ratio
CurrentW2MScale = CurrentW2MScale / (1.f + ScaleStepSize); CurrentW2MScale = CurrentW2MScale / (1.f + ScaleStepSize);
GNearClippingPlane = CurrentW2MScale; //GNearClippingPlane = CurrentW2MScale;
FloatingPawnMovement->Acceleration = DefaultAcceleration * CurrentW2MScale/100; FloatingPawnMovement->Acceleration = DefaultAcceleration * CurrentW2MScale/100;
FloatingPawnMovement->Deceleration = DefaultDeceleration * CurrentW2MScale/100; FloatingPawnMovement->Deceleration = DefaultDeceleration * CurrentW2MScale/100;
FloatingPawnMovement->MaxSpeed = DefaultMaxSpeed * CurrentW2MScale/100; FloatingPawnMovement->MaxSpeed = DefaultMaxSpeed * CurrentW2MScale/100;
...@@ -187,7 +187,7 @@ void UScalingComponent::OnResetScale(const FInputActionValue& InputActionValue) ...@@ -187,7 +187,7 @@ void UScalingComponent::OnResetScale(const FInputActionValue& InputActionValue)
float CurrentW2MScale = UHeadMountedDisplayFunctionLibrary::GetWorldToMetersScale(GetOwner()->GetWorld()); float CurrentW2MScale = UHeadMountedDisplayFunctionLibrary::GetWorldToMetersScale(GetOwner()->GetWorld());
float PreviousScale = CurrentW2MScale; // store for computing scale ratio float PreviousScale = CurrentW2MScale; // store for computing scale ratio
CurrentW2MScale = OriginalScale; CurrentW2MScale = OriginalScale;
GNearClippingPlane = CurrentW2MScale; //GNearClippingPlane = CurrentW2MScale;
FloatingPawnMovement->Acceleration = DefaultAcceleration * CurrentW2MScale/100; FloatingPawnMovement->Acceleration = DefaultAcceleration * CurrentW2MScale/100;
FloatingPawnMovement->Deceleration = DefaultDeceleration * CurrentW2MScale/100; FloatingPawnMovement->Deceleration = DefaultDeceleration * CurrentW2MScale/100;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment