diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-02 19:37:01 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-02 19:37:01 +0300 |
commit | 5f8969bb4b43afd20cfe859ad5f00c3cdd28bcf1 (patch) | |
tree | d9601691f3167bf9714766bcc0cc4e3cf7d041d7 /source/blender/nodes/geometry/nodes/node_geo_raycast.cc | |
parent | a1609340b436ff58e7e3522cc5e6d3ad1506b3ed (diff) |
Cleanup: Use const mesh to ensure BVH and triangulation cache
As noted in a comment now, these functions only update a cache, so they
don't change the logical state of the mesh, which is "it will have the
data when necessary." Using a const argument will help const correctness
when accessing an object's evaluated mesh.
Diffstat (limited to 'source/blender/nodes/geometry/nodes/node_geo_raycast.cc')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_raycast.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc index bfd6027e0fc..0c1d8645411 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc @@ -95,7 +95,7 @@ static void raycast_to_mesh(const Mesh *mesh, BLI_assert(ray_origins.size() == r_hit_distances.size() || r_hit_distances.is_empty()); BVHTreeFromMesh tree_data; - BKE_bvhtree_from_mesh_get(&tree_data, const_cast<Mesh *>(mesh), BVHTREE_FROM_LOOPTRI, 4); + BKE_bvhtree_from_mesh_get(&tree_data, mesh, BVHTREE_FROM_LOOPTRI, 4); if (tree_data.tree != nullptr) { for (const int i : ray_origins.index_range()) { |