4 #include "LinearMath/btVector3.h"
5 #include "LinearMath/btAabbUtil2.h"
6 #include "LinearMath/btAlignedObjectArray.h"
18 const btVector3& min() const
23 const btVector3& max() const
28 bool contains(const btVector3& x) const
30 return TestPointAgainstAabb2(m_min, m_max, x);
33 btAlignedBox3d(const btVector3& mn, const btVector3& mx)
48 inline double& operator[](int i)
53 inline const double& operator[](int i) const
59 struct btShapeGradients
63 void topRowsDivide(int row, double denom)
65 for (int i = 0; i < row; i++)
71 void bottomRowsMul(int row, double val)
73 for (int i = 32 - row; i < 32; i++)
79 inline btScalar& operator()(int i, int j)
87 unsigned int m_cells[32];
92 btAlignedBox3d m_domain;
93 unsigned int m_resolution[3];
94 btVector3 m_cell_size;
95 btVector3 m_inv_cell_size;
96 std::size_t m_n_cells;
97 std::size_t m_n_fields;
100 btAlignedObjectArray<btAlignedObjectArray<double> > m_nodes;
101 btAlignedObjectArray<btAlignedObjectArray<btCell32> > m_cells;
102 btAlignedObjectArray<btAlignedObjectArray<unsigned int> > m_cell_map;
108 bool load(const char* data, int size);
113 unsigned int multiToSingleIndex(btMultiIndex const& ijk) const;
115 btAlignedBox3d subdomain(btMultiIndex const& ijk) const;
117 btMultiIndex singleToMultiIndex(unsigned int l) const;
119 btAlignedBox3d subdomain(unsigned int l) const;
122 shape_function_(btVector3 const& xi, btShapeGradients* gradient = 0) const;
124 bool interpolate(unsigned int field_id, double& dist, btVector3 const& x, btVector3* gradient) const;