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