FCharacterMotionSimulation

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

NetworkPredictionExtras

Header

/Engine/Plugins/Runtime/NetworkPredictionExtras/Source/NetworkPredictionExtras/Public/CharacterMotionSimulation.h

Include

#include "CharacterMotionSimulation.h"

Syntax

class FCharacterMotionSimulation : public FBaseMovementSimulation

Variables

Name Description

Protected variable

FFloorTestResul...

 

CachedFloor

Functions

Name Description

Protected function Virtual Const

void

 

ComputeFloorDist

(
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& Location,
    FFloorTestResult& OutFloorResult,
    float SweepDistance
)

Protected function Virtual Const

FVector

 

ComputeGravity

(
    float DeltaSeconds,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& Delta
)

Protected function Virtual Const

FVector

 

ComputeLocalInput

(
    const FNetSimTimeStep& TimeStep,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...
)

Protected function Virtual Const

FRotator

 

ComputeLocalRotation

(
    const FNetSimTimeStep& TimeStep,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...
)

Protected function Virtual Const

FVector

 

ComputeSlideVector

(
    const FVector& Delta,
    const float Time,
    const FVector& Normal,
    const FHitResult& Hit
)

Protected function Virtual Const

FVector

 

ComputeVelocity

(
    float DeltaSeconds,
    const FVector& InitialVelocity,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& LocalSpaceMovementI...
)

Computes a velocity based on InputVelocity and current state.

Protected function Virtual Const

void

 

FindFloor

(
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& Location,
    FFloorTestResult& OutFloorResult
)

Protected function Virtual Const

bool

 

FloorSweepTest

(
    FHitResult& OutHit,
    const FVector& Start,
    const FVector& End,
    ECollisionChannel TraceChannel,
    const FCollisionShape& CollisionSh...,
    const FCollisionQueryParams& Param...,
    const FCollisionResponseParams& Re...
)

Protected function Virtual

void

 

InvalidateCache()

Called at start of simulation to avoid using old cached values.

Protected function Virtual Const

bool

 

IsExceedingMaxSpeed

(
    const FVector& Velocity,
    float InMaxSpeed
)

Protected function Virtual Const

bool

 

IsValidLandingSpot

(
    const FVector& Location,
    const FHitResult& Hit,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& Delta
)

Protected function Virtual Const

bool

 

IsWalkable

(
    const FHitResult& Hit,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...
)

Protected function Virtual

void

 

Movement_Falling

(
    float DeltaSeconds,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& LocalSpaceMovementI...
)

Protected function Virtual

void

 

Movement_Walking

(
    float DeltaSeconds,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& LocalSpaceMovementI...
)

Public function

void

 

OnBeginOverlap

(
    UPrimitiveComponent* Overlappe...,
    AActor* Other,
    UPrimitiveComponent* OtherComp,
    int32 OtherBodyIndex,
    bool bFromSweep,
    const FHitResult& SweepResult
)

Callbacks.

Protected function Virtual

void

 

PerformMovement

(
    float DeltaSeconds,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...,
    const FVector& LocalSpaceMovementI...
)

Protected function Virtual

void

 

SetMovementMode

(
    ECharacterMovementMode MovementMode,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...
)

Public function

void

 

SimulationTick

(
    const FNetSimTimeStep& TimeStep,
    const TNetSimInput< CharacterMotion...,
    const TNetSimOutput< CharacterMotio...
)

Main update function

Protected function Virtual

float

 

SlideAlongSurface

(
    const FVector& Delta,
    float Time,
    const FQuat Rotation,
    const FVector& Normal,
    FHitResult& Hit,
    bool bHandleImpact
)

Protected function Virtual Const

void

 

TwoWallAdjust

(
    FVector& OutDelta,
    const FHitResult& Hit,
    const FVector& OldHitNormal
)

Constants

Name

Description

ForceMispredict

Dev tool to force simple mispredict

ROTATOR_TOLERANCE

General tolerance value for rotation checks