Add spiral stair in Controller Gym
This commit is contained in:
parent
49352f9c22
commit
a55b8556ea
BIN
Pawn_Unreal/Content/Characters/BP_Judy.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Characters/BP_Judy.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/Developers/maxim/Spiral_Stair_Brush_StaticMesh.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/Developers/maxim/Spiral_Stair_Brush_StaticMesh.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/Maps/Dev/MAP_ControllerGym.umap
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/Maps/Dev/MAP_ControllerGym.umap
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/0/91/BERD0JFDCI5RAYAPS4DY1P.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/0/91/BERD0JFDCI5RAYAPS4DY1P.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/0/GT/B3FVEW201B4H0JZT407R3G.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/0/GT/B3FVEW201B4H0JZT407R3G.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/0/XC/EES9G2P00B5EO5FPWE8N4U.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/0/XC/EES9G2P00B5EO5FPWE8N4U.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/1/LE/RIS6ZA9R1KK7MS3EGVDKZV.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/1/LE/RIS6ZA9R1KK7MS3EGVDKZV.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/1/TO/L6IIV6YT2Z6G1UGUHWHWPR.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/1/TO/L6IIV6YT2Z6G1UGUHWHWPR.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/1/XM/TP8DFTZ6ODOTSDOLG6WEXZ.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/1/XM/TP8DFTZ6ODOTSDOLG6WEXZ.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/7A/SCU1D1LU7J4NS7X4MENA7G.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/7A/SCU1D1LU7J4NS7X4MENA7G.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/ZC/SPZ5ZSIG7BW3194FWIBEWC.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/ZC/SPZ5ZSIG7BW3194FWIBEWC.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/ZX/V7QFRP3DMWRT8NZCJQYVRB.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/3/ZX/V7QFRP3DMWRT8NZCJQYVRB.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/4/OH/3YZOO5HQPTMDBNJPPM4RV0.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/4/OH/3YZOO5HQPTMDBNJPPM4RV0.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/5/7S/W5AOPA3TGYQNLQDCWK6C75.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/5/7S/W5AOPA3TGYQNLQDCWK6C75.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/5/V3/7TDZ89SOYDGI26YWXQ04D4.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/5/V3/7TDZ89SOYDGI26YWXQ04D4.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/5/Y4/YBN91OHWXDZU3ZMLN026WF.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/5/Y4/YBN91OHWXDZU3ZMLN026WF.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/9/IH/5T09JNLLSNG3U1KPWNFK3T.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/9/IH/5T09JNLLSNG3U1KPWNFK3T.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/9/RQ/JYNZEWOG6SXNE3HGUCSZIE.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/9/RQ/JYNZEWOG6SXNE3HGUCSZIE.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/1J/FGN60CK2BMBEJRXHZ72TKV.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/1J/FGN60CK2BMBEJRXHZ72TKV.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/BZ/XZUBN8NU0UZ2W8T2MBWCYN.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/BZ/XZUBN8NU0UZ2W8T2MBWCYN.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/MX/Q9G3HXBB9AGAYTMOU1AVGY.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/MX/Q9G3HXBB9AGAYTMOU1AVGY.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/U2/4ECO0ADAHJEURYSR8OYVEX.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/A/U2/4ECO0ADAHJEURYSR8OYVEX.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/B/0Z/X5N2DTGOJMHQWHOBBKFNDX.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/B/0Z/X5N2DTGOJMHQWHOBBKFNDX.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/D/VD/LJAQY01SJR93NPW0FPCPIL.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/D/VD/LJAQY01SJR93NPW0FPCPIL.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/E/86/NKWQISSIQGRX07O716DOXO.uasset
(Stored with Git LFS)
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/E/86/NKWQISSIQGRX07O716DOXO.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/E/9K/R7HQI0E9NM3G94LW522VPS.uasset
(Stored with Git LFS)
Normal file
BIN
Pawn_Unreal/Content/__ExternalActors__/Maps/Dev/MAP_ControllerGym/E/9K/R7HQI0E9NM3G94LW522VPS.uasset
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -5,7 +5,7 @@
|
|||||||
#include "Components/SplineComponent.h"
|
#include "Components/SplineComponent.h"
|
||||||
#include "GameplayModes/PwnGameplayModeSubsystem.h"
|
#include "GameplayModes/PwnGameplayModeSubsystem.h"
|
||||||
#include "GameplayModes/Combat/PwnCombatPlatformerPath.h"
|
#include "GameplayModes/Combat/PwnCombatPlatformerPath.h"
|
||||||
#include "Utils/EngineUtils.h"
|
#include "Kismet/KismetSystemLibrary.h"
|
||||||
|
|
||||||
constexpr float LineTraceDistance = 10000.0f;
|
constexpr float LineTraceDistance = 10000.0f;
|
||||||
|
|
||||||
@ -101,7 +101,8 @@ bool UPwnCharacterMovementComponent::IsCustomMovementMode(const ECustomMovementM
|
|||||||
|
|
||||||
bool UPwnCharacterMovementComponent::LineTraceToGround(FHitResult& OutHit, const FVector& StartLocation) const {
|
bool UPwnCharacterMovementComponent::LineTraceToGround(FHitResult& OutHit, const FVector& StartLocation) const {
|
||||||
const FVector EndLocation = StartLocation + FVector(0.0f, 0.0f, -LineTraceDistance);
|
const FVector EndLocation = StartLocation + FVector(0.0f, 0.0f, -LineTraceDistance);
|
||||||
return GetWorld()->LineTraceSingleByChannel(OutHit, StartLocation, EndLocation, ECC_Visibility, IGNORE_OWNER_PARAMS);
|
return UKismetSystemLibrary::LineTraceSingle(this, StartLocation, EndLocation, UEngineTypes::ConvertToTraceType(ECC_Visibility), false, TArray<AActor*>(),
|
||||||
|
EDrawDebugTrace::None, OutHit, true, FLinearColor::Red, FLinearColor::Green, 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UPwnCharacterMovementComponent::UpdateCurrentCombatPath(const bool UpdateLocation) {
|
void UPwnCharacterMovementComponent::UpdateCurrentCombatPath(const bool UpdateLocation) {
|
||||||
@ -130,7 +131,9 @@ void UPwnCharacterMovementComponent::UpdateCurrentCombatPath(const bool UpdateLo
|
|||||||
}
|
}
|
||||||
|
|
||||||
void UPwnCharacterMovementComponent::UpdateTangentAndAcceleration() {
|
void UPwnCharacterMovementComponent::UpdateTangentAndAcceleration() {
|
||||||
Tangent2D = CombatPath->FlattenedSpline->GetTangentAtDistanceAlongSpline(DistanceAlongSpline, ESplineCoordinateSpace::World).GetSafeNormal2D();
|
// Clamp distance because tangents are not defined at the ends of the spline
|
||||||
|
const float ClampedDistanceAlongSpline = FMath::Clamp(DistanceAlongSpline, 0.0001f, CombatPath->FlattenedSpline->GetSplineLength() - 0.0001f);
|
||||||
|
Tangent2D = CombatPath->FlattenedSpline->GetTangentAtDistanceAlongSpline(ClampedDistanceAlongSpline, ESplineCoordinateSpace::World).GetSafeNormal2D();
|
||||||
// Recalculate acceleration so the input is relative to the spline
|
// Recalculate acceleration so the input is relative to the spline
|
||||||
Acceleration = Tangent2D * Acceleration.Size2D() * FMath::Sign(Acceleration.X) * DotDirection;
|
Acceleration = Tangent2D * Acceleration.Size2D() * FMath::Sign(Acceleration.X) * DotDirection;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,6 @@ void UPwnGameplayModeSubsystem::UnregisterCombatPath(APwnCombatPlatformerPath* C
|
|||||||
bool UPwnGameplayModeSubsystem::FindClosestCombatPathLocation(const FVector& Location, APwnCombatPlatformerPath*& OutCombatPath) const {
|
bool UPwnGameplayModeSubsystem::FindClosestCombatPathLocation(const FVector& Location, APwnCombatPlatformerPath*& OutCombatPath) const {
|
||||||
float ShortestDistance = FLT_MAX;
|
float ShortestDistance = FLT_MAX;
|
||||||
APwnCombatPlatformerPath* ClosestCombatPath = nullptr;
|
APwnCombatPlatformerPath* ClosestCombatPath = nullptr;
|
||||||
bool Found = false;
|
|
||||||
|
|
||||||
for (APwnCombatPlatformerPath* CombatPath : CombatPaths) {
|
for (APwnCombatPlatformerPath* CombatPath : CombatPaths) {
|
||||||
const USplineComponent* CurrentSpline = CombatPath->Spline;
|
const USplineComponent* CurrentSpline = CombatPath->Spline;
|
||||||
@ -62,12 +61,12 @@ bool UPwnGameplayModeSubsystem::FindClosestCombatPathLocation(const FVector& Loc
|
|||||||
if (CurrentDistance < ShortestDistance) {
|
if (CurrentDistance < ShortestDistance) {
|
||||||
ShortestDistance = CurrentDistance;
|
ShortestDistance = CurrentDistance;
|
||||||
ClosestCombatPath = CombatPath;
|
ClosestCombatPath = CombatPath;
|
||||||
Found = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Found) {
|
if (ClosestCombatPath != nullptr) {
|
||||||
OutCombatPath = ClosestCombatPath;
|
OutCombatPath = ClosestCombatPath;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return Found;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user