walberla::pe::fcd::analytic Namespace Reference

Functions

template<typename Container >
bool collide (GeomID, GeomID, Container &)
 Contact generation between two colliding rigid bodies. More...
 
template<typename Container >
bool collide (SphereID s1, SphereID s2, Container &container)
 
template<typename Container >
bool collide (SphereID s, PlaneID p, Container &container)
 
template<typename Container >
bool collide (PlaneID p, SphereID s, Container &container)
 
template<typename Container >
bool collide (SphereID s, CylindricalBoundaryID cb, Container &container)
 
template<typename Container >
bool collide (CylindricalBoundaryID cb, SphereID s, Container &container)
 
template<typename Container >
bool collide (SphereID s, BoxID b, Container &container)
 Contact generation between a Sphere and a Box. More...
 
template<typename Container >
bool collide (BoxID b, SphereID s, Container &container)
 
template<typename Container >
bool collide (BoxID b1, BoxID b2, Container &container)
 Contact generation between two colliding Box primitives. More...
 
template<typename Container >
bool collide (BoxID b, PlaneID p, Container &container)
 Contact generation between a Box and a Plane. More...
 
template<typename Container >
bool collide (PlaneID p, BoxID b, Container &container)
 
template<typename Container >
bool collide (CapsuleID c1, CapsuleID c2, Container &container)
 Contact generation between two colliding Capsule primitives. More...
 
template<typename Container >
bool collide (CapsuleID c, PlaneID p, Container &container)
 Contact generation between a Capsule and a Plane. More...
 
template<typename Container >
bool collide (PlaneID p, CapsuleID c, Container &container)
 
template<typename Container >
bool collide (SphereID s, CapsuleID c, Container &container)
 
template<typename Container >
bool collide (CapsuleID c, SphereID s, Container &container)
 
template<typename Container >
bool collide (BoxID b, CapsuleID c, Container &container)
 
template<typename Container >
bool collide (CapsuleID c, BoxID b, Container &container)
 
template<typename... BodyTypes, typename BodyB , typename Container >
bool collide (Union< BodyTypes... > *bd1, BodyB *bd2, Container &container)
 
template<typename BodyA , typename... BodyTypes, typename Container >
bool collide (BodyA *bd1, Union< BodyTypes... > *bd2, Container &container)
 
template<typename... BodyTypesA, typename... BodyTypesB, typename Container >
bool collide (Union< BodyTypesA... > *bd1, Union< BodyTypesB... > *bd2, Container &container)
 

Function Documentation

◆ collide() [1/21]

template<typename BodyA , typename... BodyTypes, typename Container >
bool walberla::pe::fcd::analytic::collide ( BodyA *  bd1,
Union< BodyTypes... > *  bd2,
Container &  container 
)
inline

◆ collide() [2/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( BoxID  b,
CapsuleID  c,
Container &  container 
)
inline

◆ collide() [3/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( BoxID  b,
PlaneID  p,
Container &  container 
)
inline

Contact generation between a Box and a Plane.

Parameters
bThe colliding box.
pThe colliding plane.
containerContact container for the generated contacts.
Returns
true if a contact is detected, false otherwise

For each corner of the box, the distance to the plane is calculated with a projection on the plane's normal. For each corner, which lies on or inside the plane, a contact point is generated.

◆ collide() [4/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( BoxID  b,
SphereID  s,
Container &  container 
)
inline

◆ collide() [5/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( BoxID  b1,
BoxID  b2,
Container &  container 
)
inline

Contact generation between two colliding Box primitives.

Parameters
b1The first colliding box.
b2The second colliding box.
containerContact container for the generated contacts.
Returns
void

◆ collide() [6/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( CapsuleID  c,
BoxID  b,
Container &  container 
)
inline

◆ collide() [7/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( CapsuleID  c,
PlaneID  p,
Container &  container 
)
inline

Contact generation between a Capsule and a Plane.

Parameters
cThe colliding capsule.
pThe colliding plane.
containerContact container for the generated contacts.
Returns
true if a contact is detected, false otherwise

The collision between a capsule and a plane is handled as two collisions between the two cap spheres and the plane: the contact points are calculated with a projection of the global positions of the spheres' center of mass on the plane's normal. If the length of the projection is smaller than the radius of the cap sphere, a contact point is generated, which results in a maximum of two contact points.

◆ collide() [8/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( CapsuleID  c,
SphereID  s,
Container &  container 
)
inline

◆ collide() [9/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( CapsuleID  c1,
CapsuleID  c2,
Container &  container 
)
inline

Contact generation between two colliding Capsule primitives.

Parameters
c1The first colliding capsule.
c2The second colliding capsule.
containerContact container for the generated contacts.
Returns
void

In case of two colliding capsules one or two contact points may be generated. In order to estimate if the two capsules are colliding, the closest points on both centerlines are calculated (see pe::getClosestLineSegmentPoints). If the distance of these two points is smaller than the sum of their radii, the two capsules are colliding. In case they are lying parallel to each other and touch each other along their cylindrical part, two contact points are generated. In all other cases, a single contact point between the calculated closest points is generated.

◆ collide() [10/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( CylindricalBoundaryID  cb,
SphereID  s,
Container &  container 
)
inline

◆ collide() [11/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( GeomID  ,
GeomID  ,
Container &   
)
inline

Contact generation between two colliding rigid bodies.

Returns
true if contact is detected, false otherwise
Attention
If no contact was detected the value of penetrationDepth, contactPoint, contactNormal is undefined!

◆ collide() [12/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( PlaneID  p,
BoxID  b,
Container &  container 
)
inline

◆ collide() [13/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( PlaneID  p,
CapsuleID  c,
Container &  container 
)
inline

◆ collide() [14/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( PlaneID  p,
SphereID  s,
Container &  container 
)
inline

◆ collide() [15/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( SphereID  s,
BoxID  b,
Container &  container 
)
inline

Contact generation between a Sphere and a Box.

Parameters
sThe colliding sphere.
bThe colliding box.
containerContact container for the generated contacts.
Returns
void

In the case of a contact between a sphere and a box, only a single contact point is generated. This contact point is calculated by a projection of the relative distance of the sphere's center of mass from the box's center of mass on the body frame coordinate system of the box. For all three axes, the projection is limited by the lengths of the sides of the box. This projection is transfered to the global world frame, which gives the distance from the box's center of mass to the contact point.

◆ collide() [16/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( SphereID  s,
CapsuleID  c,
Container &  container 
)
inline

◆ collide() [17/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( SphereID  s,
CylindricalBoundaryID  cb,
Container &  container 
)
inline

◆ collide() [18/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( SphereID  s,
PlaneID  p,
Container &  container 
)
inline

◆ collide() [19/21]

template<typename Container >
bool walberla::pe::fcd::analytic::collide ( SphereID  s1,
SphereID  s2,
Container &  container 
)
inline

◆ collide() [20/21]

template<typename... BodyTypes, typename BodyB , typename Container >
bool walberla::pe::fcd::analytic::collide ( Union< BodyTypes... > *  bd1,
BodyB *  bd2,
Container &  container 
)
inline

◆ collide() [21/21]

template<typename... BodyTypesA, typename... BodyTypesB, typename Container >
bool walberla::pe::fcd::analytic::collide ( Union< BodyTypesA... > *  bd1,
Union< BodyTypesB... > *  bd2,
Container &  container 
)
inline