Blender V5.0
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
18struct BVHTree;
19struct MFace;
20struct Mesh;
21struct PointCloud;
22
23namespace blender::bke {
24
29 const BVHTree *tree = nullptr;
30
34
35 /* Vertex array, so that callbacks have instant access to data. */
40
41 const MFace *face = nullptr;
42
43 std::unique_ptr<BVHTree, BVHTreeDeleter> owned_tree;
44};
45
50 const IndexMask &verts_mask);
51
56 Span<int2> edges,
57 const IndexMask &edges_mask);
58
64 Span<int> corner_verts,
65 Span<int3> corner_tris,
66 const IndexMask &faces_mask);
67
72
77
82
87 const BVHTreeRay *ray, float m_dist, const float v0[3], const float v1[3], const float v2[3]);
89 float radius,
90 float m_dist,
91 const float v0[3],
92 const float v1[3],
93 const float v2[3]);
94
96 const BVHTree *tree = nullptr;
97
99
101
102 std::unique_ptr<BVHTree, BVHTreeDeleter> owned_tree;
103};
104
106 const IndexMask &points_mask);
107
108} // namespace blender::bke
void(*)(void *userdata, int index, const BVHTreeRay *ray, BVHTreeRayHit *hit) BVHTree_RayCastCallback
void(*)(void *userdata, int index, const float co[3], BVHTreeNearest *nearest) BVHTree_NearestPointCallback
ATTR_WARN_UNUSED_RESULT const BMVert * v2
static char faces[256]
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)
Definition bvhutils.cc:556
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:49
BVHTreeFromMesh bvhtree_from_mesh_edges_init(const Mesh &mesh, const IndexMask &edges_mask)
Definition bvhutils.cc:793
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:28
BVHTreeFromMesh bvhtree_from_mesh_tris_init(const Mesh &mesh, const IndexMask &faces_mask)
Definition bvhutils.cc:784
BVHTreeFromMesh bvhtree_from_mesh_edges_ex(Span< float3 > vert_positions, Span< int2 > edges, const IndexMask &edges_mask)
Definition bvhutils.cc:475
BVHTreeFromMesh bvhtree_from_mesh_verts_init(const Mesh &mesh, const IndexMask &verts_mask)
Definition bvhutils.cc:801
BVHTreeFromMesh bvhtree_from_mesh_verts_ex(Span< float3 > vert_positions, const IndexMask &verts_mask)
Definition bvhutils.cc:450
BVHTreeFromPointCloud bvhtree_from_pointcloud_get(const PointCloud &pointcloud, const IndexMask &points_mask)
Definition bvhutils.cc:842
BVHTree_NearestPointCallback nearest_callback
BVHTree_RayCastCallback raycast_callback
std::unique_ptr< BVHTree, BVHTreeDeleter > owned_tree
std::unique_ptr< BVHTree, BVHTreeDeleter > owned_tree
BVHTree_NearestPointCallback nearest_callback