SOFA plugin: CollisionOBBCapsule  master
Open source framework for multi-physics simuation
collisionobbcapsule::geometry::TOBB< TDataTypes > Class Template Reference

#include <OBBModel.h>

Inheritance diagram for collisionobbcapsule::geometry::TOBB< TDataTypes >:

Detailed Description

template<class TDataTypes>
class collisionobbcapsule::geometry::TOBB< TDataTypes >

An OBB model is a set of OBBs. It is linked to a rigid mechanical object. Each frame of the rigid mechanical object represents the frame of one OBB. So an OBB is represented by its frame which orients it, a center and 3 extents. A point P is inside the OBB obb if and only if P = obb.center() + a*obb.axis(0) + b*obb.axis(1) + c*obb.axis(2) with -obb.extent(0) <= a <= obb.extent(0), -obb.extent(1) <= b <= obb.extent(1), -obb.extent(2) <= c <= obb.extent(2). (obb.axis(i) is the local frame axis for i-th dimension)

Public Member Functions

 TOBB (ParentModel *model, Index index)
 
 TOBB (const core::CollisionElementIterator &i)
 
Coord axis (int i) const
 
void axes (Coord *v_axes) const
 
Real extent (int i) const
 
const Coordextents () const
 
const Coordcenter () const
 
const Quaternionorientation () const
 
const Coordv () const
 
Coord localCoordinates (const Coord &c) const
 
Coord generalCoordinates (const Coord &c) const
 
void vertices (std::vector< Coord > &vs) const
 
void showVertices () const
 
bool onSurface (const Coord &p) const
 
- Public Member Functions inherited from sofa::core::TCollisionElementIterator< OBBCollisionModel< TDataTypes > >
 TCollisionElementIterator (Model *model=nullptr, Index index=0)
 
 TCollisionElementIterator (Model *model, Index index, VIterator it, VIterator itend)
 
 TCollisionElementIterator (Model *model, VIterator it, VIterator itend)
 
bool isActive (core::CollisionModel *cm=nullptr) const
 
bool operator== (const TCollisionElementIterator< Model2 > &i) const
 
bool operator== (const TCollisionElementIterator< Model2 > &i) const
 
bool operator!= (const TCollisionElementIterator< Model2 > &i) const
 
bool operator!= (const TCollisionElementIterator< Model2 > &i) const
 
TCollisionElementIteratoroperator+= (int n)
 
TCollisionElementIteratoroperator+= (int n)
 
TCollisionElementIterator operator+ (int n) const
 
TCollisionElementIterator operator+ (int n) const
 
bool valid () const
 
bool valid () const
 
Model * getCollisionModel () const
 
Model * getCollisionModel () const
 
std::pair< CollisionElementIterator, CollisionElementIteratorgetInternalChildren () const
 
std::pair< CollisionElementIterator, CollisionElementIteratorgetInternalChildren () const
 
std::pair< CollisionElementIterator, CollisionElementIteratorgetExternalChildren () const
 
std::pair< CollisionElementIterator, CollisionElementIteratorgetExternalChildren () const
 
bool isLeaf () const
 
bool isLeaf () const
 
bool canCollideWith (const TCollisionElementIterator< Model > &elem) const
 
bool canCollideWith (const TCollisionElementIterator< Model > &elem) const
 
SReal getProximity () const
 
SReal getProximity () const
 
SReal getContactStiffness () const
 
SReal getContactStiffness () const
 
SReal getContactFriction () const
 
SReal getContactFriction () const
 
void draw (const core::visual::VisualParams *vparams)
 
void draw (const core::visual::VisualParams *vparams)
 
- Public Member Functions inherited from sofa::core::BaseCollisionElementIterator
 BaseCollisionElementIterator (Index index=0)
 
 BaseCollisionElementIterator (Index index, VIterator it, VIterator itend)
 
 BaseCollisionElementIterator (VIterator it, VIterator itend)
 
void next ()
 
BaseCollisionElementIteratoroperator++ ()
 
BaseCollisionElementIterator operator++ (int)
 
BaseCollisionElementIteratoroperator+= (int n)
 
BaseCollisionElementIterator operator+ (int n) const
 
Index getIndex () const
 
const VIterator & getVIterator () const
 
const VIterator & getVIteratorEnd () const
 
void next ()
 
BaseCollisionElementIteratoroperator++ ()
 
BaseCollisionElementIterator operator++ (int)
 
BaseCollisionElementIteratoroperator+= (int n)
 
BaseCollisionElementIterator operator+ (int n) const
 
Index getIndex () const
 
const VIterator & getVIterator () const
 
const VIterator & getVIteratorEnd () const
 

Additional Inherited Members

- Public Attributes inherited from sofa::core::TCollisionElementIterator< OBBCollisionModel< TDataTypes > >
Model * model
 
- Protected Attributes inherited from sofa::core::BaseCollisionElementIterator
Index index
 
VIterator it
 
VIterator itend
 
- Static Protected Attributes inherited from sofa::core::BaseCollisionElementIterator
static std::vector< int > SOFA_CORE_API emptyVector
 

Constructor details

◆ TOBB() [1/2]

template<class DataTypes >
collisionobbcapsule::geometry::TOBB< DataTypes >::TOBB ( ParentModel model,
sofa::Index  index 
)
inline

◆ TOBB() [2/2]

template<class DataTypes >
collisionobbcapsule::geometry::TOBB< DataTypes >::TOBB ( const core::CollisionElementIterator i)
inlineexplicit

Function details

◆ axes()

template<class DataTypes >
void collisionobbcapsule::geometry::TOBB< DataTypes >::axes ( Coord v_axes) const
inline

Fills v_axes of size 3 with the local frame.

◆ axis()

template<class DataTypes >
TOBB< DataTypes >::Coord collisionobbcapsule::geometry::TOBB< DataTypes >::axis ( int  i) const
inline

Returns the axis of the local frame at i-th dimension.

◆ center()

template<class DataTypes >
const TOBB< DataTypes >::Coord & collisionobbcapsule::geometry::TOBB< DataTypes >::center
inline

◆ extent()

template<class DataTypes >
TOBB< DataTypes >::Real collisionobbcapsule::geometry::TOBB< DataTypes >::extent ( int  i) const
inline

Returns the extent at i-th dimension.

◆ extents()

template<class DataTypes >
const TOBB< DataTypes >::Coord & collisionobbcapsule::geometry::TOBB< DataTypes >::extents
inline

Returns the 3 extents.

◆ generalCoordinates()

template<class DataTypes >
TOBB< DataTypes >::Coord collisionobbcapsule::geometry::TOBB< DataTypes >::generalCoordinates ( const Coord c) const
inline

Returns the coordinates of c (in the local frame) in the general coordinate system.

◆ localCoordinates()

template<class DataTypes >
TOBB< DataTypes >::Coord collisionobbcapsule::geometry::TOBB< DataTypes >::localCoordinates ( const Coord c) const
inline

Returns the coordinates of c (in general coordinate system) in the local frame.

◆ onSurface()

template<class DataTypes >
bool collisionobbcapsule::geometry::TOBB< DataTypes >::onSurface ( const Coord p) const
inline

◆ orientation()

template<class DataTypes >
const TOBB< DataTypes >::Quaternion & collisionobbcapsule::geometry::TOBB< DataTypes >::orientation
inline

Returns the quaterion representing the rotation of the local frame.

◆ showVertices()

template<class DataTypes >
void collisionobbcapsule::geometry::TOBB< DataTypes >::showVertices
inline

◆ v()

template<class DataTypes >
const TOBB< DataTypes >::Coord & collisionobbcapsule::geometry::TOBB< DataTypes >::v
inline

Returns linear velocity.

◆ vertices()

template<class DataTypes >
void collisionobbcapsule::geometry::TOBB< DataTypes >::vertices ( std::vector< Coord > &  vs) const
inline

Returns the 8 vertices in vs in general coordinate system. vertex indexation below :

                                     7--------6
                                    /|       /|
                                   3--------2 |
                                   | |      | |
                                   | 4------|-5
                                   |/       |/
                                   0--------1