Blender  V3.3
embree.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2018-2022 Blender Foundation. */
3 
4 #ifndef __BVH_EMBREE_H__
5 #define __BVH_EMBREE_H__
6 
7 #ifdef WITH_EMBREE
8 
9 # include <embree3/rtcore.h>
10 # include <embree3/rtcore_scene.h>
11 
12 # include "bvh/bvh.h"
13 # include "bvh/params.h"
14 
15 # include "util/thread.h"
16 # include "util/types.h"
17 # include "util/vector.h"
18 
20 
21 class Hair;
22 class Mesh;
23 class PointCloud;
24 
25 class BVHEmbree : public BVH {
26  public:
27  void build(Progress &progress, Stats *stats, RTCDevice rtc_device);
28  void refit(Progress &progress);
29 
30  RTCScene scene;
31 
32  protected:
33  friend class BVH;
34  BVHEmbree(const BVHParams &params,
36  const vector<Object *> &objects);
37  virtual ~BVHEmbree();
38 
39  void add_object(Object *ob, int i);
40  void add_instance(Object *ob, int i);
41  void add_curves(const Object *ob, const Hair *hair, int i);
42  void add_points(const Object *ob, const PointCloud *pointcloud, int i);
43  void add_triangles(const Object *ob, const Mesh *mesh, int i);
44 
45  private:
46  void set_tri_vertex_buffer(RTCGeometry geom_id, const Mesh *mesh, const bool update);
47  void set_curve_vertex_buffer(RTCGeometry geom_id, const Hair *hair, const bool update);
48  void set_point_vertex_buffer(RTCGeometry geom_id,
49  const PointCloud *pointcloud,
50  const bool update);
51 
52  RTCDevice rtc_device;
53  enum RTCBuildQuality build_quality;
54 };
55 
57 
58 #endif /* WITH_EMBREE */
59 
60 #endif /* __BVH_EMBREE_H__ */
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
void build(btStridingMeshInterface *triangles, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax)
Definition: bvh/bvh.h:63
vector< Geometry * > geometry
Definition: bvh/bvh.h:66
vector< Object * > objects
Definition: bvh/bvh.h:67
Definition: hair.h:13
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
Scene scene
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
static void update(bNodeTree *ntree)