Skip to content
CRUSHFORMV1.1.0
GET IT ON FAB

REFERENCECOMPONENTS

UCFPropContactComponent

MODULECrushformINCLUDECFPropContactComponent.hPARENTUActorComponent

Lets the owner's body break the breakable units it drives through, on the machine that simulates it. Each frame it does one box overlap against the units' object type (CFBreakable::GetUnitObjectType), breaks the unit locally with no physical contact (the units ignore the body), applies a configured velocity change, then reports the break to the server, which validates and replicates it. The body is the owner's root primitive. The owner, or a host registered for it in UCFHostRegistry (the vehicle adapter registers itself), may implement ICFBreakerHost to name another body, to say where it is simulated, to route its reports through another actor's component and to have the body dented. Without a host the authority simulates the body, the reports go through this component and the body is never dented. It also arms the breakable trees around the body each tick on every machine, so a tree is never a kinematic wall for a vehicle that another machine simulates.

Functions

AUTHORITY · server, every machineLOCAL · this machinePURE · read only
bool IsReportPlausible(const FVector& ServerBodyLocation, float BodyRadiusCm, const FVector& UnitCenter, float UnitRadiusCm, float BodySpeedCmS)
C++ ONLY

Whether a client's break report is believable from where the server sees the body. Lengths in cm, BodySpeedCmS in cm/s.

FCFBreakImpact SanitizeReportedImpact(const FCFBreakImpact& Reported, const FBox& UnitBounds)
C++ ONLY

A client's reported impact made safe to publish to every client: placed on the unit's own bounds, speed capped at what a body may claim.

void SetCrushformHost(UObject* NewHost)
C++ ONLY

Who answers ICFBreakerHost for the owner; null = the registry's host for the owner, else the owner. Call before BeginPlay: a later call is refused. The host is bound at the component's first question, which may come before BeginPlay.

UObject* GetCrushformHost() const
PUREC++ ONLY

The explicit host, else UCFHostRegistry::FindHost(Owner, UCFBreakerHost), else null.

bool IsSimulatedHere() const
PUREC++ ONLY

Whether this machine moves the owner's body: ICFBreakerHost::IsBreakerSimulatedHere, else the authority.

bool IsReportingActorOurs(const AActor* ReportingActor) const
PUREC++ ONLY

Whether a report made in ReportingActor's name is this component's to take: the owner itself, or an actor whose host routes its reports through us.

void ReportBreakToServer(AActor* ReportingActor, UCFBreakableInstancesComponent* Instances, int32 UnitIndex, const FCFBreakImpact& Impact)
C++ ONLY

Sends a break simulated on this machine to the server through this component's connection-owned actor.

Properties

float MinContactSpeedCmS = 50.f
Default
50.f
Category
Contact
float TreeArmMinSpeedCmS = 5.f
Default
5.f
Category
Contact|Trees