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);
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: AABB.h:56
The class for the default algorithm fitting a bounding volume to a set of points.
Definition: BV_fitter.h:77
BVHModelType type
Definition: BV_fitter.h:116
Vec3f * vertices
Definition: BV_fitter.h:113
void set(Vec3f *vertices_, Vec3f *prev_vertices_, Triangle *tri_indices_, BVHModelType type_)
Prepare the geometry primitive data for fitting, for deformable mesh.
Definition: BV_fitter.h:92
void clear()
Clear the geometry primitive data.
Definition: BV_fitter.h:105
Triangle * tri_indices
Definition: BV_fitter.h:115
Vec3f * prev_vertices
Definition: BV_fitter.h:114
void set(Vec3f *vertices_, Triangle *tri_indices_, BVHModelType type_)
Prepare the geometry primitive data for fitting.
Definition: BV_fitter.h:83
virtual BV fit(unsigned int *primitive_indices, unsigned int num_primitives)=0
Compute the fitting BV.
virtual ~BVFitterTpl()
default deconstructor
Definition: BV_fitter.h:80
AABB 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...
OBB 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...
kIOS 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.
Definition: BV_fitter.h:122
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...
Definition: BV_fitter.h:129
Triangle with 3 indices for points.
Definition: data_types.h:101
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:53
#define HPP_FCL_DLLAPI
Definition: config.hh:88
void fit< RSS >(Vec3f *ps, unsigned int n, RSS &bv)
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:67
BVHModelType
BVH model type.
Definition: BVH_internal.h:80
@ BVH_MODEL_POINTCLOUD
triangle model
Definition: BVH_internal.h:83
@ BVH_MODEL_UNKNOWN
Definition: BVH_internal.h:81
@ BVH_MODEL_TRIANGLES
unknown model type
Definition: BVH_internal.h:82
void fit(Vec3f *ps, unsigned int n, BV &bv)
Compute a bounding volume that fits a set of n points.
Definition: BV_fitter.h:52
void fit< AABB >(Vec3f *ps, unsigned int n, AABB &bv)
void fit< OBB >(Vec3f *ps, unsigned int n, OBB &bv)
void fit< OBBRSS >(Vec3f *ps, unsigned int n, OBBRSS &bv)
void fit< kIOS >(Vec3f *ps, unsigned int n, kIOS &bv)
Main namespace.
Definition: broadphase_bruteforce.h:44
Oriented bounding box class.
Definition: OBB.h:52