UBodySetup::GetClosestPointAndNormal

Finds the closest point in the body setup.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/PhysicsEngine/BodySetup.h

Include

#include "PhysicsEngine/BodySetup.h"

Source

/Engine/Source/Runtime/Engine/Private/PhysicsEngine/BodySetup.cpp

Syntax

float GetClosestPointAndNormal
(
    const FVector & WorldPosition,
    const FTransform & BodyToWorldTM,
    FVector & ClosestWorldPosition,
    FVector & FeatureNormal
) const

Remarks

Finds the closest point in the body setup. Input and outputs are given in world space.

This function ignores convex and trimesh data

Returns

The distance between WorldPosition and the body setup. 0 indicates WorldPosition is inside one of the shapes.

Parameters

Parameter

Description

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

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss