SOFA API  014b24ea
Open source framework for multi-physics simuation
sofa::component::collision::DSAPBox Class Reference

#include <DirectSAP.h>

Detailed Description

SAPBox is a simple bounding box. It contains a Cube which contains only one final CollisionElement and pointers to min and max EndPoints. min and max end points are respectively min and max coordinates of the cube on a coordinate axis. min and max are updated with the method update(int i), so min and max have min/max values on the i-th axis after the method update(int i).

Public Attributes

Cube cube
 
EndPointmin
 
EndPointmax
 

Public Member Functions

 DSAPBox (Cube c, EndPoint *mi=nullptr, EndPoint *ma=nullptr)
 
void update (int axis, double alarmDist)
 
bool overlaps (const DSAPBox &other, int axis, double alarmDist) const
 
bool overlaps (const DSAPBox &other, double alarmDist) const
 
bool sqOverlaps (const DSAPBox &other, double squaredAlarmDist) const
 
double squaredDistance (const DSAPBox &other) const
 
double squaredDistance (const DSAPBox &other, int axis) const
 
void show () const
 

Attribute details

Cube sofa::component::collision::DSAPBox::cube
EndPoint* sofa::component::collision::DSAPBox::max
EndPoint* sofa::component::collision::DSAPBox::min

Constructor details

sofa::component::collision::DSAPBox::DSAPBox ( Cube  c,
EndPoint mi = nullptr,
EndPoint ma = nullptr 
)
inline

Function details

bool sofa::component::collision::DSAPBox::overlaps ( const DSAPBox other,
int  axis,
double  alarmDist 
) const
inline
bool sofa::component::collision::DSAPBox::overlaps ( const DSAPBox other,
double  alarmDist 
) const
void sofa::component::collision::DSAPBox::show ( ) const
inline
bool sofa::component::collision::DSAPBox::sqOverlaps ( const DSAPBox other,
double  squaredAlarmDist 
) const
double sofa::component::collision::DSAPBox::squaredDistance ( const DSAPBox other) const
double sofa::component::collision::DSAPBox::squaredDistance ( const DSAPBox other,
int  axis 
) const
inline
void sofa::component::collision::DSAPBox::update ( int  axis,
double  alarmDist 
)
inline