41 template <
typename RealType>
50 template <
typename RealType>
60 template <
typename RealType>
61 inline RealType
Clamp(RealType
Value, RealType MinValue, RealType MaxValue)
63 return (
Value < MinValue) ? MinValue : ((
Value > MaxValue) ? MaxValue :
Value);
69 template <
typename RealType>
82 template <
typename RealType>
86 return (V2 - V0).
Cross(V1 - V0);
92 template <
typename RealType>
98 return (RealType)0.5 *
Cross.Length();
104 template <
typename RealType>
116 template <
typename RealType>
119 return ((RealType)0.5) * ((V0.X * V1.Y - V0.Y * V1.X) + (V1.X * V2.Y - V1.Y * V2.X) + (V2.X * V0.Y - V2.Y * V0.X));
125 template <
typename RealType>
131 return (
a2 +
b2 < c2) || (
b2 + c2 <
a2) || (c2 +
a2 <
b2);
138 template <
typename RealType>
150 template <
typename RealType>
157 template <
typename RealType>
164 template <
typename RealType>
171 template <
typename RealType>
179 template <
typename ValueVecType>
193 template <
typename ValueVecType>
210 template <
typename RealType>
214 if (
Normal.Z < (RealType)0)
216 RealType
A = (RealType)1 / ((RealType)1 -
Normal.Z);
227 RealType
A = (RealType)1 / ((RealType)1 +
Normal.Z);
241 template <
typename RealType>
246 if (
Normal.Z < (RealType)0)
248 RealType
A = (RealType)1 / ((RealType)1 -
Normal.Z);
256 RealType
A = (RealType)1 / ((RealType)1 +
Normal.Z);
268 template <
typename RealType>
279 template <
typename RealType>
289 return vFrom.Dot(
vTo) < 0 ? (RealType)180 : (RealType)0;
291 RealType
fSign =
C.Dot(
PlaneN) < 0 ? (RealType)-1 : (RealType)1;
299 template <
typename RealType>
311 RealType
fSign =
C.Dot(
PlaneN) < 0 ? (RealType)-1 : (RealType)1;
319 template <
typename RealType>
332 template <
typename RealType>
346 template <
typename RealType>
350 RealType
fDot = V1.Dot(V2);
351 RealType
lensqr1 = V1.SquaredLength();
352 RealType
lensqr2 = V2.SquaredLength();
370 template <
typename RealType>
395 template <
typename RealType>
420 template<
typename RealType>
424 RealType
SqrtR1 = FMath::Sqrt(R1);
434 template<
typename RealType>
438 if (R1 + R2 > (RealType)1)
440 R1 = (RealType)1 - R1;
441 R2 = (RealType)1 - R2;
443 return A + R1 * (
B -
A) + R2 * (
C -
A);
452 template<
typename RealType>
456 if (R1 + R2 > (RealType)1)
458 R1 = (RealType)1 - R1;
459 R2 = (RealType)1 - R2;
461 return A + R1 * (
B -
A) + R2 * (
C -
A);
467 template <
typename RealType>
474 RealType
la =
A.Length(),
lb =
B.Length(),
lc =
C.Length();
476 RealType bottom =
A.X * (
B.Y *
C.Z -
C.Y *
B.Z) -
A.Y * (
B.X *
C.Z -
C.X *
B.Z) +
A.Z * (
B.X *
C.Y -
C.X *
B.Y);
478 return RealType(-2.0) *
atan2(bottom, top);
487 template <
typename RealType>
492 Vi -= Centroid;
Vj -= Centroid;
Vk -= Centroid;
504 RealType
AreaScale = (RealType)1 / ((RealType)2 * VectorUtil::Area<RealType>(
Vi,
Vj,
Vk));
513 template<
typename RealType>
529 template <
typename RealType>
538 template<
typename RealType>
546 if (FMath::Abs(
Denom) <= Epsilon)
550 return A + (AB +
AC) * RealType(1.0/3.0);
565 template <
typename RealType>
572 const RealType SP = RealType(0.5) * (
EAB +
EBC +
ECA);
573 const RealType
Area = FMath::Sqrt(FMath::Max(RealType(0.), SP * (SP -
EAB) * (SP -
EBC) * (SP -
ECA)));
583 template<
typename RealType>
591 return (Determinant < 0) ? (RealType)-1 : (RealType)1;
597 template<
typename RealType>
609 template<
typename RealType>
618 template<
typename RealType>
628 double s = (a + b + c) / 2.0;
629 return (a * b * c) / (8.0 * (s - a) * (s - b) * (s - c));
633 template<
typename RealType>
643 template<
typename RealType>
657template<
typename RealType>
660 if (!FMath::IsFinite(
Value))
668 RealType Remainder = (RealType)
fmod(
Value, Increment);
669 if (Remainder > Increment / 2.0)
#define checkSlow(expr)
Definition AssertionMacros.h:332
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
EIntersectionResult
Definition VectorUtil.h:10
EIntersectionType
Definition VectorUtil.h:18
uint32 Offset
Definition VulkanMemory.cpp:4033
Definition MathUtil.h:150
static bool IsFinite(const RealType Value)
Definition MathUtil.h:208
static RealType Sqrt(const RealType Value)
Definition MathUtil.h:342
static RealType Abs(const RealType Value)
Definition MathUtil.h:215
static RealType SignNonZero(const RealType Value)
Definition MathUtil.h:240
TVector< RealType > TransformNormal(const TTransform< RealType > &Transform, const TVector< RealType > &Normal)
Definition VectorUtil.h:634
RealType BitangentSign(const TVector< RealType > &NormalIn, const TVector< RealType > &TangentIn, const TVector< RealType > &BitangentIn)
Definition VectorUtil.h:584
TVector< RealType > BitangentFromTangent(const TVector< RealType > &NormalIn, const TVector< RealType > &TangentIn)
Definition VectorUtil.h:619
double AspectRatio(const FVector3d &v1, const FVector3d &v2, const FVector3d &v3)
Definition VectorUtil.h:625
TVector< RealType > BarycentricCoords(const TVector< RealType > &Point, const TVector< RealType > &V0, const TVector< RealType > &V1, const TVector< RealType > &V2)
Definition VectorUtil.h:371
RealType TriangleRegularity(const TVector< RealType > &A, const TVector< RealType > &B, const TVector< RealType > &C)
Definition VectorUtil.h:566
RealType VectorCot(const TVector< RealType > &V1, const TVector< RealType > &V2)
Definition VectorUtil.h:347
RealType PlaneAngleSignedD(const TVector< RealType > &VFrom, const TVector< RealType > &VTo, const TVector< RealType > &PlaneN)
Definition VectorUtil.h:280
TVector< RealType > UniformSampleTriangleBarycentricCoords(RealType R1, RealType R2)
Definition VectorUtil.h:421
RealType TriSolidAngle(TVector< RealType > A, TVector< RealType > B, TVector< RealType > C, const TVector< RealType > &P)
Definition VectorUtil.h:468
TVector< RealType > Bitangent(const TVector< RealType > &NormalIn, const TVector< RealType > &TangentIn, RealType BitangentSign)
Definition VectorUtil.h:598
RealType VectorTanHalfAngle(const TVector< RealType > &A, const TVector< RealType > &B)
Definition VectorUtil.h:320
bool EpsilonEqual(RealType A, RealType B, RealType Epsilon)
Definition VectorUtil.h:151
RealType PlaneAngleSignedR(const TVector< RealType > &VFrom, const TVector< RealType > &VTo, const TVector< RealType > &PlaneN)
Definition VectorUtil.h:300
RealType SignedArea(const TVector2< RealType > &V0, const TVector2< RealType > &V1, const TVector2< RealType > &V2)
Definition VectorUtil.h:117
TVector< RealType > MakePerpVector(const TVector< RealType > &Normal)
Definition VectorUtil.h:242
int Min3Index(const ValueVecType &Vector3)
Definition VectorUtil.h:180
void MakePerpVectors(const TVector< RealType > &Normal, TVector< RealType > &OutPerp1, TVector< RealType > &OutPerp2)
Definition VectorUtil.h:211
TVector< RealType > UniformSampleTrianglePoint(RealType R1, RealType R2, const TVector< RealType > &A, const TVector< RealType > &B, const TVector< RealType > &C)
Definition VectorUtil.h:435
TVector< RealType > NormalDirection(const TVector< RealType > &V0, const TVector< RealType > &V1, const TVector< RealType > &V2)
Definition VectorUtil.h:83
TVector< RealType > TangentFromBitangent(const TVector< RealType > &NormalIn, const TVector< RealType > &BitangentIn)
Definition VectorUtil.h:610
TVector2< RealType > Circumcenter(TVector2< RealType > A, TVector2< RealType > B, const TVector2< RealType > &C, RealType Epsilon=TMathUtilConstants< RealType >::Epsilon)
Definition VectorUtil.h:539
TVector< RealType > NormalArea(const TVector< RealType > &V0, const TVector< RealType > &V1, const TVector< RealType > &V2, RealType &AreaOut)
Definition VectorUtil.h:139
RealType OpeningAngleD(TVector< RealType > A, TVector< RealType > B, const TVector< RealType > &P)
Definition VectorUtil.h:514
RealType OrientedDihedralAngle(const TVector< RealType > &Normal0, const TVector< RealType > &Normal1, const TVector< RealType > &Edge)
Definition VectorUtil.h:530
bool IsObtuse(const TVector< RealType > &V1, const TVector< RealType > &V2, const TVector< RealType > &V3)
Definition VectorUtil.h:126
TVector< RealType > InverseTransformNormal(const TTransform< RealType > &Transform, const TVector< RealType > &Normal)
Definition VectorUtil.h:644
int Max3Index(const ValueVecType &Vector3)
Definition VectorUtil.h:194
TVector< RealType > TriGradient(TVector< RealType > Vi, TVector< RealType > Vj, TVector< RealType > Vk, RealType fi, RealType fj, RealType fk)
Definition VectorUtil.h:488
RealType SnapToIncrement(RealType Value, RealType Increment, RealType Offset=0)
Definition VectorUtil.h:658
T AngleR(const UE::Math::TVector2< T > &V1, const UE::Math::TVector2< T > &V2)
Definition VectorTypes.h:101
constexpr UE::Math::TVector2< T > PerpCW(const UE::Math::TVector2< T > &V)
Definition VectorTypes.h:26
T AngleD(const UE::Math::TVector2< T > &V1, const UE::Math::TVector2< T > &V2)
Definition VectorTypes.h:92
constexpr T DotPerp(const UE::Math::TVector2< T > &V1, const UE::Math::TVector2< T > &V2)
Definition VectorTypes.h:19
T DistanceSquared(const UE::Math::TVector2< T > &V1, const UE::Math::TVector2< T > &V2)
Definition VectorTypes.h:82
@ Area
Definition FitOrientedBox2.h:17
T Normalize(UE::Math::TVector2< T > &Vector, const T Epsilon=0)
Definition VectorTypes.h:46
Definition AdvancedWidgetsModule.cpp:13
UE_FORCEINLINE_HINT T SquaredLength() const
Definition Vector2D.h:516
T Y
Definition Vector2D.h:52
T X
Definition Vector2D.h:49
T Z
Definition Vector.h:68
T Y
Definition Vector.h:65
UE_FORCEINLINE_HINT TVector< T > Cross(const TVector< T > &V2) const
Definition Vector.h:1535
T X
Definition Vector.h:62
UE_FORCEINLINE_HINT T Dot(const TVector< T > &V) const
Definition Vector.h:1553