summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-03-09 21:15:53 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-03-09 21:45:47 +0100
commit3d7f1555865a981b7144becfc58d3f3f34362f5f (patch)
treed92912c6d700468b3330148b9179026b9f4efcb4 /thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp
parent33c907f9f5b3ec1a43d0251d7cac80da49b5b658 (diff)
Remove unused Bullet module and thirdparty code
It has been disabled in `master` since one year (#45852) and our plan is for Bullet, and possibly other thirdparty physics engines, to be implemented via GDExtension so that they can be selected by the users who need them.
Diffstat (limited to 'thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp')
-rw-r--r--thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp95
1 files changed, 0 insertions, 95 deletions
diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp b/thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp
deleted file mode 100644
index 23c95ad3ff..0000000000
--- a/thirdparty/bullet/BulletCollision/CollisionShapes/btSdfCollisionShape.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-#include "btSdfCollisionShape.h"
-#include "btMiniSDF.h"
-#include "LinearMath/btAabbUtil2.h"
-
-ATTRIBUTE_ALIGNED16(struct)
-btSdfCollisionShapeInternalData
-{
- BT_DECLARE_ALIGNED_ALLOCATOR();
-
- btVector3 m_localScaling;
- btScalar m_margin;
- btMiniSDF m_sdf;
-
- btSdfCollisionShapeInternalData()
- : m_localScaling(1, 1, 1),
- m_margin(0)
- {
- }
-};
-
-bool btSdfCollisionShape::initializeSDF(const char* sdfData, int sizeInBytes)
-{
- bool valid = m_data->m_sdf.load(sdfData, sizeInBytes);
- return valid;
-}
-btSdfCollisionShape::btSdfCollisionShape()
-{
- m_shapeType = SDF_SHAPE_PROXYTYPE;
- m_data = new btSdfCollisionShapeInternalData();
-
- //"E:/develop/bullet3/data/toys/ground_hole64_64_8.cdf");//ground_cube.cdf");
- /*unsigned int field_id=0;
- Eigen::Vector3d x (1,10,1);
- Eigen::Vector3d gradient;
- double dist = m_data->m_sdf.interpolate(field_id, x, &gradient);
- printf("dist=%g\n", dist);
- */
-}
-btSdfCollisionShape::~btSdfCollisionShape()
-{
- delete m_data;
-}
-
-void btSdfCollisionShape::getAabb(const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const
-{
- btAssert(m_data->m_sdf.isValid());
- btVector3 localAabbMin = m_data->m_sdf.m_domain.m_min;
- btVector3 localAabbMax = m_data->m_sdf.m_domain.m_max;
- btScalar margin(0);
- btTransformAabb(localAabbMin, localAabbMax, margin, t, aabbMin, aabbMax);
-}
-
-void btSdfCollisionShape::setLocalScaling(const btVector3& scaling)
-{
- m_data->m_localScaling = scaling;
-}
-const btVector3& btSdfCollisionShape::getLocalScaling() const
-{
- return m_data->m_localScaling;
-}
-void btSdfCollisionShape::calculateLocalInertia(btScalar mass, btVector3& inertia) const
-{
- inertia.setValue(0, 0, 0);
-}
-const char* btSdfCollisionShape::getName() const
-{
- return "btSdfCollisionShape";
-}
-void btSdfCollisionShape::setMargin(btScalar margin)
-{
- m_data->m_margin = margin;
-}
-btScalar btSdfCollisionShape::getMargin() const
-{
- return m_data->m_margin;
-}
-
-void btSdfCollisionShape::processAllTriangles(btTriangleCallback* callback, const btVector3& aabbMin, const btVector3& aabbMax) const
-{
- //not yet
-}
-
-bool btSdfCollisionShape::queryPoint(const btVector3& ptInSDF, btScalar& distOut, btVector3& normal)
-{
- int field = 0;
- btVector3 grad;
- double dist;
- bool hasResult = m_data->m_sdf.interpolate(field, dist, ptInSDF, &grad);
- if (hasResult)
- {
- normal.setValue(grad[0], grad[1], grad[2]);
- distOut = dist;
- }
- return hasResult;
-}