Class CollisionStrategy


  • public class CollisionStrategy
    extends ProximityStrategy
    An interface that defines methods to test collision between
    two objects.
    • Constructor Detail

      • CollisionStrategy

        public CollisionStrategy​(long cPtr,
                                 boolean cMemoryOwn)
    • Method Detail

      • inCollision

        public boolean inCollision​(FramePtr a,
                                   Transform3D wTa,
                                   FramePtr b,
                                   Transform3D wTb,
                                   CollisionStrategy.QueryType type)
        Checks to see if two given frames \mathcal{F}_a and
        \mathcal{F}_b are in collision
        Parameters:
        a - [in] \mathcal{F}_a
        wTa - [in] \robabx{w}{a}{\mathbf{T}}
        b - [in] \mathcal{F}_b
        wTb - [in] \robabx{w}{b}{\mathbf{T}}
        type - [in] collision query type
        Returns:
        true if \mathcal{F}_a and \mathcal{F}_b are
        colliding, false otherwise.
      • inCollision

        public boolean inCollision​(FramePtr a,
                                   Transform3D wTa,
                                   FramePtr b,
                                   Transform3D wTb)
        Checks to see if two given frames \mathcal{F}_a and
        \mathcal{F}_b are in collision
        Parameters:
        a - [in] \mathcal{F}_a
        wTa - [in] \robabx{w}{a}{\mathbf{T}}
        b - [in] \mathcal{F}_b
        wTb - [in] \robabx{w}{b}{\mathbf{T}}

        Returns:
        true if \mathcal{F}_a and \mathcal{F}_b are
        colliding, false otherwise.
      • inCollision

        public boolean inCollision​(FramePtr a,
                                   Transform3D wTa,
                                   FramePtr b,
                                   Transform3D wTb,
                                   ProximityStrategyData data,
                                   CollisionStrategy.QueryType type)
        Checks to see if two given frames \mathcal{F}_a and
        \mathcal{F}_b are in collision
        Parameters:
        a - [in] \mathcal{F}_a
        wTa - [in] \robabx{w}{a}{\mathbf{T}}
        b - [in] \mathcal{F}_b
        wTb - [in] \robabx{w}{b}{\mathbf{T}}
        data - [in/out] caching and result container
        type - [in] collision query type
        Returns:
        true if \mathcal{F}_a and \mathcal{F}_b are
        colliding, false otherwise.
      • inCollision

        public boolean inCollision​(FramePtr a,
                                   Transform3D wTa,
                                   FramePtr b,
                                   Transform3D wTb,
                                   ProximityStrategyData data)
        Checks to see if two given frames \mathcal{F}_a and
        \mathcal{F}_b are in collision
        Parameters:
        a - [in] \mathcal{F}_a
        wTa - [in] \robabx{w}{a}{\mathbf{T}}
        b - [in] \mathcal{F}_b
        wTb - [in] \robabx{w}{b}{\mathbf{T}}
        data - [in/out] caching and result container

        Returns:
        true if \mathcal{F}_a and \mathcal{F}_b are
        colliding, false otherwise.
      • inCollision

        public boolean inCollision​(ProximityModelPtr a,
                                   Transform3D wTa,
                                   ProximityModelPtr b,
                                   Transform3D wTb,
                                   ProximityStrategyData data)
        Checks to see if two proximity models are in collision
        Parameters:
        a - [in] model 1
        wTa - [in] transform of model a
        b - [in] model 2
        wTb - [in] transform of model b
        data - [in/out] caching and result container
        Returns:
        true if \mathcal{F}_a and \mathcal{F}_b are
        colliding, false otherwise.
      • getCollisionContacts

        public void getCollisionContacts​(SWIGTYPE_p_std__vectorT_rw__proximity__CollisionStrategy__Contact_t contacts,
                                         ProximityStrategyData data)
        this method interprets the collision query result and calculates a list of
        contacts to represent the collision geometry between the colliding geometries.

        Please note that for most collisions
        a single point and normal is not sufficient to describe the complete collision area.
        However, it is typically a reasonable approximation. The approximation can hence be
        implementation specific.
        Parameters:
        contacts - [out] list of contacts that can be calculated from data
        data - [in] the result from the collision query
      • make

        public static CollisionStrategyPtr make​(CollisionToleranceStrategyPtr strategy,
                                                double tolerance)
        A collision strategy constructed from a collision tolerance
        strategy and a resolution.

        The constructed collision strategy considers a pair of geometries to
        be in collision if strategy claim they are in collision for a
        tolerance of tolerance.
      • make

        public static CollisionStrategyPtr make​(CollisionToleranceStrategyPtr strategy,
                                                FrameMap frameToTolerance,
                                                double defaultTolerance)
        A collision strategy constructed from a collision tolerance
        strategy and a resolution.

        The constructed collision strategy considers a pair of geometries to
        be in collision if strategy claim they are in collision for a
        tolerance of tolerance.