瀏覽代碼

rename vars

renamed vars to make more sense with the new option params
marauder2k7 1 年之前
父節點
當前提交
48848f9706
共有 2 個文件被更改,包括 8 次插入8 次删除
  1. 7 7
      Engine/source/ts/tsMeshFit.cpp
  2. 1 1
      Engine/source/ts/tsShapeConstruct.h

+ 7 - 7
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<Point3F>& 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

+ 1 - 1
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