SOFA API  0d8d8705
Open source framework for multi-physics simuation
sofa::core::collision::DetectionOutput Class Reference

#include <DetectionOutput.h>

Generic description of a contact point, used for most collision models except special cases such as GPU-based collisions. More...

Detailed Description

Generic description of a contact point, used for most collision models except special cases such as GPU-based collisions.

Each contact point is described by :

  • elem: pair of colliding elements.
  • id: unique id of the contact for the given pair of collision models.
  • point: contact points on the surface of each model.
  • normal: normal of the contact, pointing outward from the first model.
  • value: signed distance (negative if objects are interpenetrating).
  • deltaT: estimated of time of contact.

The contact id is used to filter redundant contacts (only the contact with the smallest distance is kept), and to store persistant data over time for the response.

Public Attributes

std::pair< core::CollisionElementIterator, core::CollisionElementIteratorelem
 Pair of colliding elements. More...
 
ContactId id
 Unique id of the contact for the given pair of collision models. More...
 
type::Vec3 point [2]
 Contact points on the surface of each model. They are expressed in the local coordinate system of the model if any is defined.. More...
 
type::Vec3 normal
 Normal of the contact, pointing outward from the first model. More...
 
double value
 Store information for the collision Response. Depending on the kind of contact, can be a distance, or a pression, ... More...
 
double deltaT
 If using a continuous collision detection, estimated of time of contact. More...
 

Public Member Functions

 SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER (Vector3, sofa::type::Vec3)
 
 DetectionOutput ()
 

Attribute details

◆ deltaT

double sofa::core::collision::DetectionOutput::deltaT

If using a continuous collision detection, estimated of time of contact.

◆ elem

std::pair<core::CollisionElementIterator, core::CollisionElementIterator> sofa::core::collision::DetectionOutput::elem

Pair of colliding elements.

◆ id

ContactId sofa::core::collision::DetectionOutput::id

Unique id of the contact for the given pair of collision models.

◆ normal

type::Vec3 sofa::core::collision::DetectionOutput::normal

Normal of the contact, pointing outward from the first model.

◆ point

type::Vec3 sofa::core::collision::DetectionOutput::point[2]

Contact points on the surface of each model. They are expressed in the local coordinate system of the model if any is defined..

◆ value

double sofa::core::collision::DetectionOutput::value

Store information for the collision Response. Depending on the kind of contact, can be a distance, or a pression, ...

Constructor details

◆ DetectionOutput()

sofa::core::collision::DetectionOutput::DetectionOutput ( )
inline

Function details

◆ SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER()

sofa::core::collision::DetectionOutput::SOFA_ATTRIBUTE_REPLACED__TYPEMEMBER ( Vector3  ,
sofa::type::Vec3   
)