FKSphereElem::GetClosestPointAndNormal

Finds the closest point on the shape given a world position.

Windows
MacOS
Linux

References

Module

Engine

Header

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

Include

#include "PhysicsEngine/SphereElem.h"

Source

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

Syntax

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

Remarks

Finds the closest point on the shape given a world position. Input and output are given in world space

Returns

The distance between WorldPosition and the shape. 0 indicates WorldPosition is inside the shape.

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 shape in world space

Normal

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