Go to the documentation of this file.
38 #ifndef COAL_BV_FITTER_H
39 #define COAL_BV_FITTER_H
50 template <
typename BV>
52 for (
unsigned int i = 0; i < n; ++i)
75 template <
typename BV>
85 tri_indices = tri_indices_;
94 prev_vertices = prev_vertices_;
95 tri_indices = tri_indices_;
100 virtual BV
fit(
unsigned int* primitive_indices,
101 unsigned int num_primitives) = 0;
106 prev_vertices = NULL;
120 template <
typename BV>
128 BV
fit(
unsigned int* primitive_indices,
unsigned int num_primitives) {
133 for (
unsigned int i = 0; i < num_primitives; ++i) {
134 Triangle t = tri_indices[primitive_indices[i]];
135 bv += vertices[
t[0]];
136 bv += vertices[
t[1]];
137 bv += vertices[
t[2]];
141 bv += prev_vertices[
t[0]];
142 bv += prev_vertices[
t[1]];
143 bv += prev_vertices[
t[2]];
148 for (
unsigned int i = 0; i < num_primitives; ++i) {
149 bv += vertices[primitive_indices[i]];
153 bv += prev_vertices[primitive_indices[i]];
162 using Base::prev_vertices;
163 using Base::tri_indices;
165 using Base::vertices;
175 OBB fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
185 RSS fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
195 kIOS fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
205 OBBRSS fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
215 AABB fit(
unsigned int* primitive_indices,
unsigned int num_primitives);
void clear()
Clear the geometry primitive data.
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
void set(Vec3s *vertices_, Vec3s *prev_vertices_, Triangle *tri_indices_, BVHModelType type_)
Prepare the geometry primitive data for fitting, for deformable mesh.
void set(Vec3s *vertices_, Triangle *tri_indices_, BVHModelType type_)
Prepare the geometry primitive data for fitting.
BVHModelType
BVH model type.
void fit< OBBRSS >(Vec3s *ps, unsigned int n, OBBRSS &bv)
void fit< AABB >(Vec3s *ps, unsigned int n, AABB &bv)
void fit(Vec3s *ps, unsigned int n, BV &bv)
Compute a bounding volume that fits a set of n points.
A class describing the kIOS collision structure, which is a set of spheres.
The class for the default algorithm fitting a bounding volume to a set of points.
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
@ BVH_MODEL_POINTCLOUD
triangle model
@ BVH_MODEL_TRIANGLES
unknown model type
void fit< RSS >(Vec3s *ps, unsigned int n, RSS &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...
virtual ~BVFitterTpl()
default deconstructor
The class for the default algorithm fitting a bounding volume to a set of points.
Oriented bounding box class.
void fit< kIOS >(Vec3s *ps, unsigned int n, kIOS &bv)
Triangle with 3 indices for points.
void fit< OBB >(Vec3s *ps, unsigned int n, OBB &bv)
hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57