Class CollisionDetectorPtr


  • public class CollisionDetectorPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • CollisionDetectorPtr

        public CollisionDetectorPtr​(long cPtr,
                                    boolean cMemoryOwn)
      • CollisionDetectorPtr

        public CollisionDetectorPtr()
        Default constructor yielding a NULL-pointer.
      • CollisionDetectorPtr

        public CollisionDetectorPtr​(CollisionDetector ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • inCollision

        public boolean inCollision​(State state,
                                   ProximityData data)
        Check the workcell for collisions.

        Parameters:
        state - [in] The state for which to check for collisions.
        data - [in/out] Defines parameters for the collision check, the results and also
        enables caching inbetween calls to incollision
        Returns:
        true if a collision is detected; false otherwise.
      • inCollision

        public boolean inCollision​(State state,
                                   CollisionDetectorQueryResult result,
                                   boolean stopAtFirstContact)
        Check the workcell for collisions.

        Parameters:
        state - [in] The state for which to check for collisions.
        result - [out] If non-NULL, the pairs of colliding frames are
        inserted in result.
        stopAtFirstContact - [in] If result is non-NULL and
        stopAtFirstContact is true, then only the first colliding pair is
        inserted in result. By default all colliding pairs are inserted.

        Returns:
        true if a collision is detected; false otherwise.
      • inCollision

        public boolean inCollision​(State state,
                                   CollisionDetectorQueryResult result)
        Check the workcell for collisions.

        Parameters:
        state - [in] The state for which to check for collisions.
        result - [out] If non-NULL, the pairs of colliding frames are
        inserted in result.


        Returns:
        true if a collision is detected; false otherwise.
      • inCollision

        public boolean inCollision​(State state)
        Check the workcell for collisions.

        Parameters:
        state - [in] The state for which to check for collisions.



        Returns:
        true if a collision is detected; false otherwise.
      • inCollision

        public boolean inCollision​(State state,
                                   FramePairVector result,
                                   boolean stopAtFirstContact)
        Check the workcell for collisions.

        Parameters:
        state - [in] The state for which to check for collisions.
        result - [out] Where to store pairs of colliding frames.
        stopAtFirstContact - [in] If result is non-NULL and
        stopAtFirstContact is true, then only the first colliding pair is
        inserted in result. By default all colliding pairs are inserted.

        Returns:
        true if a collision is detected; false otherwise.
      • inCollision

        public boolean inCollision​(State state,
                                   FramePairVector result)
        Check the workcell for collisions.

        Parameters:
        state - [in] The state for which to check for collisions.
        result - [out] Where to store pairs of colliding frames.


        Returns:
        true if a collision is detected; false otherwise.
      • getProximityFilterStrategy

        public ProximityFilterStrategyPtr getProximityFilterStrategy()
        The broad phase collision strategy of the collision checker.
      • getCollisionStrategy

        public CollisionStrategyPtr getCollisionStrategy()
        Get the narrow-phase collision strategy.
        Returns:
        the strategy if set, otherwise NULL.
      • addGeometry

        public void addGeometry​(Frame frame,
                                GeometryPtr geometry)
        Add Geometry associated to frame

        The current shape of the geometry is copied, hence later changes to geometry has no effect

        Parameters:
        frame - [in] Frame to associate geometry to
        geometry - [in] Geometry to add
      • removeGeometry

        public void removeGeometry​(Frame frame,
                                   GeometryPtr geometry)
        Removes geometry from CollisionDetector

        The id of the geometry is used to match the collision model to the geometry.

        Parameters:
        frame - [in] The frame which has the geometry associated
        geometry - [in] Geometry with the id to be removed
      • removeGeometry

        public void removeGeometry​(Frame frame,
                                   java.lang.String geometryId)
        Removes geometry from CollisionDetector

        The geometryId is used to match the collision model to the geometry.

        Parameters:
        frame - [in] The frame which has the geometry associated
        geometryId - [in] Id of geometry to be removed
      • addRule

        public void addRule​(ProximitySetupRule rule)
        Adds rule specifying inclusion/exclusion of frame pairs in collision detection
      • removeRule

        public void removeRule​(ProximitySetupRule rule)
        Removes rule specifying inclusion/exclusion of frame pairs in collision detection
      • getComputationTime

        public double getComputationTime()
        Get the computation time used in the inCollision functions.
        Returns:
        the total computation time.
      • getNoOfCalls

        public int getNoOfCalls()
        Get the number of times the inCollision functions have been called.
        Returns:
        number of calls to inCollision functions.
      • resetComputationTimeAndCount

        public void resetComputationTimeAndCount()
        Reset the counter for inCollision invocations and the computation timer.
      • getGeometryIDs

        public VectorString getGeometryIDs​(Frame frame)
        return the ids of all the geometries of this frames.
      • hasGeometry

        public boolean hasGeometry​(Frame frame,
                                   java.lang.String geometryId)
        Returns whether frame has an associated geometry with geometryId.
        Parameters:
        frame - [in] Frame in question
        geometryId - [in] Id of the geometry