forked from orfeasel/UE4-Cpp-Tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Basic Steam Integration Tutorial
- Loading branch information
Showing
63 changed files
with
2,574 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Steam Sample projects | ||
|
||
Read the full tutorial here: http://wp.me/p6hvtS-jJ |
Binary file not shown.
239 changes: 239 additions & 0 deletions
239
SteamIntegration/SteamIntegrationTut/Build/WindowsNoEditor/FileOpenOrder/CookerOpenOrder.log
Large diffs are not rendered by default.
Oops, something went wrong.
1,763 changes: 1,763 additions & 0 deletions
1,763
SteamIntegration/SteamIntegrationTut/Build/WindowsNoEditor/FileOpenOrder/EditorOpenOrder.log
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
SteamIntegration/SteamIntegrationTut/Config/DefaultEditor.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[UnrealEd.SimpleMap] | ||
SimpleMapName=/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap | ||
|
||
[EditoronlyBP] | ||
bAllowClassAndBlueprintPinMatching=true | ||
bReplaceBlueprintWithClass= true | ||
bDontLoadBlueprintOutsideEditor= true | ||
bBlueprintIsNotBlueprintType= true |
2 changes: 2 additions & 0 deletions
2
SteamIntegration/SteamIntegrationTut/Config/DefaultEditorPerProjectUserSettings.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[ContentBrowser] | ||
ContentBrowserTab1.SelectedPaths=/Game/ThirdPersonCPP |
37 changes: 37 additions & 0 deletions
37
SteamIntegration/SteamIntegrationTut/Config/DefaultEngine.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[/Script/EngineSettings.GameMapsSettings] | ||
GameDefaultMap=/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap | ||
EditorStartupMap=/Game/ThirdPersonCPP/Maps/ThirdPersonExampleMap | ||
GlobalDefaultGameMode="/Script/SteamIntegrationTut.SteamIntegrationTutGameMode" | ||
|
||
[/Script/IOSRuntimeSettings.IOSRuntimeSettings] | ||
MinimumiOSVersion=IOS_8 | ||
|
||
|
||
[/Script/Engine.Engine] | ||
+ActiveGameNameRedirects=(OldGameName="TP_ThirdPerson",NewGameName="/Script/SteamIntegrationTut") | ||
+ActiveGameNameRedirects=(OldGameName="/Script/TP_ThirdPerson",NewGameName="/Script/SteamIntegrationTut") | ||
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonGameMode",NewClassName="SteamIntegrationTutGameMode") | ||
+ActiveClassRedirects=(OldClassName="TP_ThirdPersonCharacter",NewClassName="SteamIntegrationTutCharacter") | ||
!NetDriverDefinitions=ClearArray | ||
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver") | ||
|
||
|
||
[/Script/HardwareTargeting.HardwareTargetingSettings] | ||
TargetedHardwareClass=Desktop | ||
AppliedTargetedHardwareClass=Desktop | ||
DefaultGraphicsPerformance=Maximum | ||
AppliedDefaultGraphicsPerformance=Maximum | ||
|
||
[OnlineSubsystem] | ||
DefaultPlatformService=Steam | ||
PollingIntervalInMs=20 | ||
|
||
[OnlineSubsystemSteam] | ||
bEnabled=true | ||
SteamDevAppId=480 | ||
GameServerQueryPort=27015 | ||
bRelaunchInSteam=false | ||
GameVersion=1.0.0.0 | ||
bVACEnabled=1 | ||
bAllowP2PPacketRelay=true | ||
P2PConnectionTimeout=90 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[/Script/EngineSettings.GeneralProjectSettings] | ||
ProjectID=15D66C5E473FAC89ED3925BF7B0E309E | ||
ProjectName=Third Person Game Template |
24 changes: 24 additions & 0 deletions
24
SteamIntegration/SteamIntegrationTut/Config/DefaultInput.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[/Script/Engine.InputSettings] | ||
+ActionMappings=(ActionName="Jump", Key=SpaceBar) | ||
+ActionMappings=(ActionName="Jump", Key=Gamepad_FaceButton_Bottom) | ||
|
||
+AxisMappings=(AxisName="MoveForward", Key=W, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=S, Scale=-1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=Up, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=Down, Scale=-1.f) | ||
+AxisMappings=(AxisName="MoveForward", Key=Gamepad_LeftY, Scale=1.f) | ||
|
||
+AxisMappings=(AxisName="MoveRight", Key=A, Scale=-1.f) | ||
+AxisMappings=(AxisName="MoveRight", Key=D, Scale=1.f) | ||
+AxisMappings=(AxisName="MoveRight", Key=Gamepad_LeftX, Scale=1.f) | ||
|
||
+AxisMappings=(AxisName="TurnRate", Key=Gamepad_RightX, Scale=1.f) | ||
+AxisMappings=(AxisName="TurnRate", Key=Left, Scale=-1.f) | ||
+AxisMappings=(AxisName="TurnRate", Key=Right, Scale=1.f) | ||
+AxisMappings=(AxisName="Turn", Key=MouseX, Scale=1.f) | ||
|
||
+AxisMappings=(AxisName="LookUpRate", Key=Gamepad_RightY, Scale=1.f) | ||
+AxisMappings=(AxisName="LookUp", Key=MouseY, Scale=-1.f) | ||
|
||
+ActionMappings=(ActionName="ResetVR", Key=R) | ||
+ActionMappings=(ActionName="ResetVR",Key=MotionController_Left_Grip1,bShift=False,bCtrl=False,bAlt=False,bCmd=False) |
Binary file added
BIN
+73.1 KB
SteamIntegration/SteamIntegrationTut/Content/Geometry/Meshes/1M_Cube.uasset
Binary file not shown.
Binary file added
BIN
+105 KB
SteamIntegration/SteamIntegrationTut/Content/Geometry/Meshes/1M_Cube_Chamfer.uasset
Binary file not shown.
Binary file added
BIN
+90.4 KB
SteamIntegration/SteamIntegrationTut/Content/Geometry/Meshes/CubeMaterial.uasset
Binary file not shown.
Binary file added
BIN
+93.9 KB
SteamIntegration/SteamIntegrationTut/Content/Geometry/Meshes/TemplateFloor.uasset
Binary file not shown.
Binary file added
BIN
+164 KB
SteamIntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPersonIdle.uasset
Binary file not shown.
Binary file added
BIN
+112 KB
SteamIntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPersonJump_End.uasset
Binary file not shown.
Binary file added
BIN
+122 KB
...mIntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPersonJump_Loop.uasset
Binary file not shown.
Binary file added
BIN
+117 KB
...Integration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPersonJump_Start.uasset
Binary file not shown.
Binary file added
BIN
+120 KB
SteamIntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPersonRun.uasset
Binary file not shown.
Binary file added
BIN
+133 KB
SteamIntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPersonWalk.uasset
Binary file not shown.
Binary file added
BIN
+377 KB
SteamIntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPerson_AnimBP.uasset
Binary file not shown.
Binary file added
BIN
+86.4 KB
...ntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPerson_IdleRun_2D.uasset
Binary file not shown.
Binary file added
BIN
+112 KB
SteamIntegration/SteamIntegrationTut/Content/Mannequin/Animations/ThirdPerson_Jump.uasset
Binary file not shown.
Binary file added
BIN
+145 KB
...ntegration/SteamIntegrationTut/Content/Mannequin/Character/Materials/M_UE4Man_Body.uasset
Binary file not shown.
Binary file added
BIN
+119 KB
...ation/SteamIntegrationTut/Content/Mannequin/Character/Materials/M_UE4Man_ChestLogo.uasset
Binary file not shown.
Binary file added
BIN
+86.4 KB
...nTut/Content/Mannequin/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset
Binary file not shown.
Binary file added
BIN
+98.5 KB
...ionTut/Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset
Binary file not shown.
Binary file added
BIN
+83.4 KB
...t/Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset
Binary file not shown.
Binary file added
BIN
+87 KB
...tegrationTut/Content/Mannequin/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset
Binary file not shown.
Binary file added
BIN
+446 KB
...ntegrationTut/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset
Binary file not shown.
Binary file added
BIN
+461 KB
...egrationTut/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset
Binary file not shown.
Binary file added
BIN
+490 KB
...tionTut/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset
Binary file not shown.
Binary file added
BIN
+418 KB
...tionTut/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset
Binary file not shown.
Binary file added
BIN
+3.6 MB
SteamIntegration/SteamIntegrationTut/Content/Mannequin/Character/Mesh/SK_Mannequin.uasset
Binary file not shown.
Binary file added
BIN
+25.4 KB
...ion/SteamIntegrationTut/Content/Mannequin/Character/Mesh/SK_Mannequin_PhysicsAsset.uasset
Binary file not shown.
Binary file added
BIN
+10.9 KB
...ration/SteamIntegrationTut/Content/Mannequin/Character/Mesh/UE4_Mannequin_Skeleton.uasset
Binary file not shown.
Binary file added
BIN
+158 KB
...Integration/SteamIntegrationTut/Content/Mannequin/Character/Textures/UE4Man_Logo_N.uasset
Binary file not shown.
Binary file added
BIN
+93.2 KB
...Integration/SteamIntegrationTut/Content/Mannequin/Character/Textures/UE4_LOGO_CARD.uasset
Binary file not shown.
Binary file added
BIN
+219 KB
...n/SteamIntegrationTut/Content/Mannequin/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset
Binary file not shown.
Binary file added
BIN
+5.23 MB
...on/SteamIntegrationTut/Content/Mannequin/Character/Textures/UE4_Mannequin__normals.uasset
Binary file not shown.
Binary file added
BIN
+84.6 KB
SteamIntegration/SteamIntegrationTut/Content/ThirdPerson/Meshes/Bump_StaticMesh.uasset
Binary file not shown.
Binary file added
BIN
+491 Bytes
SteamIntegration/SteamIntegrationTut/Content/ThirdPerson/Meshes/CubeMaterial.uasset
Binary file not shown.
Binary file added
BIN
+86.1 KB
SteamIntegration/SteamIntegrationTut/Content/ThirdPerson/Meshes/LeftArm_StaticMesh.uasset
Binary file not shown.
Binary file added
BIN
+93 KB
...Integration/SteamIntegrationTut/Content/ThirdPerson/Meshes/Linear_Stair_StaticMesh.uasset
Binary file not shown.
Binary file added
BIN
+87 KB
SteamIntegration/SteamIntegrationTut/Content/ThirdPerson/Meshes/RampMaterial.uasset
Binary file not shown.
Binary file added
BIN
+83.3 KB
SteamIntegration/SteamIntegrationTut/Content/ThirdPerson/Meshes/Ramp_StaticMesh.uasset
Binary file not shown.
Binary file added
BIN
+84 KB
SteamIntegration/SteamIntegrationTut/Content/ThirdPerson/Meshes/RightArm_StaticMesh.uasset
Binary file not shown.
Binary file added
BIN
+109 KB
...gration/SteamIntegrationTut/Content/ThirdPersonCPP/Blueprints/ThirdPersonCharacter.uasset
Binary file not shown.
Binary file added
BIN
+8.53 MB
SteamIntegration/SteamIntegrationTut/Content/ThirdPersonCPP/Maps/ThirdPersonExampleMap.umap
Binary file not shown.
Binary file added
BIN
+2.78 MB
...on/SteamIntegrationTut/Content/ThirdPersonCPP/Maps/ThirdPersonExampleMap_BuiltData.uasset
Binary file not shown.
Binary file added
BIN
+5.89 MB
SteamIntegration/SteamIntegrationTut/Intermediate/CachedAssetRegistry.bin
Binary file not shown.
26 changes: 26 additions & 0 deletions
26
SteamIntegration/SteamIntegrationTut/Source/SteamIntegrationTut.Target.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
|
||
using UnrealBuildTool; | ||
using System.Collections.Generic; | ||
|
||
public class SteamIntegrationTutTarget : TargetRules | ||
{ | ||
public SteamIntegrationTutTarget(TargetInfo Target) | ||
{ | ||
Type = TargetType.Game; | ||
bUsesSteam = true; | ||
} | ||
|
||
// | ||
// TargetRules interface. | ||
// | ||
|
||
public override void SetupBinaries( | ||
TargetInfo Target, | ||
ref List<UEBuildBinaryConfiguration> OutBuildBinaryConfigurations, | ||
ref List<string> OutExtraModuleNames | ||
) | ||
{ | ||
OutExtraModuleNames.Add("SteamIntegrationTut"); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
SteamIntegration/SteamIntegrationTut/Source/SteamIntegrationTut/SteamIntegrationTut.Build.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
|
||
using UnrealBuildTool; | ||
|
||
public class SteamIntegrationTut : ModuleRules | ||
{ | ||
public SteamIntegrationTut(TargetInfo Target) | ||
{ | ||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay" }); | ||
|
||
PublicDependencyModuleNames.AddRange(new string[] { "OnlineSubsystem", "OnlineSubsystemUtils" }); | ||
|
||
DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam"); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
SteamIntegration/SteamIntegrationTut/Source/SteamIntegrationTut/SteamIntegrationTut.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "SteamIntegrationTut.h" | ||
|
||
|
||
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, SteamIntegrationTut, "SteamIntegrationTut" ); | ||
|
7 changes: 7 additions & 0 deletions
7
SteamIntegration/SteamIntegrationTut/Source/SteamIntegrationTut/SteamIntegrationTut.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
|
||
#ifndef __STEAMINTEGRATIONTUT_H__ | ||
#define __STEAMINTEGRATIONTUT_H__ | ||
|
||
#include "EngineMinimal.h" | ||
#endif |
129 changes: 129 additions & 0 deletions
129
...tegration/SteamIntegrationTut/Source/SteamIntegrationTut/SteamIntegrationTutCharacter.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "SteamIntegrationTut.h" | ||
#include "Kismet/HeadMountedDisplayFunctionLibrary.h" | ||
#include "SteamIntegrationTutCharacter.h" | ||
|
||
////////////////////////////////////////////////////////////////////////// | ||
// ASteamIntegrationTutCharacter | ||
|
||
ASteamIntegrationTutCharacter::ASteamIntegrationTutCharacter() | ||
{ | ||
// Set size for collision capsule | ||
GetCapsuleComponent()->InitCapsuleSize(42.f, 96.0f); | ||
|
||
// set our turn rates for input | ||
BaseTurnRate = 45.f; | ||
BaseLookUpRate = 45.f; | ||
|
||
// Don't rotate when the controller rotates. Let that just affect the camera. | ||
bUseControllerRotationPitch = false; | ||
bUseControllerRotationYaw = false; | ||
bUseControllerRotationRoll = false; | ||
|
||
// Configure character movement | ||
GetCharacterMovement()->bOrientRotationToMovement = true; // Character moves in the direction of input... | ||
GetCharacterMovement()->RotationRate = FRotator(0.0f, 540.0f, 0.0f); // ...at this rotation rate | ||
GetCharacterMovement()->JumpZVelocity = 600.f; | ||
GetCharacterMovement()->AirControl = 0.2f; | ||
|
||
// Create a camera boom (pulls in towards the player if there is a collision) | ||
CameraBoom = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraBoom")); | ||
CameraBoom->SetupAttachment(RootComponent); | ||
CameraBoom->TargetArmLength = 300.0f; // The camera follows at this distance behind the character | ||
CameraBoom->bUsePawnControlRotation = true; // Rotate the arm based on the controller | ||
|
||
// Create a follow camera | ||
FollowCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("FollowCamera")); | ||
FollowCamera->SetupAttachment(CameraBoom, USpringArmComponent::SocketName); // Attach the camera to the end of the boom and let the boom adjust to match the controller orientation | ||
FollowCamera->bUsePawnControlRotation = false; // Camera does not rotate relative to arm | ||
|
||
// Note: The skeletal mesh and anim blueprint references on the Mesh component (inherited from Character) | ||
// are set in the derived blueprint asset named MyCharacter (to avoid direct content references in C++) | ||
} | ||
|
||
////////////////////////////////////////////////////////////////////////// | ||
// Input | ||
|
||
void ASteamIntegrationTutCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) | ||
{ | ||
// Set up gameplay key bindings | ||
check(PlayerInputComponent); | ||
PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); | ||
PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping); | ||
|
||
PlayerInputComponent->BindAxis("MoveForward", this, &ASteamIntegrationTutCharacter::MoveForward); | ||
PlayerInputComponent->BindAxis("MoveRight", this, &ASteamIntegrationTutCharacter::MoveRight); | ||
|
||
// We have 2 versions of the rotation bindings to handle different kinds of devices differently | ||
// "turn" handles devices that provide an absolute delta, such as a mouse. | ||
// "turnrate" is for devices that we choose to treat as a rate of change, such as an analog joystick | ||
PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput); | ||
PlayerInputComponent->BindAxis("TurnRate", this, &ASteamIntegrationTutCharacter::TurnAtRate); | ||
PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput); | ||
PlayerInputComponent->BindAxis("LookUpRate", this, &ASteamIntegrationTutCharacter::LookUpAtRate); | ||
|
||
// handle touch devices | ||
PlayerInputComponent->BindTouch(IE_Pressed, this, &ASteamIntegrationTutCharacter::TouchStarted); | ||
PlayerInputComponent->BindTouch(IE_Released, this, &ASteamIntegrationTutCharacter::TouchStopped); | ||
|
||
// VR headset functionality | ||
PlayerInputComponent->BindAction("ResetVR", IE_Pressed, this, &ASteamIntegrationTutCharacter::OnResetVR); | ||
} | ||
|
||
|
||
void ASteamIntegrationTutCharacter::OnResetVR() | ||
{ | ||
UHeadMountedDisplayFunctionLibrary::ResetOrientationAndPosition(); | ||
} | ||
|
||
void ASteamIntegrationTutCharacter::TouchStarted(ETouchIndex::Type FingerIndex, FVector Location) | ||
{ | ||
Jump(); | ||
} | ||
|
||
void ASteamIntegrationTutCharacter::TouchStopped(ETouchIndex::Type FingerIndex, FVector Location) | ||
{ | ||
StopJumping(); | ||
} | ||
|
||
void ASteamIntegrationTutCharacter::TurnAtRate(float Rate) | ||
{ | ||
// calculate delta for this frame from the rate information | ||
AddControllerYawInput(Rate * BaseTurnRate * GetWorld()->GetDeltaSeconds()); | ||
} | ||
|
||
void ASteamIntegrationTutCharacter::LookUpAtRate(float Rate) | ||
{ | ||
// calculate delta for this frame from the rate information | ||
AddControllerPitchInput(Rate * BaseLookUpRate * GetWorld()->GetDeltaSeconds()); | ||
} | ||
|
||
void ASteamIntegrationTutCharacter::MoveForward(float Value) | ||
{ | ||
if ((Controller != NULL) && (Value != 0.0f)) | ||
{ | ||
// find out which way is forward | ||
const FRotator Rotation = Controller->GetControlRotation(); | ||
const FRotator YawRotation(0, Rotation.Yaw, 0); | ||
|
||
// get forward vector | ||
const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X); | ||
AddMovementInput(Direction, Value); | ||
} | ||
} | ||
|
||
void ASteamIntegrationTutCharacter::MoveRight(float Value) | ||
{ | ||
if ( (Controller != NULL) && (Value != 0.0f) ) | ||
{ | ||
// find out which way is right | ||
const FRotator Rotation = Controller->GetControlRotation(); | ||
const FRotator YawRotation(0, Rotation.Yaw, 0); | ||
|
||
// get right vector | ||
const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y); | ||
// add movement in that direction | ||
AddMovementInput(Direction, Value); | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
...Integration/SteamIntegrationTut/Source/SteamIntegrationTut/SteamIntegrationTutCharacter.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
#pragma once | ||
#include "GameFramework/Character.h" | ||
#include "SteamIntegrationTutCharacter.generated.h" | ||
|
||
UCLASS(config=Game) | ||
class ASteamIntegrationTutCharacter : public ACharacter | ||
{ | ||
GENERATED_BODY() | ||
|
||
/** Camera boom positioning the camera behind the character */ | ||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true")) | ||
class USpringArmComponent* CameraBoom; | ||
|
||
/** Follow camera */ | ||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = "true")) | ||
class UCameraComponent* FollowCamera; | ||
public: | ||
ASteamIntegrationTutCharacter(); | ||
|
||
/** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */ | ||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera) | ||
float BaseTurnRate; | ||
|
||
/** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */ | ||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera) | ||
float BaseLookUpRate; | ||
|
||
protected: | ||
|
||
/** Resets HMD orientation in VR. */ | ||
void OnResetVR(); | ||
|
||
/** Called for forwards/backward input */ | ||
void MoveForward(float Value); | ||
|
||
/** Called for side to side input */ | ||
void MoveRight(float Value); | ||
|
||
/** | ||
* Called via input to turn at a given rate. | ||
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate | ||
*/ | ||
void TurnAtRate(float Rate); | ||
|
||
/** | ||
* Called via input to turn look up/down at a given rate. | ||
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate | ||
*/ | ||
void LookUpAtRate(float Rate); | ||
|
||
/** Handler for when a touch input begins. */ | ||
void TouchStarted(ETouchIndex::Type FingerIndex, FVector Location); | ||
|
||
/** Handler for when a touch input stops. */ | ||
void TouchStopped(ETouchIndex::Type FingerIndex, FVector Location); | ||
|
||
protected: | ||
// APawn interface | ||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; | ||
// End of APawn interface | ||
|
||
public: | ||
/** Returns CameraBoom subobject **/ | ||
FORCEINLINE class USpringArmComponent* GetCameraBoom() const { return CameraBoom; } | ||
/** Returns FollowCamera subobject **/ | ||
FORCEINLINE class UCameraComponent* GetFollowCamera() const { return FollowCamera; } | ||
}; | ||
|
15 changes: 15 additions & 0 deletions
15
...ntegration/SteamIntegrationTut/Source/SteamIntegrationTut/SteamIntegrationTutGameMode.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
|
||
#include "SteamIntegrationTut.h" | ||
#include "SteamIntegrationTutGameMode.h" | ||
#include "SteamIntegrationTutCharacter.h" | ||
|
||
ASteamIntegrationTutGameMode::ASteamIntegrationTutGameMode() | ||
{ | ||
// set default pawn class to our Blueprinted character | ||
static ConstructorHelpers::FClassFinder<APawn> PlayerPawnBPClass(TEXT("/Game/ThirdPersonCPP/Blueprints/ThirdPersonCharacter")); | ||
if (PlayerPawnBPClass.Class != NULL) | ||
{ | ||
DefaultPawnClass = PlayerPawnBPClass.Class; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...mIntegration/SteamIntegrationTut/Source/SteamIntegrationTut/SteamIntegrationTutGameMode.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. | ||
#pragma once | ||
#include "GameFramework/GameModeBase.h" | ||
#include "SteamIntegrationTutGameMode.generated.h" | ||
|
||
UCLASS(minimalapi) | ||
class ASteamIntegrationTutGameMode : public AGameModeBase | ||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
ASteamIntegrationTutGameMode(); | ||
}; | ||
|
||
|
||
|
8 changes: 8 additions & 0 deletions
8
SteamIntegration/SteamIntegrationTut/Source/SteamIntegrationTut/WinTrigger.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
#include "SteamIntegrationTut.h" | ||
#include "WinTrigger.h" | ||
|
||
|
||
|
||
|
Oops, something went wrong.