More UE 5.4 fixes

This commit is contained in:
Steve Streeting 2024-03-25 12:54:29 +00:00
parent 14913409bf
commit b127811fe0
2 changed files with 16 additions and 2 deletions

View File

@ -12,10 +12,20 @@ bool StevesMathHelpers::OverlapConvex(const FKConvexElem& Convex,
FMTDResult& OutResult) FMTDResult& OutResult)
{ {
const FPhysicsShapeAdapter ShapeAdapter(ShapeRot, Shape); const FPhysicsShapeAdapter ShapeAdapter(ShapeRot, Shape);
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
const Chaos::FConvexPtr& ChaosConvex = Convex.GetChaosConvexMesh();
#else
const TSharedPtr<Chaos::FConvex, ESPMode::ThreadSafe>& ChaosConvex = Convex.GetChaosConvexMesh(); const TSharedPtr<Chaos::FConvex, ESPMode::ThreadSafe>& ChaosConvex = Convex.GetChaosConvexMesh();
#endif
if (!ChaosConvex.IsValid()) if (!ChaosConvex.IsValid())
return false; return false;
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
const auto& ChaosConvexObj = *ChaosConvex.GetReference();
#else
const auto& ChaosConvexObj = *ChaosConvex.Get();
#endif
const Chaos::FImplicitObject& ShapeGeom = ShapeAdapter.GetGeometry(); const Chaos::FImplicitObject& ShapeGeom = ShapeAdapter.GetGeometry();
const FTransform& ShapeGeomTransform = ShapeAdapter.GetGeomPose(ShapePos); const FTransform& ShapeGeomTransform = ShapeAdapter.GetGeomPose(ShapePos);
@ -28,7 +38,7 @@ bool StevesMathHelpers::OverlapConvex(const FKConvexElem& Convex,
ShapeGeomTransform, ShapeGeomTransform,
[&](const auto& Downcast, const auto& FullGeomTransform) [&](const auto& Downcast, const auto& FullGeomTransform)
{ {
return Chaos::OverlapQuery(*ChaosConvex.Get(), return Chaos::OverlapQuery(ChaosConvexObj,
ConvexTransform, ConvexTransform,
Downcast, Downcast,
FullGeomTransform, FullGeomTransform,

View File

@ -21,7 +21,11 @@ void FStevesVisualLogger::InternalPolyLogfImpl(const UObject* Object,
} }
// EVisualLoggerShapeElement::Path doesn't support a label, so description is always blank // EVisualLoggerShapeElement::Path doesn't support a label, so description is always blank
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 4
CurrentEntry->AddPath(Points, CategoryName, Verbosity, Color, "", Thickness);
#else
CurrentEntry->AddElement(Points, CategoryName, Verbosity, Color, "", Thickness); CurrentEntry->AddElement(Points, CategoryName, Verbosity, Color, "", Thickness);
#endif
#endif #endif
} }