Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UBodySetup
Description
Finds the closest point in the body setup. Input and outputs are given in world space. NOTE: This function ignores trimesh data
| Name | GetClosestPointAndNormal |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Classes/PhysicsEngine/BodySetup.h |
| Include Path | #include "PhysicsEngine/BodySetup.h" |
| Source | /Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodySetup.cpp |
float GetClosestPointAndNormal
(
const FVector & WorldPosition,
const FTransform & BodyToWorldTM,
FVector & ClosestWorldPosition,
FVector & FeatureNormal,
bool bUseConvexShapes
) const
The distance between WorldPosition and the body setup. 0 indicates WorldPosition is inside one of the shapes.
Parameters
| Name | Remarks |
|---|---|
| WorldPosition | The point we are trying to get close to |
| BodyToWorldTM | The transform to convert BodySetup into world space |
| ClosestWorldPosition | The closest point on the body setup to WorldPosition |
| FeatureNormal | The normal of the feature associated with ClosestWorldPosition |
| bUseConvexShapes | When true also check the convex shapes if any (false by default) |