UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Triangle.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Chaos/Core.h"
6#include "Chaos/GJK.h"
7#include "ImplicitObject.h"
8#include "Plane.h"
9#include "Chaos/Plane.h"
10
11namespace Chaos
12{
24 template <typename RealType>
26 {
27 const TVec3<RealType> V02 = V0 - V2;
28 const TVec3<RealType> V12 = V1 - V2;
29 const TVec3<RealType> PV2 = Point - V2;
30 const RealType M00 = V02.Dot(V02);
31 const RealType M01 = V02.Dot(V12);
32 const RealType M11 = V12.Dot(V12);
33 const RealType R0 = V02.Dot(PV2);
34 const RealType R1 = V12.Dot(PV2);
35 const RealType Det = M00 * M11 - M01 * M01;
36 RealType Bary1, Bary2, Bary3;
37 if (Det > UE_SMALL_NUMBER)
38 {
39 // Non-degenerate triangle
40 const RealType InvDet = RealType(1) / Det;
41 Bary1 = (M11 * R0 - M01 * R1) * InvDet;
42 Bary2 = (M00 * R1 - M01 * R0) * InvDet;
43 Bary3 = RealType(1) - Bary1 - Bary2;
44 }
45 else
46 {
47 const bool bHaveLine02 = (M00 > UE_SMALL_NUMBER);
48 const bool bHaveLine12 = (M11 > UE_SMALL_NUMBER);
49 const bool bInsideLine02 = ((M00 > UE_SMALL_NUMBER) && (R0 >= 0) && (R0 <= M00));
50 const bool bInsideLine12 = ((M11 > UE_SMALL_NUMBER) && (R1 >= 0) && (R1 <= M11));
52 {
53 // Line-degenerate and point on line segment V02
54 const RealType Alpha02 = R0 / M00;
55 Bary1 = Alpha02;
56 Bary2 = RealType(0);
57 Bary3 = RealType(1) - Alpha02;
58 }
59 else if (bHaveLine12)
60 {
61 // Line-degenerate and point on line segment V12
62 const RealType Alpha12 = R1 / M11;
63 Bary1 = RealType(0);
64 Bary2 = Alpha12;
65 Bary3 = RealType(1) - Alpha12;
66 }
67 else
68 {
69 // Point-degenerate, or line-degenerate and point not on line
70 Bary1 = RealType(1);
71 Bary2 = RealType(0);
72 Bary3 = RealType(0);
73 }
74 }
76 }
77
82 template <typename RealType>
83 inline TVec3<RealType> FromBarycentric(const TVec3<RealType>& Barycentric, const TVec3<RealType>& V0, const TVec3<RealType>& V1, const TVec3<RealType>& V2)
84 {
85 return Barycentric.X * V0 + Barycentric.Y * V1 + Barycentric.Z * V2;
86 }
87
88
89 template<typename T>
91 {
92 public:
94 {
95 }
96
97 TTriangle(const TVec3<T>& InA, const TVec3<T>& InB, const TVec3<T>& InC)
98 : ABC{ InA, InB, InC }
99 {
100 }
101
103 {
104 checkSlow(InIndex < 3);
105 return ABC[InIndex];
106 }
107
109 {
110 checkSlow(InIndex < 3);
111 return ABC[InIndex];
112 }
113
115 {
116 checkSlow(InIndex < 3);
117 return ABC[InIndex];
118 }
119
121 {
122 return TVec3<T>::CrossProduct(ABC[1] - ABC[0], ABC[2] - ABC[0]).GetSafeNormal();
123 }
124
126 {
127 return TPlane<T, 3>(ABC[0], GetNormal());
128 }
129
130 // Face index is ignored since we only have one face
131 // Used for manifold generation
136
138 {
139 OutN = GetNormal();
140 OutX = ABC[0];
141 }
142
144 {
145 return (GetVertex(0) + GetVertex(1) + GetVertex(2)) / T(3.0);
146 }
147
148 // Get the nearest point on an edge and the edge vertices
149 // Used for manifold generation
178
179 // Get the nearest point on an edge
180 // Used for manifold generation
186
187
188 // The number of vertices that make up the corners of the specified face
189 // Used for manifold generation
190 int32 NumPlaneVertices(int32 PlaneIndex) const
191 {
192 return 3;
193 }
194
195 // Change the winding order of this triangle by flipping the last two vertices
197 {
198 Swap(ABC[1], ABC[2]);
199 return *this;
200 }
201
202 // Triangle winding order is always 1.0. When we reverse the winding of a triangle we flip the verts. @see ReverseWinding
203 // Used for manifold generation
205 {
206 return 1.0f;
207 }
208
209 // Get an array of all the plane indices that belong to a vertex (up to MaxVertexPlanes).
210 // Returns the number of planes found.
212 {
213 if(MaxVertexPlanes > 0)
214 {
215 OutVertexPlanes[0] = 0;
216 }
217 return 1;
218 }
219
220 // Get up to the 3 plane indices that belong to a vertex
221 // Returns the number of planes found.
223 {
224 PlaneIndex0 = 0;
225 return 1;
226 }
227
228 // Get the index of the plane that most opposes the normal
230 {
231 return 0; // Only have one plane
232 }
233
234 // Get the vertex index of one of the vertices making up the corners of the specified face
235 // Used for manifold generation
237 {
238 return PlaneVertexIndex;
239 }
240
241 // Triangle is just one plane
242 // Used for manifold generation
243 int32 NumPlanes() const { return 1; }
244
246 {
247 OutNormal = GetNormal();
248 TVec3<T> ClosestPoint = FindClosestPointOnTriangle(GetPlane(), ABC[0], ABC[1], ABC[2], InSamplePoint);
249 return TVec3<T>::DotProduct((InSamplePoint - ClosestPoint), OutNormal);
250 }
251
252 FORCEINLINE TVec3<T> Support(const TVec3<T>& Direction, const T Thickness, int32& VertexIndex) const
253 {
254 const T DotA = TVec3<T>::DotProduct(ABC[0], Direction);
255 const T DotB = TVec3<T>::DotProduct(ABC[1], Direction);
256 const T DotC = TVec3<T>::DotProduct(ABC[2], Direction);
257
258 if(DotA >= DotB && DotA >= DotC)
259 {
260 VertexIndex = 0;
261 if(Thickness != 0)
262 {
263 return ABC[0] + Direction.GetUnsafeNormal() * Thickness;
264 }
265 return ABC[0];
266 }
267 else if(DotB >= DotA && DotB >= DotC)
268 {
269 VertexIndex = 1;
270 if(Thickness != 0)
271 {
272 return ABC[1] + Direction.GetUnsafeNormal() * Thickness;
273 }
274 return ABC[1];
275 }
276 VertexIndex = 2;
277 if(Thickness != 0)
278 {
279 return ABC[2] + Direction.GetUnsafeNormal() * Thickness;
280 }
281 return ABC[2];
282 }
283
284 FORCEINLINE_DEBUGGABLE TVec3<T> SupportCore(const TVec3<T>& Direction, const T InMargin, T* OutSupportDelta,int32& VertexIndex) const
285 {
286 // Note: assumes margin == 0
287 const T DotA = TVec3<T>::DotProduct(ABC[0], Direction);
288 const T DotB = TVec3<T>::DotProduct(ABC[1], Direction);
289 const T DotC = TVec3<T>::DotProduct(ABC[2], Direction);
290
291 if (DotA >= DotB && DotA >= DotC)
292 {
293 VertexIndex = 0;
294 return ABC[0];
295 }
296 else if (DotB >= DotA && DotB >= DotC)
297 {
298 VertexIndex = 1;
299 return ABC[1];
300 }
301 VertexIndex = 2;
302 return ABC[2];
303 }
304
305 FORCEINLINE TVec3<T> SupportCoreScaled(const TVec3<T>& Direction, T InMargin, const TVec3<T>& Scale, T* OutSupportDelta, int32& VertexIndex) const
306 {
307 // Note: ignores InMargin, assumed 0 (triangles cannot have a margin as they are zero thickness)
308 return SupportCore(Direction * Scale, 0.0f, OutSupportDelta, VertexIndex) * Scale;
309 }
310
311 FORCEINLINE T GetMargin() const { return 0; }
312 FORCEINLINE T GetRadius() const { return 0; }
313 FORCEINLINE FRealSingle GetMarginf() const { return 0.0f; }
314 FORCEINLINE FRealSingle GetRadiusf() const { return 0.0f; }
315
316 FORCEINLINE bool Raycast(const TVec3<T>& StartPoint, const TVec3<T>& Dir, const T Length, const T Thickness, T& OutTime, TVec3<T>& OutPosition, TVec3<T>& OutNormal, int32& OutFaceIndex) const
317 {
318 // No face as this is only one triangle
319 OutFaceIndex = INDEX_NONE;
320
321 // Pass through GJK #BGTODO Maybe specialise if it's possible to be faster
322 const FRigidTransform3 StartTM(StartPoint, FRotation3::FromIdentity());
323 const TSphere<T, 3> Sphere(TVec3<T>(0), Thickness);
324 return GJKRaycast(*this, Sphere, StartTM, Dir, Length, OutTime, OutPosition, OutNormal);
325 }
326
327 FORCEINLINE bool Overlap(const TVec3<T>& Point, const T Thickness) const
328 {
329 const TVec3<T> ClosestPoint = FindClosestPointOnTriangle(GetPlane(), ABC[0], ABC[1], ABC[2], Point);
330 const T AdjustedThickness = FMath::Max(Thickness, UE_KINDA_SMALL_NUMBER);
331 return (Point - ClosestPoint).SizeSquared() <= (AdjustedThickness * AdjustedThickness);
332 }
333
335 {
336 return true;
337 }
338
339 FString ToString() const
340 {
341 return FString::Printf(TEXT("Triangle: A: [%f, %f, %f], B: [%f, %f, %f], C: [%f, %f, %f]"), GetVertex(0).X, GetVertex(0).Y, GetVertex(0).Z, GetVertex(1).X, GetVertex(1).Y, GetVertex(1).Z, GetVertex(2).X, GetVertex(2).Y, GetVertex(2).Z);
342 }
343
345 {
346 static constexpr T ParallelTolerance = (T)UE_SMALL_NUMBER;
347 static constexpr T BaryTolerance = (T)0;
348 };
349 FORCEINLINE bool LineIntersection(const TVec3<T>& StartPoint, const TVec3<T>& EndPoint, TVector<T, 2>& OutBary, T& OutTime) const;
350
351 private:
352
354
355 TVec3<T> ABC[3];
356 };
357
359
360 template<typename T>
362 {
363 Ar << Value.ABC[0] << Value.ABC[1] << Value.ABC[2];
364 return Ar;
365 }
366
367 template<typename T>
373
374 template<typename T, typename ToleranceProvider = TRayTriangleIntersectionDefaultToleranceProvider<T> >
376 const TVec3<T>& A, const TVec3<T>& B, const TVec3<T>& C, T& OutT, TVec2<T>& OutBary, TVec3<T>& OutN)
377 {
378 const TVec3<T> AB = B - A; // edge 1
379 const TVec3<T> AC = C - A; // edge 2
381 const TVec3<T> NegRayDir = -RayDir;
382
384 if (FMath::Abs(Den) < ToleranceProvider::ParallelTolerance)
385 {
386 // ray is parallel or away to the triangle plane it is a miss
387 return false;
388 }
389
390 const T InvDen = (T)1 / Den;
391
392 // let's compute the time to intersection
393 const TVec3<T> RayToA = RayStart - A;
395 if (Time < (T)0 || Time > RayLength)
396 {
397 return false;
398 }
399
400 // now compute barycentric coordinates
401 const TVec3<T> RayToACrossNegDir = FVec3::CrossProduct(NegRayDir, RayToA);
403 if (UU < -ToleranceProvider::BaryTolerance || UU >(1 + ToleranceProvider::BaryTolerance))
404 {
405 return false; // outside of the triangle
406 }
408 if (VV < -ToleranceProvider::BaryTolerance || (VV + UU) >(1 + ToleranceProvider::BaryTolerance))
409 {
410 return false; // outside of the triangle
411 }
412
413 // point is within the triangle, let's compute
414 OutT = Time;
415 OutBary = { UU, VV };
417 OutN *= FMath::Sign(Den);
418 return true;
419 }
420
426 template<typename T>
428 const TVec3<T>& RayStart, const TVec3<T>& RayDir, T RayLength,
429 const TVec3<T>& A, const TVec3<T>& B, const TVec3<T>& C,
430 T& OutT, TVec3<T>& OutN
431 )
432 {
435 }
436
437 template<typename T>
438 FORCEINLINE bool TTriangle<T>::LineIntersection(const TVec3<T>& StartPoint, const TVec3<T>& EndPoint, TVector<T, 2>& OutBary, T& OutTime) const
439 {
440 const TVec3<T> StartToEnd = EndPoint - StartPoint;
443 {
444 return false;
445 }
446 const T SegmentLen = FMath::Sqrt(SegmentLenSq);
447 const T OneOverSegmentLen = (T)1 / SegmentLen;
449
451 if (RayTriangleIntersectionAndBary<T, FLineIntersectionToleranceProvider>(StartPoint, Ray, SegmentLen, ABC[0], ABC[1], ABC[2], OutTime, OutBary, NormalUnused))
452 {
453 // OutTime is between 0 and SegmentLen. Convert to 0 to 1
454 OutTime *= OneOverSegmentLen;
455 return true;
456 }
457
458 return false;
459 }
460
461 template<typename T>
462 class UE_DEPRECATED(4.27, "Deprecated. this class is to be deleted, use other triangle based ImplicitObjects") TImplicitTriangle final : public FImplicitObject
463 {
464 public:
465
467 : FImplicitObject(EImplicitObject::IsConvex | EImplicitObject::HasBoundingBox, ImplicitObjectType::Triangle)
468 {}
469
470 TImplicitTriangle(const TImplicitTriangle&) = delete;
471
473 : FImplicitObject(EImplicitObject::IsConvex | EImplicitObject::HasBoundingBox, ImplicitObjectType::Triangle)
474 {}
475
476 TImplicitTriangle(const TVec3<T>& InA, const TVec3<T>& InB, const TVec3<T>& InC)
477 : FImplicitObject(EImplicitObject::IsConvex | EImplicitObject::HasBoundingBox, ImplicitObjectType::Triangle)
478 , Tri(InA, InB, InC)
479 {
480 }
481
482 TVec3<T>& operator[](uint32 InIndex)
483 {
484 return Tri[InIndex];
485 }
486
487 const TVec3<T>& operator[](uint32 InIndex) const
488 {
489 return Tri[InIndex];
490 }
491
492 TVec3<T> GetNormal() const
493 {
494 return Tri.GetNormal();
495 }
496
497 TPlane<T, 3> GetPlane() const
498 {
499 return Tri.GetPlane();
500 }
501
502 static constexpr EImplicitObjectType StaticType()
503 {
504 return ImplicitObjectType::Triangle;
505 }
506
507 virtual T PhiWithNormal(const TVec3<T>& InSamplePoint, TVec3<T>& OutNormal) const override
508 {
509 return Tri.PhiWithNormal(InSamplePoint, OutNormal);
510 }
511
512 virtual const class TAABB<T, 3> BoundingBox() const override
513 {
514 TAABB<T, 3> Bounds(Tri[0], Tri[0]);
515 Bounds.GrowToInclude(Tri[1]);
516 Bounds.GrowToInclude(Tri[2]);
517
518 return Bounds;
519 }
520
521 virtual TVec3<T> Support(const TVec3<T>& Direction, const T Thickness, int32& VertexIndex) const override
522 {
523 return Tri.Support(Direction, Thickness, VertexIndex);
524 }
525
526 virtual bool Raycast(const TVec3<T>& StartPoint, const TVec3<T>& Dir, const T Length, const T Thickness, T& OutTime, TVec3<T>& OutPosition, TVec3<T>& OutNormal, int32& OutFaceIndex) const override
527 {
528 return Tri.Raycast(StartPoint, Dir, Length, Thickness, OutTime, OutPosition, OutNormal, OutFaceIndex);
529 }
530
531 virtual TVec3<T> FindGeometryOpposingNormal(const TVec3<T>& DenormDir, int32 FaceIndex, const TVec3<T>& OriginalNormal) const override
532 {
533 return Tri.GetNormal();
534 }
535
536 virtual bool Overlap(const TVec3<T>& Point, const T Thickness) const override
537 {
538 return Tri.Overlap(Point, Thickness);
539 }
540
541 virtual FString ToString() const override
542 {
543 return FString::Printf(TEXT("Triangle: A: [%f, %f, %f], B: [%f, %f, %f], C: [%f, %f, %f]"), Tri[0].X, Tri[0].Y, Tri[0].Z, Tri[1].X, Tri[1].Y, Tri[1].Z, Tri[2].X, Tri[2].Y, Tri[2].Z);
544 }
545
546 virtual void Serialize(FChaosArchive& Ar) override
547 {
548 Ar << Tri;
549 }
550
551 virtual uint32 GetTypeHash() const override
552 {
554 }
555
556 virtual FName GetTypeName() const override
557 {
558 return FName("Triangle");
559 }
560
561 private:
562
563 TTriangle<T> Tri;
564 };
565}
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define checkSlow(expr)
Definition AssertionMacros.h:332
FString GetTypeName()
Definition Casts.h:66
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define FORCEINLINE_DEBUGGABLE
Definition CoreMiscDefines.h:74
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
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
#define X(Name, Desc)
Definition FormatStringSan.h:47
constexpr uint32 HashCombine(uint32 A, uint32 C)
Definition TypeHash.h:36
#define UE_SMALL_NUMBER
Definition UnrealMathUtility.h:130
#define UE_KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:131
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ChaosArchive.h:167
Definition ImplicitObject.h:111
Definition CorePlane.h:12
Definition Plane.h:14
Definition Sphere.h:28
Definition Triangle.h:91
FORCEINLINE int32 FindVertexPlanes(int32 VertexIndex, int32 *OutVertexPlanes, int32 MaxVertexPlanes) const
Definition Triangle.h:211
FORCEINLINE FRealSingle GetMarginf() const
Definition Triangle.h:313
TVec3< T > GetClosestEdgePosition(int32 PlaneIndexHint, const TVec3< T > &Position) const
Definition Triangle.h:181
FORCEINLINE TPlaneConcrete< T, 3 > GetPlane(int32 FaceIndex) const
Definition Triangle.h:132
FORCEINLINE T GetRadius() const
Definition Triangle.h:312
FORCEINLINE T GetMargin() const
Definition Triangle.h:311
FORCEINLINE_DEBUGGABLE TVec3< T > SupportCore(const TVec3< T > &Direction, const T InMargin, T *OutSupportDelta, int32 &VertexIndex) const
Definition Triangle.h:284
FORCEINLINE const TVec3< T > & GetVertex(const int32 InIndex) const
Definition Triangle.h:114
TVec3< T > GetClosestEdge(int32 PlaneIndexHint, const TVec3< T > &Position, TVec3< T > &OutEdgePos0, TVec3< T > &OutEdgePos1) const
Definition Triangle.h:150
FORCEINLINE bool LineIntersection(const TVec3< T > &StartPoint, const TVec3< T > &EndPoint, TVector< T, 2 > &OutBary, T &OutTime) const
Definition Triangle.h:438
FORCEINLINE TVec3< T > GetCentroid() const
Definition Triangle.h:143
FORCEINLINE TVec3< T > GetNormal() const
Definition Triangle.h:120
FORCEINLINE T GetWindingOrder() const
Definition Triangle.h:204
int32 NumPlanes() const
Definition Triangle.h:243
int32 GetMostOpposingPlane(const TVec3< T > &Normal) const
Definition Triangle.h:229
int32 GetPlaneVertex(int32 PlaneIndex, int32 PlaneVertexIndex) const
Definition Triangle.h:236
int32 NumPlaneVertices(int32 PlaneIndex) const
Definition Triangle.h:190
int32 GetVertexPlanes3(int32 VertexIndex, int32 &PlaneIndex0, int32 &PlaneIndex1, int32 &PlaneIndex2) const
Definition Triangle.h:222
TTriangle()
Definition Triangle.h:93
friend FChaosArchive & operator<<(FChaosArchive &Ar, TTriangle &Value)
Definition Triangle.h:361
FORCEINLINE TPlane< T, 3 > GetPlane() const
Definition Triangle.h:125
FORCEINLINE bool Overlap(const TVec3< T > &Point, const T Thickness) const
Definition Triangle.h:327
FORCEINLINE void GetPlaneNX(const int32 FaceIndex, TVec3< T > &OutN, TVec3< T > &OutX) const
Definition Triangle.h:137
FORCEINLINE TVec3< T > SupportCoreScaled(const TVec3< T > &Direction, T InMargin, const TVec3< T > &Scale, T *OutSupportDelta, int32 &VertexIndex) const
Definition Triangle.h:305
FORCEINLINE FRealSingle GetRadiusf() const
Definition Triangle.h:314
FORCEINLINE TVec3< T > & operator[](uint32 InIndex)
Definition Triangle.h:102
FORCEINLINE T PhiWithNormal(const TVec3< T > &InSamplePoint, TVec3< T > &OutNormal) const
Definition Triangle.h:245
FTriangle & ReverseWinding()
Definition Triangle.h:196
TTriangle(const TVec3< T > &InA, const TVec3< T > &InB, const TVec3< T > &InC)
Definition Triangle.h:97
FString ToString() const
Definition Triangle.h:339
FORCEINLINE const TVec3< T > & operator[](uint32 InIndex) const
Definition Triangle.h:108
FORCEINLINE bool IsConvex() const
Definition Triangle.h:334
FORCEINLINE bool Raycast(const TVec3< T > &StartPoint, const TVec3< T > &Dir, const T Length, const T Thickness, T &OutTime, TVec3< T > &OutPosition, TVec3< T > &OutNormal, int32 &OutFaceIndex) const
Definition Triangle.h:316
FORCEINLINE TVec3< T > Support(const TVec3< T > &Direction, const T Thickness, int32 &VertexIndex) const
Definition Triangle.h:252
Definition Vector.h:1000
T X
Definition Vector.h:1168
T Z
Definition Vector.h:1170
TVector< T, 3 > GetSafeNormal() const
Definition Vector.h:1079
T Y
Definition Vector.h:1169
FORCEINLINE T SizeSquared() const
Definition Vector.h:1067
Definition Vector.h:41
Definition NameTypes.h:617
FVector GetNormal(const FLocationHit &Hit)
Definition ChaosInterfaceWrapperCore.h:165
@ IsConvex
Definition ImplicitObjectType.h:67
@ HasBoundingBox
Definition ImplicitObjectType.h:68
Definition SkeletalMeshComponent.h:307
bool GJKRaycast(const TGeometryA &A, const TGeometryB &B, const TRigidTransform< T, 3 > &StartTM, const TVector< T, 3 > &RayDir, const T RayLength, T &OutTime, TVector< T, 3 > &OutPosition, TVector< T, 3 > &OutNormal, const T ThicknessA=0, const TVector< T, 3 > &InitialDir=TVector< T, 3 >(1, 0, 0), const T ThicknessB=0)
Definition GJK.h:1449
uint8 EImplicitObjectType
Definition ImplicitObjectType.h:41
@ Y
Definition SimulationModuleBase.h:153
@ X
Definition SimulationModuleBase.h:152
FChaosArchive & operator<<(FChaosArchive &Ar, FRigidParticleControlFlags &Flags)
Definition RigidParticleControlFlags.cpp:15
TVector< T, d > FindClosestPointOnTriangle(const TVector< T, d > &ClosestPointOnPlane, const TVector< T, d > &P0, const TVector< T, d > &P1, const TVector< T, d > &P2, const TVector< T, d > &P)
Definition Plane.h:168
TVec3< RealType > ToBarycentric(const TVec3< RealType > &Point, const TVec3< RealType > &V0, const TVec3< RealType > &V1, const TVec3< RealType > &V2)
Convert the cartesian coordinate into a barycentric corrdinate. Compute barycentric coordinates/weigh...
Definition Triangle.h:25
float FRealSingle
Definition Real.h:14
TVec3< RealType > FromBarycentric(const TVec3< RealType > &Barycentric, const TVec3< RealType > &V0, const TVec3< RealType > &V1, const TVec3< RealType > &V2)
Convert the barycentric coordinate into a cartesian corrdinate.
Definition Triangle.h:83
FORCEINLINE bool RayTriangleIntersection(const TVec3< T > &RayStart, const TVec3< T > &RayDir, T RayLength, const TVec3< T > &A, const TVec3< T > &B, const TVec3< T > &C, T &OutT, TVec3< T > &OutN)
Definition Triangle.h:427
FORCEINLINE_DEBUGGABLE bool RayTriangleIntersectionAndBary(const TVec3< T > &RayStart, const TVec3< T > &RayDir, T RayLength, const TVec3< T > &A, const TVec3< T > &B, const TVec3< T > &C, T &OutT, TVec2< T > &OutBary, TVec3< T > &OutN)
Definition Triangle.h:375
uint32 GetTypeHash(const FKey &Key)
Definition BlackboardKey.h:35
FString ToString(uint16 Value)
Definition PathFollowingComponent.cpp:82
uint32 GetTypeHash(const TBox< T > &Box)
Definition Box.h:1008
static constexpr T BaryTolerance
Definition Triangle.h:371
static constexpr T ParallelTolerance
Definition Triangle.h:370
static constexpr T BaryTolerance
Definition Triangle.h:347
static constexpr T ParallelTolerance
Definition Triangle.h:346
static CORE_API UE::Math::TVector< T > ClosestPointOnLine(const UE::Math::TVector< T > &LineStart, const UE::Math::TVector< T > &LineEnd, const UE::Math::TVector< T > &Point)
Definition NumericLimits.h:41