Section 12: Footsteps - Lecture 243

Jumping and Landing sounds
This commit is contained in:
charnet3d 2024-02-04 11:24:45 +01:00
parent a82939c7c9
commit 183e1034c8
26 changed files with 76 additions and 24 deletions

Binary file not shown.

Binary file not shown.

BIN
Content/_Game/AnimNotifies/JumpLandNotify.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Footstep_Grass.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Footstep_Metal.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Footstep_Stone.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Footstep_Tile.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Footstep_Water.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Land_Grass.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Land_Metal.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Land_Stone.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Land_Tile.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Footsteps/Land_Water.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/_Game/Assets/Sounds/Rifle/Jump_Start.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/_Game/Maps/DefaultMap.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -8,7 +8,7 @@ public class Shooter : ModuleRules
{ {
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG" }); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "UMG", "PhysicsCore" });
PrivateDependencyModuleNames.AddRange(new string[] { }); PrivateDependencyModuleNames.AddRange(new string[] { });

View File

@ -17,6 +17,8 @@
#include "Particles/ParticleSystemComponent.h" #include "Particles/ParticleSystemComponent.h"
#include "Sound/SoundCue.h" #include "Sound/SoundCue.h"
#include "Ammo.h" #include "Ammo.h"
#include "PhysicalMaterials/PhysicalMaterial.h"
#include "Shooter.h"
// Sets default values // Sets default values
AShooterCharacter::AShooterCharacter() : AShooterCharacter::AShooterCharacter() :
@ -469,6 +471,20 @@ void AShooterCharacter::HighlightInventorySlot()
} }
} }
EPhysicalSurface AShooterCharacter::GetSurfaceType()
{
FHitResult HitResult;
const FVector Start{ GetActorLocation() };
const FVector End{ Start + FVector(0.f, 0.f, -400.f) };
FCollisionQueryParams QueryParams;
QueryParams.bReturnPhysicalMaterial = true;
GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECollisionChannel::ECC_Visibility, QueryParams);
return UPhysicalMaterial::DetermineSurfaceType(HitResult.PhysMaterial.Get());
}
void AShooterCharacter::UnhighlightInventorySlot() void AShooterCharacter::UnhighlightInventorySlot()
{ {
if (HighlightedSlot != -1) if (HighlightedSlot != -1)

View File

@ -216,6 +216,9 @@ protected:
void HighlightInventorySlot(); void HighlightInventorySlot();
UFUNCTION(BlueprintCallable)
EPhysicalSurface GetSurfaceType();
private: private:
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = true)) UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera, meta = (AllowPrivateAccess = true))
USpringArmComponent* CameraBoom; USpringArmComponent* CameraBoom;