Module |
|
Header |
/Engine/Source/Runtime/Engine/Classes/Engine/HitResult.h |
Include |
#include "Engine/HitResult.h" |
struct FHitResult
Structure containing information about one hit of a trace, such as point of impact and surface normal at that point.
Name | Description | ||
---|---|---|---|
|
uint8: 1 |
bBlockingHit |
Indicates if this hit was a result of blocking collision. |
|
BoneName |
Name of bone we hit (for skeletal meshes). |
|
|
uint8: 1 |
bStartPenetrating |
Whether the trace started in penetration, i.e. with an initial blocking overlap. |
|
TWeakObjectPtr<... |
Component |
PrimitiveComponent hit by the trace. |
|
float |
Distance |
The distance from the TraceStart to the Location in world space. |
|
uint8 |
ElementIndex |
Index to item that was hit, also hit primitive specific. |
|
int32 |
FaceIndex |
Face index we hit (for complex hits with triangle meshes). |
|
HitObjectHandle |
Handle to the object hit by the trace. |
|
|
FVector_NetQuan... |
ImpactNormal |
Normal of the hit in world space, for the object that was hit by the sweep, if any. |
|
FVector_NetQuan... |
ImpactPoint |
Location in world space of the actual contact of the trace shape (box, sphere, ray, etc) with the impacted object. |
|
int32 |
Item |
Extra data about item that was hit (hit primitive specific). |
|
FVector_NetQuan... |
Location |
The location in world space where the moving shape would end up against the impacted object, if there is a hit. |
|
MyBoneName |
Name of the my bone which took part in hit event (in case of two skeletal meshes colliding). |
|
|
int32 |
MyItem |
If the hit result is from a collision this will have extra info about the item that hit the second item. |
|
FVector_NetQuan... |
Normal |
Normal of the hit in world space, for the object that was swept. |
|
float |
PenetrationDepth |
If this test started in penetration (bStartPenetrating is true) and a depenetration vector can be computed, this value is the distance along Normal that will result in moving out of penetration. |
|
TWeakObjectPtr<... |
PhysMaterial |
Physical material that was hit. |
|
float |
Time |
'Time' of impact along trace direction (ranging from 0.0 to 1.0) if there is a hit, indicating time between TraceStart and TraceEnd. |
|
FVector_NetQuan... |
TraceEnd |
End location of the trace; this is NOT where the impact occurred (if any), but the furthest point in the attempted sweep. |
|
FVector_NetQuan... |
TraceStart |
Start location of the trace. |
Name | Description | |
---|---|---|
|
FHitResult() |
|
|
FHitResult ( |
|
|
FHitResult ( |
|
|
FHitResult ( |
|
|
FHitResult ( |
|
|
FHitResult ( |
Ctor for easily creating "fake" hits from limited data. |
Name | Description | ||
---|---|---|---|
|
AActor * |
GetActor() |
Utility to return the Actor that owns the Component that was hit. |
|
UPrimitiveCo... |
GetComponent() |
Utility to return the Component that was hit. |
|
FHitResult &... |
GetFirstBlockingHit ( |
Static utility function that returns the first 'blocking' hit in an array of results. |
|
FActorInstan... |
GetHitObjectHandle() |
|
|
int32 |
GetNumBlockingHits ( |
Static utility function that returns the number of blocking hits in array. |
|
int32 |
GetNumOverlapHits ( |
Static utility function that returns the number of overlapping hits in array. |
|
GetReversedHit ( |
Get a copy of the HitResult with relevant information reversed. |
|
|
bool |
HasValidHitObjectHandle() |
|
|
void |
Init ( |
Initialize empty hit result with given time, TraceStart, and TraceEnd |
|
void |
Init() |
Initialize empty hit result with given time. |
|
bool |
IsValidBlockingHit() |
Return true if there was a blocking hit that was not caused by starting in penetration. |
|
bool |
NetSerialize ( |
Optimized serialize function |
|
void |
Reset ( |
Reset hit result while optionally saving TraceStart and TraceEnd. |
|
ToString() |