FBodyInstance::GetSquaredDistanceToBody

Get distance to the body surface if available It is only valid if BodyShape is convex If point is inside distance it will be 0 Returns false if geometry is not supported

Windows
MacOS
Linux

References

Module

Engine

Header

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

Include

#include "PhysicsEngine/BodyInstance.h"

Source

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

Syntax

bool GetSquaredDistanceToBody
(
    const FVector & Point,
    float & OutDistanceSquared,
    FVector & OutPointOnBody
) const

Remarks

Get distance to the body surface if available It is only valid if BodyShape is convex If point is inside distance it will be 0 Returns false if geometry is not supported

Returns

true if a distance to the body was found and OutDistanceSquared has been populated

Parameters

Parameter

Description

Point

Point in world space

OutDistanceSquared

How far from the instance the point is. 0 if inside the shape

OutPointOnBody

Point on the surface of body closest to Point

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