This commit is contained in:
Lu 2025-04-16 23:44:08 +02:00
commit 85fc3ab03f
17 changed files with 76 additions and 19 deletions

View File

@ -211,3 +211,33 @@ Platforms=((Windows, (SpeakerMode=Stereo)))
[/Script/NavigationSystem.RecastNavMesh]
bForceRebuildOnLoad=True
[/Script/Engine.PhysicsSettings]
PhysicsPrediction=(bEnablePhysicsPrediction=False,bEnablePhysicsHistoryCapture=False,MaxSupportedLatencyPrediction=1000.000000,ResimulationSettings=(bEnableResimulationErrorPositionThreshold=True,ResimulationErrorPositionThreshold=10.000000,bEnableResimulationErrorRotationThreshold=True,ResimulationErrorRotationThreshold=4.000000,bEnableResimulationErrorLinearVelocityThreshold=False,ResimulationErrorLinearVelocityThreshold=5.000000,bEnableResimulationErrorAngularVelocityThreshold=False,ResimulationErrorAngularVelocityThreshold=2.000000))
PhysicErrorCorrection=(PingExtrapolation=0.100000,PingLimit=100.000000,ErrorPerLinearDifference=1.000000,ErrorPerAngularDifference=1.000000,MaxRestoredStateError=1.000000,MaxLinearHardSnapDistance=400.000000,PositionLerp=0.000000,AngleLerp=0.400000,LinearVelocityCoefficient=100.000000,AngularVelocityCoefficient=10.000000,ErrorAccumulationSeconds=0.500000,ErrorAccumulationDistanceSq=15.000000,ErrorAccumulationSimilarity=100.000000)
DefaultDegreesOfFreedom=Full3D
bSuppressFaceRemapTable=False
bSupportUVFromHitResults=False
bDisableActiveActors=False
bDisableKinematicStaticPairs=False
bDisableKinematicKinematicPairs=False
bDisableCCD=False
AnimPhysicsMinDeltaTime=0.000000
bSimulateAnimPhysicsAfterReset=False
MinPhysicsDeltaTime=0.000000
MaxPhysicsDeltaTime=0.033333
bSubstepping=False
bSubsteppingAsync=False
bTickPhysicsAsync=False
AsyncFixedTimeStepSize=0.033333
MaxSubstepDeltaTime=0.016667
MaxSubsteps=6
SyncSceneSmoothingFactor=0.000000
InitialAverageFrameRate=0.016667
PhysXTreeRebuildRate=10
+PhysicalSurfaces=(Type=SurfaceType1,Name="Concrete")
+PhysicalSurfaces=(Type=SurfaceType2,Name="Metal")
+PhysicalSurfaces=(Type=SurfaceType3,Name="Dirt")
DefaultBroadphaseSettings=(bUseMBPOnClient=False,bUseMBPOnServer=False,bUseMBPOuterBounds=False,MBPBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=False),MBPOuterBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=False),MBPNumSubdivs=2)
MinDeltaVelocityForHitEvents=0.000000
ChaosSettings=(DefaultThreadingModel=TaskGraph,DedicatedThreadTickMode=VariableCappedWithTarget,DedicatedThreadBufferMode=Double)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Content/Legumix/Environment/PM_Concrete.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Legumix/Environment/PM_Dirt.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Legumix/Environment/PM_Metal.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Legumix/Levels/LVL_00.umap (Stored with Git LFS)

Binary file not shown.

BIN
Content/Legumix/Player/BP_Play.uasset (Stored with Git LFS)

Binary file not shown.

View File

@ -157,6 +157,7 @@ void ULMMovementComponent::EnterSlide()
bWantsToCrouch = true;
Velocity += Velocity.GetSafeNormal2D() * SlideEnterImpulse;
SetMovementMode(EMovementMode::MOVE_Custom, ECustomMovementModes::ECMM_Sliding);
OnSlideStarted.Broadcast();
}
void ULMMovementComponent::ExitSlide()
@ -167,6 +168,7 @@ void ULMMovementComponent::ExitSlide()
FHitResult Hit;
SafeMoveUpdatedComponent(FVector::ZeroVector, NewRotation, true, Hit);
SetMovementMode(EMovementMode::MOVE_Walking);
OnSlideEnded.Broadcast();
}
void ULMMovementComponent::PhysSlide(float DeltaTime, int32 Iterations)

View File

@ -171,7 +171,9 @@ void ALMPlayer::FireBullets(const FLMBulletInfo Settings)
ShotVector = UKismetMathLibrary::RandomUnitVectorInConeInDegreesFromStream(SpreadStream, Settings.Direction, Settings.Spread);
EndLocation = Settings.Origin + (ShotVector * Settings.MaxDistance);
const bool HasHit = GetWorld()->LineTraceSingleByChannel(OutHit, Settings.Origin, EndLocation, TRACE_BULLET);
FCollisionQueryParams Params;
Params.bReturnPhysicalMaterial = true;
const bool HasHit = GetWorld()->LineTraceSingleByChannel(OutHit, Settings.Origin, EndLocation, TRACE_BULLET, Params);
#if WITH_EDITOR
if (bDrawBulletDebug)
@ -308,6 +310,7 @@ void ALMPlayer::DoLedgeGrabCheck()
FVector TeleportLocation = FVector(Hit.Location.X, Hit.Location.Y, Hit.Location.Z + GetCapsuleComponent()->GetScaledCapsuleHalfHeight());
SetActorLocation(TeleportLocation, false, nullptr, ETeleportType::ResetPhysics);
OnLedgeGrab();
}
}

View File

@ -10,6 +10,11 @@
class ALMPlayer;
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnSlideStartedSignature);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnSlideEndedSignature);
// See https://www.youtube.com/playlist?list=PLXJlkahwiwPmeABEhjwIALvxRSZkzoQpk
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class LEGUMEMIX_API ULMMovementComponent : public UCharacterMovementComponent
@ -71,6 +76,11 @@ public:
UFUNCTION(BlueprintCallable, Category="Legumix|Slide")
void CrouchToggle(bool Toggle);
UPROPERTY(BlueprintAssignable, Category=Legumix)
FOnSlideStartedSignature OnSlideStarted;
UPROPERTY(BlueprintAssignable, Category=Legumix)
FOnSlideEndedSignature OnSlideEnded;
public:
UPROPERTY(Transient)
TObjectPtr<ALMPlayer> PlayerCharacterOwner;

View File

@ -111,6 +111,9 @@ public:
UFUNCTION()
void MovementChanged(ACharacter* Character, EMovementMode PrevMovementMode, uint8 PreviousCustomMode);
UFUNCTION(BlueprintImplementableEvent, Category=Legumix)
void OnLedgeGrab();
UFUNCTION(BlueprintCallable)
void DoLedgeGrabCheck();