SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
sofa::component::collision::detection::algorithm::DSAPBox Class Reference

#include <DSAPBox.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

collision::geometry::Cube cube
 
EndPointmin {nullptr}
 
EndPointmax {nullptr}
 

Public Member Functions

 DSAPBox (const collision::geometry::Cube &c, EndPoint *mi=nullptr, EndPoint *ma=nullptr)
 
void update (int axis, double alarmDist)
 
double squaredDistance (const DSAPBox &other) const
 
double squaredDistance (const DSAPBox &other, int axis) const
 Compute the squared distance from this to other on a specific axis. More...
 
void show () const
 

Attribute details

◆ cube

collision::geometry::Cube sofa::component::collision::detection::algorithm::DSAPBox::cube

◆ max

EndPoint* sofa::component::collision::detection::algorithm::DSAPBox::max {nullptr}

◆ min

EndPoint* sofa::component::collision::detection::algorithm::DSAPBox::min {nullptr}

Constructor details

◆ DSAPBox()

sofa::component::collision::detection::algorithm::DSAPBox::DSAPBox ( const collision::geometry::Cube c,
EndPoint mi = nullptr,
EndPoint ma = nullptr 
)
inlineexplicit

Function details

◆ show()

void sofa::component::collision::detection::algorithm::DSAPBox::show ( ) const
inline

◆ squaredDistance() [1/2]

double sofa::component::collision::detection::algorithm::DSAPBox::squaredDistance ( const DSAPBox other) const

◆ squaredDistance() [2/2]

double sofa::component::collision::detection::algorithm::DSAPBox::squaredDistance ( const DSAPBox other,
int  axis 
) const

Compute the squared distance from this to other on a specific axis.

◆ update()

void sofa::component::collision::detection::algorithm::DSAPBox::update ( int  axis,
double  alarmDist 
)