Blender V5.3
BKE_bvhutils.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2006 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4#pragma once
5
11
12#include "BLI_index_mask_fwd.hh"
13#include "BLI_kdopbvh.hh"
15#include "BLI_offset_indices.hh"
16#include "BLI_span.hh"
17
18namespace blender {
19
20struct BVHTree;
21struct MFace;
22struct Mesh;
23struct PointCloud;
24
25namespace bke {
26
31 const BVHTree *tree = nullptr;
32
36
37 /* Vertex array, so that callbacks have instant access to data. */
42
43 const MFace *face = nullptr;
44
45 std::unique_ptr<BVHTree, BVHTreeDeleter> owned_tree;
46};
47
52 const IndexMask &verts_mask);
53
58 Span<int2> edges,
59 const IndexMask &edges_mask);
60
68 Span<int> corner_verts,
69 Span<int3> corner_tris,
70 const IndexMask &faces_mask,
71 bool map_global_indices = true);
72
77 const BVHTreeRay *ray, float m_dist, const float v0[3], const float v1[3], const float v2[3]);
79 float radius,
80 float m_dist,
81 const float v0[3],
82 const float v1[3],
83 const float v2[3]);
84
85} // namespace bke
86} // namespace blender
BVHTreeFromMesh bvhtree_from_mesh_corner_tris_ex(Span< float3 > vert_positions, OffsetIndices< int > faces, Span< int > corner_verts, Span< int3 > corner_tris, const IndexMask &faces_mask, bool map_global_indices=true)
Definition bvhutils.cc:562
float bvhtree_sphereray_tri_intersection(const BVHTreeRay *ray, float radius, float m_dist, const float v0[3], const float v1[3], const float v2[3])
Definition bvhutils.cc:51
float bvhtree_ray_tri_intersection(const BVHTreeRay *ray, float m_dist, const float v0[3], const float v1[3], const float v2[3])
Definition bvhutils.cc:30
BVHTreeFromMesh bvhtree_from_mesh_edges_ex(Span< float3 > vert_positions, Span< int2 > edges, const IndexMask &edges_mask)
Definition bvhutils.cc:477
BVHTreeFromMesh bvhtree_from_mesh_verts_ex(Span< float3 > vert_positions, const IndexMask &verts_mask)
Definition bvhutils.cc:452
BMesh Iterators.
void(*)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) BVHTree_RayCastCallback
ATTR_WARN_UNUSED_RESULT const BMVert * v2
void(*)(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) BVHTree_NearestPointCallback
BVHTree_NearestPointCallback nearest_callback
BVHTree_RayCastCallback raycast_callback
std::unique_ptr< BVHTree, BVHTreeDeleter > owned_tree