38 #ifndef FCL_BVH_UTILITY_INL_H 39 #define FCL_BVH_UTILITY_INL_H 41 #include "fcl/geometry/bvh/BVH_utility.h" 43 #include "fcl/math/bv/utility.h" 51 BVHModel<OBB<double>>& model,
const Variance3<double>* ucs,
double r);
56 BVHModel<RSS<double>>& model,
const Variance3<double>* ucs,
double r);
59 template <
typename S,
typename BV>
62 for(
int i = 0; i < model.num_bvs; ++i)
74 for(
int k = 0; k < 3; ++k)
76 bv += (v + uc.
axis.col(k) * (r * uc.
sigma[k]));
77 bv += (v - uc.
axis.col(k) * (r * uc.
sigma[k]));
92 for(
int i = 0; i < model.getNumBVs(); ++i)
108 for(
int k = 0; k < 3; ++k)
110 const auto index1 = 6 * j + 2 * k;
111 const auto index2 = index1 + 1;
113 vs[index1].noalias() += uc.
axis.col(k) * (r * uc.
sigma[k]);
115 vs[index2].noalias() -= uc.
axis.col(k) * (r * uc.
sigma[k]);
129 template <
typename S>
135 for(
int i = 0; i < model.getNumBVs(); ++i)
151 for(
int k = 0; k < 3; ++k)
153 vs[6 * j + 2 * k] = v + uc.
axis.col(k) * (r * uc.
sigma[k]);
154 vs[6 * j + 2 * k + 1] = v - uc.
axis.col(k) * (r * uc.
sigma[k]);
Vector3< S > sigma
Variations along the eign axes.
Definition: variance3.h:58
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
const BVNode< BV > & getBV(int id) const
We provide getBV() and getNumBVs() because BVH may be compressed (in future), so we must provide some...
Definition: BVH_model-inl.h:160
Vector3< S > * vertices
Geometry point data.
Definition: BVH_model.h:162
Matrix3< S > axis
Matrix whose columns are eigenvectors of Sigma.
Definition: variance3.h:61
void fit(Vector3< typename BV::S > *ps, int n, BV &bv)
Compute a bounding volume that fits a set of n points.
Definition: utility-inl.h:647
int num_primitives
The number of primitives belonging to the current node.
Definition: BV_node_base.h:63
Class for variance matrix in 3d.
Definition: variance3.h:51
A class describing the bounding hierarchy of a mesh model or a point cloud model (which is viewed as ...
Definition: BVH_model.h:57
BV bv
bounding volume storing the geometry
Definition: BV_node.h:57
A class describing a bounding volume node. It includes the tree structure providing in BVNodeBase and...
Definition: BV_node.h:52
int first_primitive
The start id the primitive belonging to the current node. The index is referred to the primitive_indi...
Definition: BV_node_base.h:60