diff options
author | Sebastián Barschkis <sebbas@sebbas.org> | 2021-02-05 18:24:03 +0300 |
---|---|---|
committer | Sebastián Barschkis <sebbas@sebbas.org> | 2021-02-05 18:24:03 +0300 |
commit | e8a5744cdab0df49fe9e86170b776c3708c20b00 (patch) | |
tree | 0e12a08afac4b610ec4f864bf32b2d52ddf2d963 /extern/mantaflow/preprocessed/grid.h | |
parent | 66923031e6f21fcd2e67f2928659e6d0261d3c2a (diff) | |
parent | a5637756491ca1b9baa544ad86f74627f6333d04 (diff) |
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'extern/mantaflow/preprocessed/grid.h')
-rw-r--r-- | extern/mantaflow/preprocessed/grid.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/extern/mantaflow/preprocessed/grid.h b/extern/mantaflow/preprocessed/grid.h index 3d6f8558b8f..9c3d954771e 100644 --- a/extern/mantaflow/preprocessed/grid.h +++ b/extern/mantaflow/preprocessed/grid.h @@ -204,14 +204,12 @@ class GridBase : public PbClass { inline void checkIndex(int i, int j, int k) const; //! Check if indices are within bounds, otherwise error (should only be called when debugging) inline void checkIndex(IndexInt idx) const; - //! Check if index is within given boundaries - inline bool isInBounds(const Vec3i &p, int bnd) const; - //! Check if index is within given boundaries - inline bool isInBounds(const Vec3i &p) const; - //! Check if index is within given boundaries + //! Check if vector int is within given boundaries + inline bool isInBounds(const Vec3i &p, int bnd = 0) const; + //! Check if vector real is within given boundaries inline bool isInBounds(const Vec3 &p, int bnd = 0) const { - return isInBounds(toVec3i(p), bnd); + return isInBounds(toVec3iFloor(p), bnd); } //! Check if linear index is in the range of the array inline bool isInBounds(IndexInt idx) const; @@ -1785,11 +1783,6 @@ inline void GridBase::checkIndex(IndexInt idx) const } } -bool GridBase::isInBounds(const Vec3i &p) const -{ - return (p.x >= 0 && p.y >= 0 && p.z >= 0 && p.x < mSize.x && p.y < mSize.y && p.z < mSize.z); -} - bool GridBase::isInBounds(const Vec3i &p, int bnd) const { bool ret = (p.x >= bnd && p.y >= bnd && p.x < mSize.x - bnd && p.y < mSize.y - bnd); |