From 48848f970621c97a2e6f8f9f7848c96f1542d5ea Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Thu, 16 May 2024 03:39:18 +0100 Subject: [PATCH] rename vars renamed vars to make more sense with the new option params --- Engine/source/ts/tsMeshFit.cpp | 14 +++++++------- Engine/source/ts/tsShapeConstruct.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Engine/source/ts/tsMeshFit.cpp b/Engine/source/ts/tsMeshFit.cpp index bd7fbee0f..f5623dc96 100644 --- a/Engine/source/ts/tsMeshFit.cpp +++ b/Engine/source/ts/tsMeshFit.cpp @@ -183,7 +183,7 @@ public: void fit26_DOP(); // Convex Hulls - void fitConvexHulls( U32 depth, F32 mergeThreshold, U32 concavityThreshold, U32 maxHullVerts, + void fitConvexHulls( U32 depth, F32 minPercentage, U32 maxHulls, U32 maxHullVerts, F32 boxMaxError, F32 sphereMaxError, F32 capsuleMaxError ); }; @@ -691,7 +691,7 @@ void MeshFit::fitK_DOP( const Vector& planes ) //--------------------------- // Best-fit set of convex hulls -void MeshFit::fitConvexHulls( U32 depth, F32 mergeThreshold, U32 concavityThreshold, U32 maxHullVerts, +void MeshFit::fitConvexHulls( U32 depth, F32 minPercentage, U32 maxHulls, U32 maxHullVerts, F32 boxMaxError, F32 sphereMaxError, F32 capsuleMaxError ) { VHACD::IVHACD::Parameters p; @@ -699,9 +699,9 @@ void MeshFit::fitConvexHulls( U32 depth, F32 mergeThreshold, U32 concavityThres p.m_maxNumVerticesPerCH = maxHullVerts; p.m_shrinkWrap = true; p.m_maxRecursionDepth = depth; - p.m_minimumVolumePercentErrorAllowed = mergeThreshold; + p.m_minimumVolumePercentErrorAllowed = minPercentage; p.m_resolution = 10000; - p.m_maxConvexHulls = concavityThreshold; + p.m_maxConvexHulls = maxHulls; VHACD::IVHACD* iface = VHACD::CreateVHACD_ASYNC(); @@ -929,8 +929,8 @@ DefineTSShapeConstructorMethod( addPrimitive, bool, ( const char* meshName, cons return true; }} -DefineTSShapeConstructorMethod( addCollisionDetail, bool, ( S32 size, const char* type, const char* target, S32 depth, F32 merge, S32 maxHulls, S32 maxVerts, F32 boxMaxError, F32 sphereMaxError, F32 capsuleMaxError ), ( 4, 30, 30, 32, 0, 0, 0 ), - ( size, type, target, depth, merge, maxHulls, maxVerts, boxMaxError, sphereMaxError, capsuleMaxError ), false, +DefineTSShapeConstructorMethod( addCollisionDetail, bool, ( S32 size, const char* type, const char* target, S32 depth, F32 minPercentage, S32 maxHulls, S32 maxVerts, F32 boxMaxError, F32 sphereMaxError, F32 capsuleMaxError ), ( 4, 30, 30, 32, 0, 0, 0 ), + ( size, type, target, depth, minPercentage, maxHulls, maxVerts, boxMaxError, sphereMaxError, capsuleMaxError ), false, "Autofit a mesh primitive or set of convex hulls to the shape geometry. Hulls " "may optionally be converted to boxes, spheres and/or capsules based on their " "volume.\n" @@ -984,7 +984,7 @@ DefineTSShapeConstructorMethod( addCollisionDetail, bool, ( S32 size, const char fit.fit26_DOP(); else if ( !dStricmp( type, "convex hulls" ) ) { - fit.fitConvexHulls( depth, merge, maxHulls, maxVerts, + fit.fitConvexHulls( depth, minPercentage, maxHulls, maxVerts, boxMaxError, sphereMaxError, capsuleMaxError ); } else diff --git a/Engine/source/ts/tsShapeConstruct.h b/Engine/source/ts/tsShapeConstruct.h index 497141ec1..f4c9d3efd 100644 --- a/Engine/source/ts/tsShapeConstruct.h +++ b/Engine/source/ts/tsShapeConstruct.h @@ -315,7 +315,7 @@ public: const char* getImposterSettings(S32 index); S32 addImposter(S32 size, S32 equatorSteps, S32 polarSteps, S32 dl, S32 dim, bool includePoles, F32 polarAngle); bool removeImposter(); - bool addCollisionDetail(S32 size, const char* type, const char* target, S32 depth = 4, F32 merge = 30.0f, S32 maxHull = 30, S32 maxVerts = 32, F32 boxMaxError = 0, F32 sphereMaxError = 0, F32 capsuleMaxError = 0); + bool addCollisionDetail(S32 size, const char* type, const char* target, S32 depth = 4, F32 minPercentage = 10.0f, S32 maxHull = 30, S32 maxVerts = 32, F32 boxMaxError = 0, F32 sphereMaxError = 0, F32 capsuleMaxError = 0); ///@} /// @name Sequences