Skip to content
Snippets Groups Projects
Select Git revision
  • 072ee57e6cafcc4ff1f976720e1cef7729d528bb
  • 5.4 default protected
  • 5.5
  • dev/5.5
  • dev/5.4
  • dev/5.3_downgrade
  • feature/experimenttime_hack
  • 5.3 protected
  • _IntenSelect5.3
  • IntenSelect5.3
  • 4.27 protected
  • 4.26 protected
  • 5.0 protected
  • 4.22 protected
  • 4.21 protected
  • UE5.4-2024.1
  • UE5.4-2024.1-rc1
  • UE5.3-2023.1-rc3
  • UE5.3-2023.1-rc2
  • UE5.3-2023.1-rc
20 results

ContinuousMovementComponent.h

Blame
  • ContinuousMovementComponent.h 3.18 KiB
    // Fill out your copyright notice in the Description page of Project Settings.
    
    #pragma once
    
    #include "CoreMinimal.h"
    #include "Pawn/VirtualRealityPawn.h"
    #include "Components/ActorComponent.h"
    #include "ContinuousMovementComponent.generated.h"
    
    
    UENUM(BlueprintType)
    enum class EVRSteeringModes : uint8
    {
    	STEER_GAZE_DIRECTED UMETA(DisplayName = "Gaze Directed (Movement input is applied in head component direction)"),
    	STEER_HAND_DIRECTED UMETA(DisplayName = "Hand Direced (Movement input is applied in controller direction)")
    };
    
    /**
     * 
     */
    UCLASS(Blueprintable)
    class RWTHVRTOOLKIT_API UContinuousMovementComponent : public UActorComponent
    {
    	GENERATED_BODY()
    
    public:
    
    	virtual void BeginPlay() override;
    	
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement")
    	EVRSteeringModes SteeringMode = EVRSteeringModes::STEER_HAND_DIRECTED;
    	
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement")
    	bool bMoveWithRightHand = true;
    
    	UPROPERTY(EditAnywhere,BlueprintReadWrite, Category = "VR Movement")
    	bool bAllowTurning = true;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement|Turning", meta=(EditCondition="bAllowTurning"))
    	bool bSnapTurn = false;
    	
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement|Turning", meta=(EditCondition="!bSnapTurn && bAllowTurning"))
    	float TurnRateFactor = 1.0f;
    
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement|Turning", meta=(EditCondition="bSnapTurn && bAllowTurning",ClampMin=0,ClampMax=360))
    	float SnapTurnAngle = 22.5;
    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input")
    	class UInputMappingContext* IMCMovementLeft;
    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input")
    	class UInputMappingContext* IMCMovementRight;
    		
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions")
    	class UInputAction* Move;
    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions")
    	class UInputAction* Turn;
    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions")
    	class UInputAction* DesktopRotation;
    
    	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "VR Movement|Input|Actions")
    	class UInputAction* MoveUp;
    	
    	/*Movement Input*/
    	UFUNCTION(BlueprintCallable)
    	void OnBeginMove(const FInputActionValue& Value);
    	
    	UFUNCTION(BlueprintCallable)