UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ConvexContactPoint.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc.All Rights Reserved.
2#pragma once
3
4#include "Chaos/Core.h"
7
8namespace Chaos::Private
9{
10 // A contact point between two convex features
11 template<typename T>
13 {
14 public:
15 using FRealType = T;
16
18 {
19 Reset();
20 }
21
22 inline void Reset()
23 {
25 }
26
27 inline bool IsSet() const
28 {
29 return Phi != InvalidPhi<FRealType>();
30 }
31
32 // Convert a feature pair into a contact type (used by callbacks, events, etc)
34 {
35 if (!IsSet())
36 {
38 }
39
40 // Both features should be set to something
41 if ((Features[0].FeatureType == EConvexFeatureType::Unknown) || (Features[1].FeatureType == EConvexFeatureType::Unknown))
42 {
44 }
45
46 // Plane-Plane, Edge-Plane and Vertex-Plane are treated as Vertex-Plane
47 if (Features[1].FeatureType == EConvexFeatureType::Plane)
48 {
50 }
51
52 // Plane-Vertex and Plane-Edge are treated as Plane-Vertex
53 if (Features[0].FeatureType == EConvexFeatureType::Plane)
54 {
56 }
57
58 // Vertex-Vertex, Edge-Vertex and Edge-Edge are treated as Edge-Edge
60 }
61
66 };
67
70}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition ConvexFeature.h:20
Definition ConvexContactPoint.h:13
void Reset()
Definition ConvexContactPoint.h:22
FConvexFeature Features[2]
Definition ConvexContactPoint.h:62
EContactPointType GetContactPointType() const
Definition ConvexContactPoint.h:33
FRealType Phi
Definition ConvexContactPoint.h:65
TConvexContactPoint()
Definition ConvexContactPoint.h:17
bool IsSet() const
Definition ConvexContactPoint.h:27
TVec3< FRealType > ShapeContactPoints[2]
Definition ConvexContactPoint.h:63
T FRealType
Definition ConvexContactPoint.h:15
TVec3< FRealType > ShapeContactNormal
Definition ConvexContactPoint.h:64
Definition Vector.h:1000
Definition BodyInstance.h:90
EContactPointType
Used in FContactPoint to indicate whether the contact is vertex-plane, edge-edge, etc.
Definition ContactPoint.h:16