#include <IncrSAP.h>
ISAPBox is a simple bounding box. It contains a Cube which contains only one final CollisionElement and pointers to min and max EndPoints along the three dimensions. min and max end points are respectively min and max coordinates of the cube on a coordinate axis. The between end points (d_min, d_max) and the field cube is that cube is always updated whereas d_min and d_max are stored values of the cube end points at previous time step.
Public Attributes | |
collision::geometry::Cube | cube |
EndPointID * | _min [3] |
EndPointID * | _max [3] |
Static Public Attributes | |
static double | tolerance = (double)(1e-7) |
Public Member Functions | |
ISAPBox () | |
ISAPBox (collision::geometry::Cube c) | |
bool | endPointsOverlap (const ISAPBox &other, int axis) const |
bool | overlaps (const ISAPBox &other, double alarmDist) const |
double | squaredDistance (const ISAPBox &other) const |
void | show () const |
void | showEndPoints () const |
bool | moving (int axis, double alarmDist) const |
bool | moving (double alarmDist) const |
void | init (int boxID, EndPointID **endPts) |
void | update (double alarmDist) |
void | updatedMin (int dim, EndPointID &end_point, double alarmDist) const |
void | updatedMax (int dim, EndPointID &end_point, double alarmDist) const |
void | updateMin (int dim, double alarmDist) |
void | updateMax (int dim, double alarmDist) |
bool | minMoving (int axis, double alarmDist) const |
bool | maxMoving (int axis, double alarmDist) const |
const core::CollisionElementIterator | finalElement () const |
EndPointID & | min (int dim) |
const EndPointID & | min (int dim) const |
EndPointID & | max (int dim) |
const EndPointID & | max (int dim) const |
double | curMin (int dim) const |
double | curMax (int dim) const |
bool | endPointsAreAlright (int ID) |
EndPointID* sofa::component::collision::detection::algorithm::ISAPBox::_max[3] |
EndPointID* sofa::component::collision::detection::algorithm::ISAPBox::_min[3] |
collision::geometry::Cube sofa::component::collision::detection::algorithm::ISAPBox::cube |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns true if the endpoints have id ID and if min end points are min and max are max. It checks only the field data.
|
inline |
Returns true if this overlaps other along the dimension axis. For the two following methods, end points are not used but real positions of end points of the field cube.
|
inline |
|
inline |
Inits d_min and d_max fiels with endPts. endPts is an one dimension array of EndPointID pointers. After this method, the first three end points are the mins in the dimension 0, 1, 2. The last three end points are the maxs in the dimension 0, 1, 2. Values and IDs of endPts are updated after this method.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
The same than the previous one except that this one checks the three dimensions, i.e. it returns true if the ISAPBox is moving at least along one dimension.
bool sofa::component::collision::detection::algorithm::ISAPBox::overlaps | ( | const ISAPBox & | other, |
double | alarmDist | ||
) | const |
Returns true if this overlaps other along the three dimensions.
|
inline |
|
inline |
double sofa::component::collision::detection::algorithm::ISAPBox::squaredDistance | ( | const ISAPBox & | other | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |