#include <DistanceGridCollisionModel.h>
Classes | |
struct | Point |
Public Attributes | |
std::shared_ptr< DistanceGrid > | grid |
int | elem |
Index of the corresponding element in the topology. More... | |
std::set< int > | neighbors |
Index of the neighbors (used for self-collisions) More... | |
type::vector< Point > | points |
barycentric coordinates of included points More... | |
type::vector< GCoord > | normals |
normals in barycentric coordinates of included points More... | |
GCoord | initP0 |
GCoord | initDP |
GCoord | invDP |
Initial corners position. More... | |
GCoord | corners [8] |
Current corners position. More... | |
Plane | faces [6] |
planes corresponding to the six faces (FX0,FX1,FY0,FY1,FZ0,FZ1) More... | |
GCoord | center |
current center; More... | |
GSReal | radius |
radius of enclosing sphere More... | |
type::vector< GCoord > | deformedPoints |
deformed points More... | |
type::vector< GCoord > | deformedNormals |
deformed normals More... | |
bool | pointsUpdated |
true the deformedPoints vector has been updated with the latest positions More... | |
bool | facesUpdated |
true the faces plane vector has been updated with the latest positions More... | |
Precomputed deformation factors | |
We have : deform(b) = C000(1-b[0])(1-b[1])(1-b[2]) + C100(b[0])(1-b[1])(1-b[2]) + C010(1-b[0])(b[1])(1-b[2]) + C110(b[0])(b[1])(1-b[2])
| |
GCoord | Dx |
Dx = -C000+C100. More... | |
GCoord | Dy |
Dy = -C000+C010. More... | |
GCoord | Dz |
Dx = -C000+C001. More... | |
GCoord | Dxy |
Dxy = C000-C100-C010+C110 = C110-C010-Dx. More... | |
GCoord | Dxz |
Dxz = C000-C100-C001+C101 = C101-C001-Dx. More... | |
GCoord | Dyz |
Dyz = C000-C010-C001+C011 = C011-C001-Dy. More... | |
GCoord | Dxyz |
Dxyz = - C000 + C100 + C010 - C110 + C001 - C101 - C011 + C111 = C001 - C101 - C011 + C111 - Dxy. More... | |
Public Member Functions | |
DeformedCube () | |
void | updateDeform () |
Update the deformation precomputed values. More... | |
void | updatePoints () |
Update the deformedPoints position if not done yet (i.e. if pointsUpdated==false) More... | |
void | updateFaces () |
Update the face planes position if not done yet (i.e. if facesUpdated==false) More... | |
DistanceGrid::Coord | baryCoords (const GCoord &c) const |
Compute the barycentric coordinates of a point from its initial position. More... | |
GCoord | initpos (const GCoord &b) const |
Compute the initial position of a point from its barycentric coordinates. More... | |
GCoord | deform (const GCoord &b) const |
Compute the deformed position of a point from its barycentric coordinates. More... | |
GCoord | deformDir (const GCoord &b, const GCoord &dir) const |
deform a direction relative to a point in barycentric coordinates More... | |
type::Mat< 3, 3, double > | Jdeform (const GCoord &b) const |
Get the local jacobian matrix of the deformation. More... | |
GCoord | undeform0 (const GCoord &p) const |
Compute an initial estimate to the barycentric coordinate of a point given its deformed position. More... | |
GCoord | undeformDir (const GCoord &b, const GCoord &dir) const |
Undeform a direction relative to a point in barycentric coordinates. More... | |
Plane | computePlane (int c00, int c10, int c01, int c11) |
Compute a plane equation given 4 corners. More... | |
Static Public Member Functions | |
static GSReal | interp (GSReal coef, GSReal a, GSReal b) |
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::center |
current center;
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::corners[8] |
Current corners position.
type::vector<GCoord> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::deformedNormals |
deformed normals
type::vector<GCoord> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::deformedPoints |
deformed points
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dx |
Dx = -C000+C100.
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dxy |
Dxy = C000-C100-C010+C110 = C110-C010-Dx.
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dxyz |
Dxyz = - C000 + C100 + C010 - C110 + C001 - C101 - C011 + C111 = C001 - C101 - C011 + C111 - Dxy.
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dxz |
Dxz = C000-C100-C001+C101 = C101-C001-Dx.
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dy |
Dy = -C000+C010.
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dyz |
Dyz = C000-C010-C001+C011 = C011-C001-Dy.
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::Dz |
Dx = -C000+C001.
int sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::elem |
Index of the corresponding element in the topology.
Plane sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::faces[6] |
planes corresponding to the six faces (FX0,FX1,FY0,FY1,FZ0,FZ1)
bool sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::facesUpdated |
true the faces plane vector has been updated with the latest positions
std::shared_ptr<DistanceGrid> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::grid |
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::initDP |
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::initP0 |
GCoord sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::invDP |
Initial corners position.
std::set<int> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::neighbors |
Index of the neighbors (used for self-collisions)
type::vector<GCoord> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::normals |
normals in barycentric coordinates of included points
type::vector<Point> sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::points |
barycentric coordinates of included points
bool sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::pointsUpdated |
true the deformedPoints vector has been updated with the latest positions
GSReal sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::radius |
radius of enclosing sphere
|
inline |
|
inline |
Compute the barycentric coordinates of a point from its initial position.
FFDDistanceGridCollisionModel::DeformedCube::Plane sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::computePlane | ( | int | c00, |
int | c10, | ||
int | c01, | ||
int | c11 | ||
) |
Compute a plane equation given 4 corners.
|
inline |
Compute the deformed position of a point from its barycentric coordinates.
|
inline |
deform a direction relative to a point in barycentric coordinates
|
inline |
Compute the initial position of a point from its barycentric coordinates.
|
inlinestatic |
|
inline |
Get the local jacobian matrix of the deformation.
|
inline |
Compute an initial estimate to the barycentric coordinate of a point given its deformed position.
|
inline |
Undeform a direction relative to a point in barycentric coordinates.
void sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::updateDeform | ( | ) |
Update the deformation precomputed values.
Update the deformation precomputed values
void sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::updateFaces | ( | ) |
Update the face planes position if not done yet (i.e. if facesUpdated==false)
Update the face planes if not done yet (i.e. if facesUpdated==false)
void sofa::component::collision::FFDDistanceGridCollisionModel::DeformedCube::updatePoints | ( | ) |
Update the deformedPoints position if not done yet (i.e. if pointsUpdated==false)