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

doc(movement): adds some comments

parent 612e8e2d
No related branches found
No related tags found
1 merge request!43refactor(movement): extracts turning logic from MovementCommponentBase to own Component
......@@ -66,6 +66,7 @@ void UTurnComponent::SetupPlayerInput(UInputComponent* PlayerInputComponent)
}
}
// A separate button has to be pressed, for when mouse movement should contribute to turning
void UTurnComponent::StartDesktopRotation()
{
bApplyDesktopRotation = true;
......@@ -138,6 +139,4 @@ void UTurnComponent::RotateCameraAndPawn(float Yaw) const
VRPawn->Controller->SetControlRotation(NewRotation);
VRPawn->SetActorLocationAndRotation(NewLocation, NewRotation);
//FVector MovedBy = NewLocation - OrigLocation;
}
......@@ -45,18 +45,26 @@ public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input")
class UInputMappingContext* IMCMovement_Right;
/**Input Mapping Context that maps buttons for desktop mode*/
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input")
class UInputMappingContext* IMCDesktopRotation;
/*Movement Input*/
/**
* Called every tick as long as stick input is received to allow for continuous turning
* @param Value Stick input value determines turn direction and turn speed
*/
UFUNCTION(BlueprintCallable)
void OnBeginTurn(const FInputActionValue& Value);
/**
* Called once if stick input is received to rotate player at constant value
* @param Value Stick input value determines turn direction
*/
UFUNCTION(BlueprintCallable)
void OnBeginSnapTurn(const FInputActionValue& Value);
/*Desktop Testing*/
// the idea is that you have to hold the right mouse button to do rotations
// A separate button has to be pressed, for when mouse movement should contribute to turning
UFUNCTION()
void StartDesktopRotation();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment