Blender  V3.3
unaligned.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #ifndef __BVH_UNALIGNED_H__
5 #define __BVH_UNALIGNED_H__
6 
7 #include "util/vector.h"
8 
10 
11 class BoundBox;
12 class BVHObjectBinning;
13 class BVHRange;
14 class BVHReference;
15 struct Transform;
16 class Object;
17 
18 /* Helper class to perform calculations needed for unaligned nodes. */
19 class BVHUnaligned {
20  public:
21  BVHUnaligned(const vector<Object *> &objects);
22 
23  /* Calculate alignment for the oriented node for a given range. */
25  const BVHReference *references) const;
26  Transform compute_aligned_space(const BVHRange &range, const BVHReference *references) const;
27 
28  /* Calculate alignment for the oriented node for a given reference.
29  *
30  * Return true when space was calculated successfully.
31  */
32  bool compute_aligned_space(const BVHReference &ref, Transform *aligned_space) const;
33 
34  /* Calculate primitive's bounding box in given space. */
36  const Transform &aligned_space) const;
37 
38  /* Calculate bounding box in given space. */
40  const BVHReference *references,
41  const Transform &aligned_space,
42  BoundBox *cent_bounds = NULL) const;
44  const BVHReference *references,
45  const Transform &aligned_space,
46  BoundBox *cent_bounds = NULL) const;
47 
48  /* Calculate affine transform for node packing.
49  * Bounds will be in the range of 0..1.
50  */
51  static Transform compute_node_transform(const BoundBox &bounds, const Transform &aligned_space);
52 
53  protected:
54  /* List of objects BVH is being created for. */
56 };
57 
59 
60 #endif /* __BVH_UNALIGNED_H__ */
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
BVHUnaligned(const vector< Object * > &objects)
Definition: unaligned.cpp:17
Transform compute_aligned_space(const BVHObjectBinning &range, const BVHReference *references) const
Definition: unaligned.cpp:21
BoundBox compute_aligned_boundbox(const BVHObjectBinning &range, const BVHReference *references, const Transform &aligned_space, BoundBox *cent_bounds=NULL) const
Definition: unaligned.cpp:99
const vector< Object * > & objects_
Definition: unaligned.h:55
BoundBox compute_aligned_prim_boundbox(const BVHReference &prim, const Transform &aligned_space) const
Definition: unaligned.cpp:77
static Transform compute_node_transform(const BoundBox &bounds, const Transform &aligned_space)
Definition: unaligned.cpp:139
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9