diff --git a/Config/DefaultInput.ini b/Config/DefaultInput.ini index d3357e7..7e7f73c 100644 --- a/Config/DefaultInput.ini +++ b/Config/DefaultInput.ini @@ -74,18 +74,13 @@ DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown DefaultViewportMouseLockMode=LockOnCapture FOVScale=0.011110 DoubleClickTime=0.200000 -+ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Bottom) +ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=SpaceBar) -+AxisMappings=(AxisName="Look Up / Down Gamepad",Scale=1.000000,Key=Gamepad_RightY) -+AxisMappings=(AxisName="Look Up / Down Mouse",Scale=-1.000000,Key=MouseY) -+AxisMappings=(AxisName="Move Forward / Backward",Scale=1.000000,Key=Gamepad_LeftY) -+AxisMappings=(AxisName="Move Forward / Backward",Scale=-1.000000,Key=S) -+AxisMappings=(AxisName="Move Forward / Backward",Scale=1.000000,Key=W) -+AxisMappings=(AxisName="Move Right / Left",Scale=-1.000000,Key=A) -+AxisMappings=(AxisName="Move Right / Left",Scale=1.000000,Key=D) -+AxisMappings=(AxisName="Move Right / Left",Scale=1.000000,Key=Gamepad_LeftX) -+AxisMappings=(AxisName="Turn Right / Left Gamepad",Scale=1.000000,Key=Gamepad_RightX) -+AxisMappings=(AxisName="Turn Right / Left Mouse",Scale=1.000000,Key=MouseX) ++AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W) ++AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S) ++AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D) ++AxisMappings=(AxisName="MoveRight",Scale=-1.000000,Key=A) ++AxisMappings=(AxisName="Turn",Scale=1.000000,Key=MouseX) ++AxisMappings=(AxisName="LookUp",Scale=-1.000000,Key=MouseY) DefaultPlayerInputClass=/Script/Engine.PlayerInput DefaultInputComponentClass=/Script/Engine.InputComponent DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks diff --git a/Config/HoloLens/HoloLensEngine.ini b/Config/HoloLens/HoloLensEngine.ini new file mode 100644 index 0000000..7b8b53f --- /dev/null +++ b/Config/HoloLens/HoloLensEngine.ini @@ -0,0 +1,31 @@ + + +[/Script/HoloLensPlatformEditor.HoloLensTargetSettings] +bBuildForEmulation=False +bBuildForDevice=True +bUseNameForLogo=True +bBuildForRetailWindowsStore=False +bAutoIncrementVersion=False +bShouldCreateAppInstaller=False +AppInstallerInstallationURL= +HoursBetweenUpdateChecks=0 +bEnablePIXProfiling=False +TileBackgroundColor=(B=64,G=0,R=0,A=255) +SplashScreenBackgroundColor=(B=64,G=0,R=0,A=255) ++PerCultureResources=(CultureId="",Strings=(PackageDisplayName="",PublisherDisplayName="",PackageDescription="",ApplicationDisplayName="",ApplicationDescription=""),Images=()) +TargetDeviceFamily=Windows.Holographic +MinimumPlatformVersion= +MaximumPlatformVersionTested=10.0.18362.0 +MaxTrianglesPerCubicMeter=500.000000 +SpatialMeshingVolumeSize=20.000000 +CompilerVersion=Default +Windows10SDKVersion=10.0.18362.0 ++CapabilityList=internetClientServer ++CapabilityList=privateNetworkClientServer ++Uap2CapabilityList=spatialPerception +bSetDefaultCapabilities=False +SpatializationPlugin= +ReverbPlugin= +OcclusionPlugin= +SoundCueCookQualityIndex=-1 + diff --git a/Content/Blueprints/Character/BP_BlasterCharacter.uasset b/Content/Blueprints/Character/BP_BlasterCharacter.uasset index 29d515f..d05a144 100644 Binary files a/Content/Blueprints/Character/BP_BlasterCharacter.uasset and b/Content/Blueprints/Character/BP_BlasterCharacter.uasset differ diff --git a/Content/Maps/Lobby.umap b/Content/Maps/Lobby.umap index af77cde..fef659b 100644 Binary files a/Content/Maps/Lobby.umap and b/Content/Maps/Lobby.umap differ diff --git a/Source/Blaster/Character/BlasterCharacter.cpp b/Source/Blaster/Character/BlasterCharacter.cpp index 64abe75..2f21d9b 100644 --- a/Source/Blaster/Character/BlasterCharacter.cpp +++ b/Source/Blaster/Character/BlasterCharacter.cpp @@ -14,7 +14,7 @@ ABlasterCharacter::ABlasterCharacter() CameraBoom = CreateDefaultSubobject(TEXT("CameraBoom")); CameraBoom->SetupAttachment(GetMesh()); CameraBoom->TargetArmLength = 600.f; - CameraBoom->bUsePawnControlRotation = false; + CameraBoom->bUsePawnControlRotation = true; FollowCamera = CreateDefaultSubobject(TEXT("FollowCamera")); FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName); @@ -37,5 +37,41 @@ void ABlasterCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputCo { Super::SetupPlayerInputComponent(PlayerInputComponent); + PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); + PlayerInputComponent->BindAxis("MoveForward", this, &ABlasterCharacter::MoveForward); + PlayerInputComponent->BindAxis("MoveRight", this, &ABlasterCharacter::MoveRight); + PlayerInputComponent->BindAxis("Turn", this, &ABlasterCharacter::Turn); + PlayerInputComponent->BindAxis("LookUp", this, &ABlasterCharacter::LookUp); } +void ABlasterCharacter::MoveForward(float Value) +{ + if (Controller != nullptr && Value != 0.f) + { + const FRotator YawRotation(0.f, Controller->GetControlRotation().Yaw, 0.f); + const FVector Direction(FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X)); + + AddMovementInput(Direction, Value); + } +} + +void ABlasterCharacter::MoveRight(float Value) +{ + if (Controller != nullptr && Value != 0.f) + { + const FRotator YawRotation(0.f, Controller->GetControlRotation().Yaw, 0.f); + const FVector Direction(FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y)); + + AddMovementInput(Direction, Value); + } +} + +void ABlasterCharacter::Turn(float Value) +{ + AddControllerYawInput(Value); +} + +void ABlasterCharacter::LookUp(float Value) +{ + AddControllerPitchInput(Value); +} diff --git a/Source/Blaster/Character/BlasterCharacter.h b/Source/Blaster/Character/BlasterCharacter.h index 2d0ba78..a7f7d77 100644 --- a/Source/Blaster/Character/BlasterCharacter.h +++ b/Source/Blaster/Character/BlasterCharacter.h @@ -19,6 +19,11 @@ public: protected: virtual void BeginPlay() override; + void MoveForward(float Value); + void MoveRight(float Value); + void Turn(float Value); + void LookUp(float Value); + private: UPROPERTY(VisibleAnywhere, Category="Camera") class USpringArmComponent* CameraBoom;