12template<
class T,
int d>
27 , MPlaneConcrete(
Other.MPlaneConcrete)
52 return MPlaneConcrete.SignedDistance(x);
60 return MPlaneConcrete.PhiWithNormal(x,
Normal);
65 return MPlaneConcrete.FindClosestPoint(x,Thickness);
70 return MPlaneConcrete.Raycast(StartPoint,Dir,
Length,Thickness,OutTime,OutPosition,OutNormal,OutFaceIndex);
75 return MPlaneConcrete.FindClosestIntersection(StartPoint,EndPoint,Thickness);
85 MPlaneConcrete.Serialize(Ar);
101 return MPlaneConcrete.GetTypeHash();
110template<
typename T,
int d>
129template<
typename T,
int d>
160template<
typename T,
int d>
167template<
typename T,
int d>
168TVector<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)
170 const T Epsilon = 1e-4f;
174 if (Bary[0] >= -Epsilon && Bary[0] <= 1 + Epsilon && Bary[1] >= -Epsilon && Bary[1] <= 1 + Epsilon && (Bary[0] + Bary[1]) <= (1 + Epsilon))
211template<
typename T,
int d>
212TVector<T, d> FindClosestPointOnTriangle(
const TPlane<T, d>&
TrianglePlane,
const TVector<T, d>& P0,
const TVector<T, d>& P1,
const TVector<T, d>& P2,
const TVector<T, d>& P)
219template<
typename T,
int d>
220TVector<T, d> FindClosestPointAndBaryOnTriangle(
const TVector<T, d>& P0,
const TVector<T, d>& P1,
const TVector<T, d>& P2,
const TVector<T, d>& P,
TVector<T, 3>& Bary)
239 Bary.X = 1.f - Bary.Y;
248 Bary.X = 1.f - Bary.Z;
259 Bary.Y = 1.f - Bary.Z;
272 Bary.Y = Bary.Z = (T)0.;
313 constexpr T Epsilon = (T)1e-4;
384 Bary.X = (T)1. - Bary.Y - Bary.Z;
385 const TVector<T,d> Result = Bary.X * P0 + Bary.Y * P1 + Bary.Z * P2;
389template<
typename T,
int d>
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_DOUBLE_SMALL_NUMBER
Definition UnrealMathUtility.h:139
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition ChaosArchive.h:364
Definition ChaosArchive.h:167
Definition ImplicitObject.h:111
virtual FName GetTypeName() const
Definition ImplicitObject.h:414
CHAOS_API void SerializeImp(FArchive &Ar)
Definition ImplicitObject.cpp:337
Definition CorePlane.h:12
virtual FReal GetRadius() const override
Definition Plane.h:42
TVector< T, d > FindClosestPoint(const TVector< T, d > &x, const T Thickness=(T) 0) const
Definition Plane.h:63
virtual uint32 GetTypeHash() const override
Definition Plane.h:99
virtual void Serialize(FChaosArchive &Ar) override
Definition Plane.h:88
virtual Pair< FVec3, bool > FindClosestIntersectionImp(const FVec3 &StartPoint, const FVec3 &EndPoint, const FReal Thickness) const override
Definition Plane.h:73
TPlane(const TVector< T, d > &InX, const TVector< T, d > &InNormal)
Definition Plane.h:20
virtual ~TPlane()
Definition Plane.h:35
const TVector< T, d > & Normal(const TVector< T, d > &) const
Definition Plane.h:80
virtual FName GetTypeName() const
Definition ImplicitObject.h:414
T SignedDistance(const TVector< T, d > &x) const
Definition Plane.h:50
virtual void Serialize(FArchive &Ar) override
Definition Plane.h:94
const TPlaneConcrete< T > & PlaneConcrete() const
Definition Plane.h:104
TPlane(TPlane< T, d > &&Other)
Definition Plane.h:30
virtual FReal PhiWithNormal(const FVec3 &x, FVec3 &Normal) const override
Definition Plane.h:58
const TVector< T, d > & Normal() const
Definition Plane.h:79
TPlane(const TPlane< T, d > &Other)
Definition Plane.h:25
static constexpr EImplicitObjectType StaticType()
Definition Plane.h:37
FORCEINLINE void SerializeImp(FArchive &Ar)
Definition Plane.h:82
TPlane()
Definition Plane.h:19
virtual bool Raycast(const FVec3 &StartPoint, const FVec3 &Dir, const FReal Length, const FReal Thickness, FReal &OutTime, FVec3 &OutPosition, FVec3 &OutNormal, int32 &OutFaceIndex) const override
Definition Plane.h:68
const TVector< T, d > & X() const
Definition Plane.h:78
Definition Archive.h:1208
@ Plane
Definition ImplicitObjectType.h:15
Definition SkeletalMeshComponent.h:307
uint8 EImplicitObjectType
Definition ImplicitObjectType.h:41
const TVector< T, d > FindClosestPointAndAlphaOnLineSegment(const TVector< T, d > &P0, const TVector< T, d > &P1, const TVector< T, d > &P, T &OutAlpha)
Definition Plane.h:130
FRealDouble FReal
Definition Real.h:22
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
TVector< T, d > FindClosestPointAndBaryOnTriangle(const TVector< T, d > &P0, const TVector< T, d > &P1, const TVector< T, d > &P2, const TVector< T, d > &P, TVector< T, 3 > &Bary)
Definition Plane.h:220
const TVector< T, d > FindClosestPointOnLineSegment(const TVector< T, d > &P0, const TVector< T, d > &P1, const TVector< T, d > &P)
Definition Plane.h:161
bool IntersectPlanes2(TVector< T, d > &I, TVector< T, d > &D, const TPlane< T, d > &P1, const TPlane< T, d > &P2)
Definition Plane.h:390
TVector< T, 2 > ComputeBarycentricInPlane(const TVector< T, d > &P0, const TVector< T, d > &P1, const TVector< T, d > &P2, const TVector< T, d > &P)
Definition Plane.h:111
static bool IntersectPlanes2(UE::Math::TVector< FReal > &I, UE::Math::TVector< FReal > &D, const UE::Math::TPlane< FReal > &P1, const UE::Math::TPlane< FReal > &P2)
static constexpr UE_FORCEINLINE_HINT T Clamp(const T X, const T MinValue, const T MaxValue)
Definition UnrealMathUtility.h:592