Description

Utility class for specifying a collision boundary composed of multiple semi-planes.

#include <ChBoundary.h>

Inheritance diagram for chrono::ChBoundary:
Collaboration diagram for chrono::ChBoundary:

Public Member Functions

 ChBoundary (std::shared_ptr< ChBody > body)
 
void AddPlane (const ChFrame<> &frame, const ChVector2<> &lengths)
 Add a collision plane with finite extent and return the plane ID. More...
 
void Update ()
 Update all collision planes. More...
 
void UpdatePlane (size_t id, const ChFrame<> &frame)
 Override the position of the specified collision plane. More...
 
void UpdatePlane (size_t id, const ChVector2<> &lengths)
 Override the X-Y extent of the specified collision plane. More...
 
void AddVisualization (size_t id, double thickness)
 Add visualization for the specified plane. More...
 
void AddVisualization (double thickness)
 Add visualization for all existing planes. More...
 
int GetNContacts () const
 Return the current number of collisions.
 
std::shared_ptr< ChBodyGetBody () const
 Return the associated body.
 

Member Function Documentation

void chrono::ChBoundary::AddPlane ( const ChFrame<> &  frame,
const ChVector2<> &  lengths 
)

Add a collision plane with finite extent and return the plane ID.

The plane normal is in the Z-direction of the given frame.

Parameters
frameplane reference frame, relative to associated body
lengthsX-Y extent
void chrono::ChBoundary::AddVisualization ( size_t  id,
double  thickness 
)

Add visualization for the specified plane.

Parameters
idplane indes
thicknessvisualization thickness
void chrono::ChBoundary::AddVisualization ( double  thickness)

Add visualization for all existing planes.

Parameters
thicknessvisualization thickness
void chrono::ChBoundary::Update ( )

Update all collision planes.

This function should be called if the position of the associated body is modified.

void chrono::ChBoundary::UpdatePlane ( size_t  id,
const ChFrame<> &  frame 
)

Override the position of the specified collision plane.

Parameters
idplane index
frameplane reference frame, relative to associated body
void chrono::ChBoundary::UpdatePlane ( size_t  id,
const ChVector2<> &  lengths 
)

Override the X-Y extent of the specified collision plane.

Parameters
idplane index
lengthsX-Y extent