diff options
Diffstat (limited to 'NvCloth/extensions/src')
| -rw-r--r-- | NvCloth/extensions/src/ClothFabricCooker.cpp | 15 | ||||
| -rw-r--r-- | NvCloth/extensions/src/ClothGeodesicTetherCooker.cpp | 6 |
2 files changed, 7 insertions, 14 deletions
diff --git a/NvCloth/extensions/src/ClothFabricCooker.cpp b/NvCloth/extensions/src/ClothFabricCooker.cpp index 2d800e9..c6d0103 100644 --- a/NvCloth/extensions/src/ClothFabricCooker.cpp +++ b/NvCloth/extensions/src/ClothFabricCooker.cpp @@ -30,24 +30,17 @@ #include "foundation/PxVec4.h" #include "foundation/PxIO.h" #include "foundation/PxStrideIterator.h" +#include "PsSort.h" +#include "PsMathUtils.h" + #include "NvClothExt/ClothFabricCooker.h" #include "NvClothExt/ClothTetherCooker.h" -#include "PsSort.h" #include "NvCloth/Fabric.h" #include "NvCloth/Allocator.h" #include "NvCloth/Range.h" +#include "ClothClone.h" #include <algorithm> -#include "PsMathUtils.h" - -namespace -{ -float safeLog2(float x) -{ - float saturated = std::max(0.0f, std::min(x, 1.0f)); - return saturated ? physx::shdfnd::log2(saturated) : -FLT_MAX_EXP; -} -} using namespace physx; diff --git a/NvCloth/extensions/src/ClothGeodesicTetherCooker.cpp b/NvCloth/extensions/src/ClothGeodesicTetherCooker.cpp index 0a27337..65e2a3f 100644 --- a/NvCloth/extensions/src/ClothGeodesicTetherCooker.cpp +++ b/NvCloth/extensions/src/ClothGeodesicTetherCooker.cpp @@ -285,7 +285,7 @@ namespace // point on ray R = o + t * d // for this two points to intersect, we have // |AB -d| | s t | = o - A - const float eps = 1e-4; + const float eps = 1e-4f; PxVec3 OA = O - A; PxVec3 AB = B - A; @@ -765,7 +765,7 @@ int ClothGeodesicTetherCooker::computeVertexIntersection(PxU32 parent, PxU32 src continue; // t should be positive, otherwise we just hit the triangle in opposite direction, so ignore - const float eps = 1e-5; + const float eps = 1e-5f; if (t > -eps) { PxVec3 ip; // intersection point @@ -884,7 +884,7 @@ int ClothGeodesicTetherCooker::computeEdgeIntersection(PxU32 parent, PxU32 edge, g = (g - g.dot(n) * n).getNormalized(); float s = 0.0f, t = 0.0f; - const float eps = 1e-5; + const float eps = 1e-5f; PxVec3 ip; // intersect against edge form p2 to p0 |