SOFA plugin: CollisionOBBCapsule  master
Open source framework for multi-physics simuation
collisionobbcapsule::detection::intersection::TIntrSphereOBB< TDataTypes, TDataTypes2 > Class Template Reference

#include <IntrSphereOBB.h>

Inheritance diagram for collisionobbcapsule::detection::intersection::TIntrSphereOBB< TDataTypes, TDataTypes2 >:

Detailed Description

template<typename TDataTypes, typename TDataTypes2>
class collisionobbcapsule::detection::intersection::TIntrSphereOBB< TDataTypes, TDataTypes2 >

TDataTypes is the sphere type and TDataTypes2 the OBB type.

Public Member Functions

 TIntrSphereOBB (const IntrSph &sphere, const Box &box)
 
bool Find ()
 
Real distance () const
 
- Public Member Functions inherited from collisionobbcapsule::detection::intersection::Intersector< TDataTypes::Real >
const Vec3separatingAxis () const
 
const Vec3pointOnFirst () const
 
const Vec3pointOnSecond () const
 
bool colliding () const
 

Additional Inherited Members

- Protected Attributes inherited from collisionobbcapsule::detection::intersection::Intersector< TDataTypes::Real >
Vec3 _sep_axis
 
Vec3 _pt_on_first
 
Vec3 _pt_on_second
 
TDataTypes::Real mContactTime
 
bool _is_colliding
 

Constructor details

◆ TIntrSphereOBB()

template<class TDataTypes , class TDataTypes2 >
collisionobbcapsule::detection::intersection::TIntrSphereOBB< TDataTypes, TDataTypes2 >::TIntrSphereOBB ( const IntrSph sphere,
const Box box 
)

Function details

◆ distance()

template<typename TDataTypes , typename TDataTypes2 >
TIntrSphereOBB< TDataTypes, TDataTypes2 >::Real collisionobbcapsule::detection::intersection::TIntrSphereOBB< TDataTypes, TDataTypes2 >::distance

◆ Find()

template<class TDataTypes , class TDataTypes2 >
bool collisionobbcapsule::detection::intersection::TIntrSphereOBB< TDataTypes, TDataTypes2 >::Find

The idea of finding contact points is simple : project the sphere center on the OBB and find the intersection point on the OBB. Once we have this point we project it on the sphere.