38 #ifndef HPP_FCL_BV_FITTER_H 39 #define HPP_FCL_BV_FITTER_H 51 template <
typename BV>
53 for (
unsigned int i = 0; i < n; ++i)
76 template <
typename BV>
86 tri_indices = tri_indices_;
95 prev_vertices = prev_vertices_;
96 tri_indices = tri_indices_;
101 virtual BV
fit(
unsigned int* primitive_indices,
102 unsigned int num_primitives) = 0;
107 prev_vertices = NULL;
121 template <
typename BV>
129 BV
fit(
unsigned int* primitive_indices,
unsigned int num_primitives) {
134 for (
unsigned int i = 0; i < num_primitives; ++i) {
135 Triangle t = tri_indices[primitive_indices[i]];
136 bv += vertices[t[0]];
137 bv += vertices[t[1]];
138 bv += vertices[t[2]];
142 bv += prev_vertices[t[0]];
143 bv += prev_vertices[t[1]];
144 bv += prev_vertices[t[2]];
149 for (
unsigned int i = 0; i < num_primitives; ++i) {
150 bv += vertices[primitive_indices[i]];
154 bv += prev_vertices[primitive_indices[i]];
163 using Base::prev_vertices;
164 using Base::tri_indices;
166 using Base::vertices;
176 OBB fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
186 RSS fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
196 kIOS fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
206 OBBRSS fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
216 AABB fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
void fit< AABB >(Vec3f *ps, unsigned int n, AABB &bv)
void fit< kIOS >(Vec3f *ps, unsigned int n, kIOS &bv)
BV fit(unsigned int *primitive_indices, unsigned int num_primitives)
Compute a bounding volume that fits a set of primitives (points or triangles). The primitive data was...
The class for the default algorithm fitting a bounding volume to a set of points. ...
void clear()
Clear the geometry primitive data.
A class describing the kIOS collision structure, which is a set of spheres.
virtual ~BVFitterTpl()
default deconstructor
void fit(Vec3f *ps, unsigned int n, BV &bv)
Compute a bounding volume that fits a set of n points.
void fit< OBB >(Vec3f *ps, unsigned int n, OBB &bv)
BVHModelType
BVH model type.
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Triangle with 3 indices for points.
The class for the default algorithm fitting a bounding volume to a set of points. ...
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
void fit< RSS >(Vec3f *ps, unsigned int n, RSS &bv)
void fit< OBBRSS >(Vec3f *ps, unsigned int n, OBBRSS &bv)
Oriented bounding box class.