UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GJKContactPoint.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6#include "Chaos/Core.h"
7#include "Chaos/ImplicitFwd.h"
9#include "Chaos/GJK.h"
10
11
12namespace Chaos
13{
14 template <typename GeometryA, typename GeometryB>
16 {
18
19 FReal Penetration;
22
23 // Slightly increased epsilon to reduce error in normal for almost touching objects.
24 const FReal Epsilon = 3.e-3f;
25
27 {
28 // GJK output is all in the local space of A. We need to transform the B-relative position and the normal in to B-space
29 Contact.ShapeContactPoints[0] = ClosestA;
30 Contact.ShapeContactPoints[1] = BToATM.InverseTransformPosition(ClosestBInA);
31 Contact.ShapeContactNormal = -BToATM.InverseTransformVector(Normal);
32 Contact.Phi = -Penetration;
33 }
34
35 return Contact;
36 }
37
38 template <typename GeometryA, typename GeometryB>
40 {
41 const FRigidTransform3 BToATM = BTM.GetRelativeTransform(ATM);
43 }
44}
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition ContactPoint.h:42
Definition SkeletalMeshComponent.h:307
FContactPoint GJKContactPoint2(const GeometryA &A, const GeometryB &B, const FRigidTransform3 &ATM, const FRigidTransform3 &BToATM, const FVec3 &InitialDir)
Definition GJKContactPoint.h:15
FRealDouble FReal
Definition Real.h:22
FContactPoint GJKContactPoint(const GeometryA &A, const FRigidTransform3 &ATM, const GeometryB &B, const FRigidTransform3 &BTM, const FVec3 &InitialDir)
Definition GJKContactPoint.h:39