Go to the source code of this file
A mechanics world is a Siconos InteractionManager that supports static contactors and dynamic contactors attached to special Dynamical Systems (BodyDS, derived from NewtonEulerDS) found in the NonSmoothDynamicalSystem.
SiconosCollisionManager
: public InteractionManagerPublic Types
StaticContactorSetID
An opaque handle can be used to refer to a specific static contactor set previously added to the collision manager.
Public Functions
SiconosCollisionManager
()¶~SiconosCollisionManager
()¶inBoxQuery
(const SiconosVector ¢er, 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.
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. 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.
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. insertStaticContactorSet
(SP::SiconosContactorSet cs, SP::SiconosVector position = SP::SiconosVector())Insert a static contactor set.
inSphereQuery
(const SiconosVector ¢er, 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.
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. 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.
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. removeBody
(const SP::BodyDS &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.
removeStaticContactorSet
(StaticContactorSetID id)Remove a static contactor set.
id
: An identifier returned by insertStaticContactorSet. Protected Functions
ACCEPT_SERIALIZATION
(SiconosCollisionManager)¶serialization hooks