Class SiconosCollisionManager#

Defined in Program listing for file mechanics/src/collision/SiconosCollisionManager.hpp

class SiconosCollisionManager : public InteractionManager#

Subclassed by SiconosBulletCollisionManager

Public Types

typedef void *StaticContactorSetID#

An opaque handle can be used to refer to a specific static contactor set previously added to the collision manager.

Public Functions

inline virtual void removeBody(const SP::SecondOrderDS &body)#

Remove a body from the collision detector.

This must be done after removing a body from the NonSmoothDynamicalSystem otherwise contact will occur with a non-graph body which results in failure.

inline virtual SP::StaticBody addStaticBody(SP::SiconosContactorSet cs, SP::SiconosVector position = SP::SiconosVector(), int number = 0)#

Add a static body in the collision detector.

inline virtual void removeStaticBody(const SP::StaticBody &body)#

Remove a body from the collision detector.

inline virtual std::vector<SP::SiconosCollisionQueryResult> lineIntersectionQuery(const SiconosVector &start, const SiconosVector &end, bool closestOnly = false, bool sorted = true)#

Perform an intersection test on all shapes in the contactors and return a vector of all results, ordered by distance from start.

Parameters:
  • start – The starting point of the line segment in inertial frame (world) coordinates.

  • end – The ending point of the line segment in inertial frame (world) coordinates.

  • closestOnly – If true, indicates only interested in first result closest to half-space boundary, max size of returned vector = 1.

  • sorted – If true, results are sorted by distance.

Returns:

A vector of SiconosCollisionQueryResult that contain information about the query results.

inline virtual std::vector<SP::SiconosCollisionQueryResult> inSphereQuery(const SiconosVector &center, double radius, bool closestOnly = false, bool sorted = true)#

Find all shapes that are within a sphere defined by a point and a radius and return them in an ordered list based on distance to the center.

Parameters:
  • center – The center of the sphere in inertial frame (world) coordinates.

  • radius – The radius of the sphere.

  • closestOnly – If true, indicates only interested in first result closest to half-space boundary, max size of returned vector = 1.

  • sorted – If true, results are sorted by distance.

Returns:

A vector of SiconosCollisionQueryResult that contain information about the query results.

inline virtual std::vector<SP::SiconosCollisionQueryResult> inBoxQuery(const SiconosVector &center, const SiconosVector &dimensions, bool closestOnly = false, bool sorted = true)#

Find all shapes that are within a box defined by a center point and a dimensions (3-vector), and return them in an ordered list based on distance to the center.

Parameters:
  • center – The center of the box in inertial frame (world) coordinates.

  • dimensions – The dimensions of the box (3-vector).

  • closestOnly – If true, indicates only interested in first result closest to half-space boundary, max size of returned vector = 1.

  • sorted – If true, results are sorted by distance.

Returns:

A vector of SiconosCollisionQueryResult that contain information about the query results.

inline virtual std::vector<SP::SiconosCollisionQueryResult> inHalfSpaceQuery(const SiconosVector &point, const SiconosVector &normal, bool closestOnly = false, bool sorted = true)#

Find all shapes that are inside a half-space, defined by a point and a normal direction.

Parameters:
  • point – The point defining the boundary of the half-space.

  • normal – The normal pointing away from the surface of the half-space.

  • closestOnly – If true, indicates only interested in first result closest to half-space boundary, max size of returned vector = 1.

  • sorted – If true, results are sorted by distance.

Returns:

A vector of SiconosCollisionQueryResult that contain information about the query results.