initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled

This commit is contained in:
2025-09-16 20:46:46 -04:00
commit 9d30169a8d
13378 changed files with 7050105 additions and 0 deletions

View File

@@ -0,0 +1,177 @@
diff --git a/thirdparty/vhacd/inc/btAlignedAllocator.h b/thirdparty/vhacd/inc/btAlignedAllocator.h
index 11f6e12dca..8011595d89 100644
--- a/thirdparty/vhacd/inc/btAlignedAllocator.h
+++ b/thirdparty/vhacd/inc/btAlignedAllocator.h
@@ -21,6 +21,9 @@ subject to the following restrictions:
///that is better portable and more predictable
#include "btScalar.h"
+
+namespace VHACD {
+
//#define BT_DEBUG_MEMORY_ALLOCATIONS 1
#ifdef BT_DEBUG_MEMORY_ALLOCATIONS
@@ -101,4 +104,6 @@ public:
friend bool operator==(const self_type&, const self_type&) { return true; }
};
+}; // namespace VHACD
+
#endif //BT_ALIGNED_ALLOCATOR
diff --git a/thirdparty/vhacd/inc/btAlignedObjectArray.h b/thirdparty/vhacd/inc/btAlignedObjectArray.h
index e6620adf6f..7446a8bfd9 100644
--- a/thirdparty/vhacd/inc/btAlignedObjectArray.h
+++ b/thirdparty/vhacd/inc/btAlignedObjectArray.h
@@ -38,6 +38,8 @@ subject to the following restrictions:
#include <new> //for placement new
#endif //BT_USE_PLACEMENT_NEW
+namespace VHACD {
+
///The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods
///It is developed to replace stl::vector to avoid portability issues, including STL alignment issues to add SIMD/SSE data
template <typename T>
@@ -445,4 +447,6 @@ public:
}
};
+}; // namespace VHACD
+
#endif //BT_OBJECT_ARRAY__
diff --git a/thirdparty/vhacd/inc/btConvexHullComputer.h b/thirdparty/vhacd/inc/btConvexHullComputer.h
index 3c5075c2cb..194917cdec 100644
--- a/thirdparty/vhacd/inc/btConvexHullComputer.h
+++ b/thirdparty/vhacd/inc/btConvexHullComputer.h
@@ -18,6 +18,8 @@ subject to the following restrictions:
#include "btAlignedObjectArray.h"
#include "btVector3.h"
+namespace VHACD {
+
/// Convex hull implementation based on Preparata and Hong
/// See http://code.google.com/p/bullet/issues/detail?id=275
/// Ole Kniemeyer, MAXON Computer GmbH
@@ -94,4 +96,6 @@ public:
}
};
+}; // namespace VHACD
+
#endif //BT_CONVEX_HULL_COMPUTER_H
diff --git a/thirdparty/vhacd/inc/btMinMax.h b/thirdparty/vhacd/inc/btMinMax.h
index 40b0ceb6ed..12aaeda9c4 100644
--- a/thirdparty/vhacd/inc/btMinMax.h
+++ b/thirdparty/vhacd/inc/btMinMax.h
@@ -17,6 +17,8 @@ subject to the following restrictions:
#include "btScalar.h"
+namespace VHACD {
+
template <class T>
SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b)
{
@@ -62,4 +64,6 @@ SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub)
}
}
+}; // namespace VHACD
+
#endif //BT_GEN_MINMAX_H
diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h
index b814474bdf..404bcbcfe1 100644
--- a/thirdparty/vhacd/inc/btScalar.h
+++ b/thirdparty/vhacd/inc/btScalar.h
@@ -28,11 +28,15 @@ subject to the following restrictions:
/* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/
#define BT_BULLET_VERSION 279
+namespace VHACD {
+
inline int32_t btGetVersion()
{
return BT_BULLET_VERSION;
}
+}; // namespace VHACD
+
#if defined(DEBUG) || defined(_DEBUG)
#define BT_DEBUG
#endif
@@ -199,6 +203,8 @@ inline int32_t btGetVersion()
#endif //__CELLOS_LV2__
#endif
+namespace VHACD {
+
///The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.
#if defined(BT_USE_DOUBLE_PRECISION)
typedef double btScalar;
@@ -530,4 +536,7 @@ struct btTypedObject {
return m_objectType;
}
};
+
+}; // namespace VHACD
+
#endif //BT_SCALAR_H
diff --git a/thirdparty/vhacd/inc/btVector3.h b/thirdparty/vhacd/inc/btVector3.h
index 0f2fefbbd5..356a6a9cfc 100644
--- a/thirdparty/vhacd/inc/btVector3.h
+++ b/thirdparty/vhacd/inc/btVector3.h
@@ -26,6 +26,8 @@ subject to the following restrictions:
#define btVector3DataName "btVector3FloatData"
#endif //BT_USE_DOUBLE_PRECISION
+namespace VHACD {
+
/**@brief btVector3 can be used to represent 3D points and vectors.
* It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user
* Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers
@@ -712,4 +714,6 @@ SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3Data& dataIn
m_floats[i] = dataIn.m_floats[i];
}
+}; // namespace VHACD
+
#endif //BT_VECTOR3_H
diff --git a/thirdparty/vhacd/src/btAlignedAllocator.cpp b/thirdparty/vhacd/src/btAlignedAllocator.cpp
index 11d594f6c9..bbb8baa107 100644
--- a/thirdparty/vhacd/src/btAlignedAllocator.cpp
+++ b/thirdparty/vhacd/src/btAlignedAllocator.cpp
@@ -15,6 +15,8 @@ subject to the following restrictions:
#include "btAlignedAllocator.h"
+namespace VHACD {
+
#ifdef _MSC_VER
#pragma warning(disable:4311 4302)
#endif
@@ -177,4 +179,6 @@ void btAlignedFreeInternal(void* ptr)
sAlignedFreeFunc(ptr);
}
+}; // namespace VHACD
+
#endif //BT_DEBUG_MEMORY_ALLOCATIONS
diff --git a/thirdparty/vhacd/src/btConvexHullComputer.cpp b/thirdparty/vhacd/src/btConvexHullComputer.cpp
index d3d749adbe..4f224c8360 100644
--- a/thirdparty/vhacd/src/btConvexHullComputer.cpp
+++ b/thirdparty/vhacd/src/btConvexHullComputer.cpp
@@ -49,6 +49,8 @@ typedef unsigned long long int32_t uint64_t;
#include <stdio.h>
#endif
+namespace VHACD {
+
// Convex hull implementation based on Preparata and Hong
// Ole Kniemeyer, MAXON Computer GmbH
class btConvexHullInternal {
@@ -2477,3 +2479,5 @@ btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, in
return shift;
}
+
+}; // namespace VHACD

View File

@@ -0,0 +1,49 @@
diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h
index 404bcbcfe1..db00a3c428 100644
--- a/thirdparty/vhacd/inc/btScalar.h
+++ b/thirdparty/vhacd/inc/btScalar.h
@@ -537,6 +537,27 @@ struct btTypedObject {
}
};
+// Cherry-picked from Bullet 2.88 to fix GH-27926
+///align a pointer to the provided alignment, upwards
+template <typename T>
+T *btAlignPointer(T *unalignedPtr, size_t alignment)
+{
+ struct btConvertPointerSizeT
+ {
+ union {
+ T *ptr;
+ size_t integer;
+ };
+ };
+ btConvertPointerSizeT converter;
+
+ const size_t bit_mask = ~(alignment - 1);
+ converter.ptr = unalignedPtr;
+ converter.integer += alignment - 1;
+ converter.integer &= bit_mask;
+ return converter.ptr;
+}
+
}; // namespace VHACD
#endif //BT_SCALAR_H
diff --git a/thirdparty/vhacd/src/btAlignedAllocator.cpp b/thirdparty/vhacd/src/btAlignedAllocator.cpp
index bbb8baa107..4d7f4b1b2f 100644
--- a/thirdparty/vhacd/src/btAlignedAllocator.cpp
+++ b/thirdparty/vhacd/src/btAlignedAllocator.cpp
@@ -70,8 +70,10 @@ static inline void* btAlignedAllocDefault(size_t size, int32_t alignment)
real = (char*)sAllocFunc(size + sizeof(void*) + (alignment - 1));
if (real) {
- offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1);
- ret = (void*)((real + sizeof(void*)) + offset);
+ // Synced with Bullet 2.88 to fix GH-27926
+ //offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1);
+ //ret = (void*)((real + sizeof(void*)) + offset);
+ ret = btAlignPointer(real + sizeof(void *), alignment);
*((void**)(ret)-1) = (void*)(real);
}
else {

View File

@@ -0,0 +1,13 @@
diff --git a/thirdparty/vhacd/inc/vhacdMutex.h b/thirdparty/vhacd/inc/vhacdMutex.h
index 6b09259200..22acc2135a 100644
--- a/thirdparty/vhacd/inc/vhacdMutex.h
+++ b/thirdparty/vhacd/inc/vhacdMutex.h
@@ -71,7 +71,7 @@
#include <pthread.h>
#endif
-#if defined(__APPLE__)
+#if defined(__APPLE__) || !defined(__GLIBC__)
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif

View File

@@ -0,0 +1,14 @@
diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h
index db00a3c428..ef8546a4b5 100644
--- a/thirdparty/vhacd/inc/btScalar.h
+++ b/thirdparty/vhacd/inc/btScalar.h
@@ -68,7 +68,8 @@ inline int32_t btGetVersion()
#define btFsel(a, b, c) __fsel((a), (b), (c))
#else
-#if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION))
+//#if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION))
+#if (defined(_WIN32) && (_MSC_VER) && _MSC_VER >= 1400) && (!defined(BT_USE_DOUBLE_PRECISION)) && (!defined(_M_ARM)) && (!defined(_M_ARM64))
#define BT_USE_SSE
#include <emmintrin.h>
#endif

View File

@@ -0,0 +1,20 @@
diff --git a/thirdparty/vhacd/inc/vhacdVolume.h b/thirdparty/vhacd/inc/vhacdVolume.h
index 8c47fa1e2c..c445f20122 100644
--- a/thirdparty/vhacd/inc/vhacdVolume.h
+++ b/thirdparty/vhacd/inc/vhacdVolume.h
@@ -316,13 +316,13 @@ void Volume::Voxelize(const T* const points, const uint32_t stridePoints, const
double d[3] = { m_maxBB[0] - m_minBB[0], m_maxBB[1] - m_minBB[1], m_maxBB[2] - m_minBB[2] };
double r;
- if (d[0] > d[1] && d[0] > d[2]) {
+ if (d[0] >= d[1] && d[0] >= d[2]) {
r = d[0];
m_dim[0] = dim;
m_dim[1] = 2 + static_cast<size_t>(dim * d[1] / d[0]);
m_dim[2] = 2 + static_cast<size_t>(dim * d[2] / d[0]);
}
- else if (d[1] > d[0] && d[1] > d[2]) {
+ else if (d[1] >= d[0] && d[1] >= d[2]) {
r = d[1];
m_dim[1] = dim;
m_dim[0] = 2 + static_cast<size_t>(dim * d[0] / d[1]);

View File

@@ -0,0 +1,27 @@
diff --git a/thirdparty/vhacd/inc/vhacdICHull.h b/thirdparty/vhacd/inc/vhacdICHull.h
index 132bdcfb3e..4075a9e054 100644
--- a/thirdparty/vhacd/inc/vhacdICHull.h
+++ b/thirdparty/vhacd/inc/vhacdICHull.h
@@ -18,6 +18,8 @@
#include "vhacdManifoldMesh.h"
#include "vhacdVector.h"
+#include <cstdint>
+
namespace VHACD {
//! Incremental Convex Hull algorithm (cf. http://cs.smith.edu/~orourke/books/ftp.html ).
enum ICHullError {
diff --git a/thirdparty/vhacd/inc/vhacdManifoldMesh.h b/thirdparty/vhacd/inc/vhacdManifoldMesh.h
index a48f53c5c5..3f9d039470 100644
--- a/thirdparty/vhacd/inc/vhacdManifoldMesh.h
+++ b/thirdparty/vhacd/inc/vhacdManifoldMesh.h
@@ -18,6 +18,9 @@ All rights reserved.
#include "vhacdCircularList.h"
#include "vhacdSArray.h"
#include "vhacdVector.h"
+
+#include <cstdint>
+
namespace VHACD {
class TMMTriangle;
class TMMEdge;