Adventure Kit  4.16
Public Member Functions | Public Attributes | Protected Attributes | List of all members
UAdvKitGravityCharacterMovementComponent Class Reference

Movement component that handles gravity set by the character's orientation component. More...

#include <AdvKitGravityCharacterMovementComponent.h>

Inheritance diagram for UAdvKitGravityCharacterMovementComponent:
UAdvKitCharacterMovementComponent

Public Member Functions

 UAdvKitGravityCharacterMovementComponent (const FObjectInitializer &ObjectInitializer)
 
class UAdvKitOrientationComponentGetOrientationComp () const
 
virtual void SetGravityVector (const FVector &GravityDirection, const FVector &GravityOrigin=FVector::ZeroVector, bool bForce=false)
 
virtual bool CanWallWalkOn (FFindFloorResult NewFloor)
 
virtual void UpdateWorldOrientation (float DeltaSeconds)
 
virtual void OnOrientationChanged (const FTransform &OldOrientation)
 
void TransformMovementVariablesWorldToLocal ()
 
void TransformMovementVariablesLocalToWorld ()
 
virtual void BeginPlay () override
 
virtual void TickComponent (float DeltaSeconds, enum ELevelTick TickType, FActorComponentTickFunction *ThisTickFunction) override
 
virtual FVector ConstrainDirectionToPlane (FVector Direction) const override
 
virtual void SetUpdatedComponent (USceneComponent *NewUpdatedComponent) override
 
virtual void SimulateMovement (float DeltaSeconds) override
 
virtual void AdjustFloorHeight () override
 
virtual bool DoJump (bool bReplayingMoves) override
 
virtual void StartSwimmingHACK (FVector OldLocation, FVector OldVelocity, float timeTick, float remainingTime, int32 Iterations)
 
virtual float ImmersionDepthGravity ()
 
virtual void PerformAirControlForPathFollowing (FVector Direction, float ZDiff) override
 
virtual void StartFalling (int32 Iterations, float remainingTime, float timeTick, const FVector &Delta, const FVector &subLoc) override
 
void RequestDirectMove (const FVector &MoveVelocity, bool bForceMaxSpeed) override
 
void SetFromSweepHACK (FFindFloorResult &Out, const FHitResult &InHit, const float InSweepFloorDist, const bool bIsWalkableFloor) const
 
void SetFromLineTraceHACK (FFindFloorResult &Out, const FHitResult &InHit, const float InSweepFloorDist, const float InLineDist, const bool bIsWalkableFloor) const
 
virtual bool IsWithinEdgeTolerance (const FVector &CapsuleLocation, const FVector &TestImpactPoint, const float CapsuleRadius) const override
 
virtual void ComputeFloorDist (const FVector &CapsuleLocation, float LineDistance, float SweepDistance, FFindFloorResult &OutFloorResult, float SweepRadius, const FHitResult *DownwardSweepResult=NULL) const override
 
virtual void TwoWallAdjust (FVector &Delta, const FHitResult &Hit, const FVector &OldHitNormal) const override
 
virtual FVector HandleSlopeBoosting (const FVector &SlideResult, const FVector &Delta, const float Time, const FVector &Normal, const FHitResult &Hit) const override
 
virtual bool IsValidLandingSpot (const FVector &CapsuleLocation, const FHitResult &Hit) const override
 
virtual bool ShouldCheckForValidLandingSpot (float DeltaTime, const FVector &Delta, const FHitResult &Hit) const override
 
virtual FVector LimitAirControl (float DeltaTime, const FVector &FallAcceleration, const FHitResult &HitResult, bool bCheckForValidLandingSpot) override
 
virtual void OnMovementModeChanged (EMovementMode PreviousMovementMode, uint8 PreviousCustomMode) override
 
virtual void MaintainHorizontalGroundVelocity () override
 
virtual void PhysWalking (float DeltaSeconds, int32 Iterations) override
 
virtual void PhysFlying (float DeltaSeconds, int32 Iterations) override
 
virtual void PhysFalling (float DeltaSeconds, int32 Iterations) override
 
virtual void PhysSwimming (float DeltaSeconds, int32 Iterations) override
 
virtual void PhysicsRotation (float DeltaSeconds) override
 
virtual float SlideAlongSurface (const FVector &Delta, float Time, const FVector &InNormal, FHitResult &Hit, bool bHandleImpact) override
 
virtual bool IsWalkable (const FHitResult &Hit) const override
 
virtual void MoveSmooth (const FVector &InVelocity, const float DeltaSeconds, FStepDownResult *OutStepDownResult) override
 
virtual void UpdateFloorFromAdjustment () override
 
virtual FVector ComputeGroundMovementDelta (const FVector &Delta, const FHitResult &RampHit, const bool bHitFromLineTrace) const override
 
virtual void MoveAlongFloor (const FVector &InVelocity, float DeltaSeconds, FStepDownResult *OutStepDownResult=nullptr) override
 
virtual FVector ConstrainInputAcceleration (const FVector &InputAcceleration) const override
 
- Public Member Functions inherited from UAdvKitCharacterMovementComponent
virtual class FNetworkPredictionData_Client * GetPredictionData_Client () const override
 
 UAdvKitCharacterMovementComponent (const FObjectInitializer &ObjectInitializer)
 
void SetMovementVariables (FVector NewVelocity, FVector NewAcceleration)
 
void ZeroMovementVariables ()
 
FORCEINLINE const FAdvKitMovementPropertiesGetAdvMovementProperties () const
 
FORCEINLINE FAdvKitMovementPropertiesGetAdvMovementProperties ()
 
virtual void SetAdvMovementMode (EAdvKitMovementMode NewMovementMode, uint8 NewCustomMode=0)
 
virtual bool IsClimbingWall () const
 
virtual bool IsClimbingCeiling () const
 
virtual bool IsClimbingLedge () const
 
virtual bool IsClimbingLadder () const
 
virtual bool IsWalkingTightspace () const
 
virtual bool IsWalkingBalance () const
 
virtual bool LetGoOfZone ()
 
virtual bool JumpUpZone ()
 
virtual bool TryToTransition (AAdvKitZone *ForZone, const FVector &ForWorldPosition, const FVector &InWorldDirection=FVector::ZeroVector, bool bIsJump=false)
 
virtual UAdvKitTransitionComponentGetPossibleTransition (AAdvKitZone *ForZone, const FVector &ForWorldPosition, const FVector &InWorldDirection=FVector::ZeroVector, bool bIsJump=false)
 
virtual bool CanTransition (AAdvKitZone *ForZone, const FVector &ForWorldPosition, const FVector &InWorldDirection=FVector::ZeroVector, bool bIsJump=false)
 
virtual EAdvKitMovementMode GetAdvMovementMode () const
 
uint8 GetAdvCustomMovementMode () const
 
virtual float GetMaxSpeed () const override
 
virtual void StartNewPhysics (float DeltaSeconds, int32 Iterations) override
 
virtual void OnMovementUpdated (float DeltaSeconds, const FVector &OldLocation, const FVector &OldVelocity) override
 
virtual void ChangeTargetBalance ()
 
virtual class AAdvKitZoneGetZone ()
 
virtual FVector GetZoneLocation ()
 
virtual bool MoveLocationInZone (FVector GlobalAcceleration, float DeltaSeconds, const FVector &HalfExtent, bool bAutoTransition=true, bool ConstrainAcceleration=true)
 
virtual bool PhysMoveInZone (FVector GlobalAcceleration, FVector WorldOffset, float DeltaSeconds, const FVector &HalfExtent, bool bAutoTransition=true, bool ConstrainAcceleration=true)
 
virtual void PhysZoneMoving (float DeltaSeconds, int32 Iterations)
 
virtual FRotator GetDesiredRotationInZone (AAdvKitZone *Zone, FVector AtLocation)
 
virtual FRotator GetDesiredRotationInZoneNew (AAdvKitZone *Zone, const FVector &AtZoneLocation)
 
virtual FVector GetDesiredOffsetFromZone (AAdvKitZone *Zone, FVector AtLocation)
 
FVector GetDesiredOffsetFromZoneNew (AAdvKitZone *Zone, const FVector &AtZoneLocation)
 
virtual FVector GetHalfExtentForZone (AAdvKitZone *Zone)
 
 UFUNCTION (BlueprintCallable, Category="AdvKit", meta=(DeprecatedFunction, DeprecationMessage="This function is deprecated, please use GetZone()->GetZoneLocationWorld instead.")) virtual FVector GetGlobalLocationInZone()
 
void AccumulateRootMotion (FVector MovementDelta, FRotator NewRotation)
 
void AccumulateRootMotionRotation (FRotator NewRotation)
 
void AddRootMotionMovement (FVector GlobalDelta)
 
void AddRootMotionRotation (FRotator AdditionalRotation)
 

Public Attributes

bool bUpdateWorldOrientationByTracing
 
bool bUpdateWorldOrientationByFloorResult
 
bool bResetOrientationWhenFalling
 
- Public Attributes inherited from UAdvKitCharacterMovementComponent
FVector LastNonZeroAcceleration
 
FVector LocalZoneLocation
 
FAdvKitMovementProperties AdvMovementProps
 
float JumpDistanceLedgeLadderHorizontal
 
float LedgePrecognitionDistance_DEPRECATED
 
float LedgeDownTraceDistance_DEPRECATED
 
float LedgeSmallHeightOffset_DEPRECATED
 
float LedgeJumpDistanceVertical
 
float LedgeJumpDistanceHorizontal
 
float LedgeJumpDistanceBack
 
float MaxLedgeClimbSpeed
 
FVector LedgeOffset
 
float LadderJumpDistanceHorizontal
 
float LadderJumpDistanceBack
 
float MaxLadderClimbSpeed
 
FVector LadderOffset
 
FVector WallOffset
 
float MaxWallClimbSpeed
 
float MaxCeilingClimbSpeed
 
FVector CeilingOffset
 
float CeilingMinTransitionDot
 
FVector TightSpaceOffset
 
float MaxTightSpaceWalkSpeed
 
float MaxBalanceWalkSpeed
 
FVector BalanceOffset
 
float BalanceRotationRate
 
float CurrentBalance
 
float CounterBalanceMultiplier
 
float MinCounterBalanceDot
 
float MaxBalanceTurnAroundDot
 
float BalanceChangePerSecond
 
float MinBalanceChangePerSecond
 
float MaxBalanceChangePerSecond
 
float MaxBalance
 
float BalanceChangeTime
 
FTimerHandle ChangeBalanceTimerHandle
 
float SwimmingImmersionDepthFlat
 
float SwimmingImmersionDepthUpright
 
float SwimmingSurfaceMultiplier
 
float DivingToSwimmingImmersionDepth
 
float MaxUprightSwimSpeed
 

Protected Attributes

AAdvKitGravityCharacterAdvKitGravityCharacterOwner
 
bool bMovementVariablesAreLocal
 
- Protected Attributes inherited from UAdvKitCharacterMovementComponent
class AAdvKitCharacterAdvKitCharacterOwner
 

Additional Inherited Members

- Protected Member Functions inherited from UAdvKitCharacterMovementComponent
virtual void PhysActionDriven (float DeltaSeconds, int32 Iterations)
 

Detailed Description

Movement component that handles gravity set by the character's orientation component.

Constructor & Destructor Documentation

UAdvKitGravityCharacterMovementComponent::UAdvKitGravityCharacterMovementComponent ( const FObjectInitializer &  ObjectInitializer)

Constructor

Member Function Documentation

bool UAdvKitGravityCharacterMovementComponent::CanWallWalkOn ( FFindFloorResult  NewFloor)
virtual

Checks if a hit result is a valid floor for wall walking

Parameters
NewFloorThe floor to test
Returns
True if it is valid for wall walking
class UAdvKitOrientationComponent * UAdvKitGravityCharacterMovementComponent::GetOrientationComp ( ) const

Get the owning character's orientation component

Returns
Orientation component that handles gravity
void UAdvKitGravityCharacterMovementComponent::PhysicsRotation ( float  DeltaSeconds)
overridevirtual

TODO //Changed YAW if (DesiredRotation.Yaw != CurrentRotation.Yaw) { NewRotation.Yaw = FMath::FixedTurn(CurrentRotation.Yaw, DesiredRotation.Yaw, DeltaRot.Yaw); }

PITCH if (DesiredRotation.Pitch != CurrentRotation.Pitch) { NewRotation.Pitch = FMath::FixedTurn(CurrentRotation.Pitch, DesiredRotation.Pitch, DeltaRot.Pitch); }

ROLL if (DesiredRotation.Roll != CurrentRotation.Roll) { NewRotation.Roll = FMath::FixedTurn(CurrentRotation.Roll, DesiredRotation.Roll, DeltaRot.Roll); }

Reimplemented from UAdvKitCharacterMovementComponent.

void UAdvKitGravityCharacterMovementComponent::SetGravityVector ( const FVector &  GravityDirection,
const FVector &  GravityOrigin = FVector::ZeroVector,
bool  bForce = false 
)
virtual

Checks if a hit result is a valid floor for wall walking

Parameters
GravityDirectionNew direction of gravity
GravityOriginNew origin of gravity
bForceSet new gravity immediately, false to interpolate slowly
void UAdvKitGravityCharacterMovementComponent::TransformMovementVariablesLocalToWorld ( )

Utility that transforms all movement variables (Acceleration, Velocity) from local gravity space to world space for easier calculation

void UAdvKitGravityCharacterMovementComponent::TransformMovementVariablesWorldToLocal ( )

Utility that transforms all movement variables (Acceleration, Velocity) to local gravity space for easier calculation

void UAdvKitGravityCharacterMovementComponent::UpdateWorldOrientation ( float  DeltaSeconds)
virtual

Updates orientation component based on configuration.

Member Data Documentation

AAdvKitGravityCharacter* UAdvKitGravityCharacterMovementComponent::AdvKitGravityCharacterOwner
protected

Reference to the owning gravity character

bool UAdvKitGravityCharacterMovementComponent::bMovementVariablesAreLocal
protected

Flag if movement variables are currently transformed to local space

bool UAdvKitGravityCharacterMovementComponent::bResetOrientationWhenFalling

Reset gravity orientation when the character is falling (useful for things like magnetic boots)

bool UAdvKitGravityCharacterMovementComponent::bUpdateWorldOrientationByFloorResult

Update the gravity orientation with the floor the character is walking on

bool UAdvKitGravityCharacterMovementComponent::bUpdateWorldOrientationByTracing

Update the gravity orientation with the floor that is hit by the character's tracing component


The documentation for this class was generated from the following files: