summaryrefslogtreecommitdiff
path: root/thirdparty/bullet/BulletCollision/CollisionShapes/btMiniSDF.h
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/bullet/BulletCollision/CollisionShapes/btMiniSDF.h')
-rw-r--r--thirdparty/bullet/BulletCollision/CollisionShapes/btMiniSDF.h37
1 files changed, 15 insertions, 22 deletions
diff --git a/thirdparty/bullet/BulletCollision/CollisionShapes/btMiniSDF.h b/thirdparty/bullet/BulletCollision/CollisionShapes/btMiniSDF.h
index 3de90e4f8a..b60fd102fd 100644
--- a/thirdparty/bullet/BulletCollision/CollisionShapes/btMiniSDF.h
+++ b/thirdparty/bullet/BulletCollision/CollisionShapes/btMiniSDF.h
@@ -5,7 +5,6 @@
#include "LinearMath/btAabbUtil2.h"
#include "LinearMath/btAlignedObjectArray.h"
-
struct btMultiIndex
{
unsigned int ijk[3];
@@ -25,7 +24,6 @@ struct btAlignedBox3d
{
return m_max;
}
-
bool contains(const btVector3& x) const
{
@@ -33,8 +31,8 @@ struct btAlignedBox3d
}
btAlignedBox3d(const btVector3& mn, const btVector3& mx)
- :m_min(mn),
- m_max(mx)
+ : m_min(mn),
+ m_max(mx)
{
}
@@ -47,39 +45,38 @@ struct btShapeMatrix
{
double m_vec[32];
- inline double& operator[](int i)
+ inline double& operator[](int i)
{
return m_vec[i];
}
- inline const double& operator[](int i) const
+ inline const double& operator[](int i) const
{
return m_vec[i];
}
-
};
struct btShapeGradients
{
- btVector3 m_vec[32];
+ btVector3 m_vec[32];
void topRowsDivide(int row, double denom)
{
- for (int i=0;i<row;i++)
+ for (int i = 0; i < row; i++)
{
m_vec[i] /= denom;
}
}
-
+
void bottomRowsMul(int row, double val)
{
- for (int i=32-row;i<32;i++)
+ for (int i = 32 - row; i < 32; i++)
{
m_vec[i] *= val;
}
}
-
- inline btScalar& operator()(int i, int j)
+
+ inline btScalar& operator()(int i, int j)
{
return m_vec[i][j];
}
@@ -92,7 +89,6 @@ struct btCell32
struct btMiniSDF
{
-
btAlignedBox3d m_domain;
unsigned int m_resolution[3];
btVector3 m_cell_size;
@@ -101,13 +97,12 @@ struct btMiniSDF
std::size_t m_n_fields;
bool m_isValid;
-
btAlignedObjectArray<btAlignedObjectArray<double> > m_nodes;
- btAlignedObjectArray<btAlignedObjectArray<btCell32 > > m_cells;
+ btAlignedObjectArray<btAlignedObjectArray<btCell32> > m_cells;
btAlignedObjectArray<btAlignedObjectArray<unsigned int> > m_cell_map;
btMiniSDF()
- :m_isValid(false)
+ : m_isValid(false)
{
}
bool load(const char* data, int size);
@@ -115,20 +110,18 @@ struct btMiniSDF
{
return m_isValid;
}
- unsigned int multiToSingleIndex(btMultiIndex const & ijk) const;
-
+ unsigned int multiToSingleIndex(btMultiIndex const& ijk) const;
+
btAlignedBox3d subdomain(btMultiIndex const& ijk) const;
btMultiIndex singleToMultiIndex(unsigned int l) const;
btAlignedBox3d subdomain(unsigned int l) const;
-
btShapeMatrix
shape_function_(btVector3 const& xi, btShapeGradients* gradient = 0) const;
bool interpolate(unsigned int field_id, double& dist, btVector3 const& x, btVector3* gradient) const;
};
-
-#endif //MINISDF_H
+#endif //MINISDF_H