AGX Dynamics  2.37.2.0
MultiCollisionFilterContactHandler.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
21 
22 namespace agxSDK
23 {
25 
37  {
38  public:
43 
50  void add( ExecuteFilter* filter, int activationMask );
51 
56  virtual void remove( ExecuteFilter* filter );
57 
63  void setActivationMask( ExecuteFilter* filter, int activationMask );
64 
69  int getActivationMask( const ExecuteFilter* filter ) const;
70 
74  agx::UInt32 getNumGeometryContacts() const;
75 
79  agx::UInt32 getNumContactPoints() const;
80 
87  void collectContactIndices( const ExecuteFilter* filter, agx::UInt32Vector& contactIndices ) const;
88 
93  const agx::UInt32Vector& getContactIndices( const ExecuteFilter* filter ) const;
94 
99  void collectSeparations( const ExecuteFilter* filter, agxCollide::GeometryPairVector& separations) const;
100 
105  agxCollide::GeometryContact* getGeometryContact( agx::UInt32 index ) const;
106 
107  public:
109  void addNotification() override;
110 
111  void removeNotification() override;
112 
113  void pre( const agx::TimeStamp& time ) override;
114 
115  void post( const agx::TimeStamp& time ) override;
116 
120  agx::UInt32 getContactIndex( agxCollide::GeometryContact* geometryContact );
122 
123  protected:
128 
129  private:
133  void reset();
134 
135  private:
136  agxCollide::GeometryContactPtrVector m_geometryContacts;
139  agx::UInt32 m_contactPointCounter = 0;
140  };
141 
143  {
144  if ( index >= (agx::UInt32)m_geometryContacts.size() )
145  return nullptr;
146  return m_geometryContacts[ index ];
147  }
148 }
Derive from this class to implement a listener for simulation step events.
Abstract base class that implements a filter that selects which events should trigger a Listener...
Definition: ExecuteFilter.h:33
A contact between two geometries.
Definition: Contacts.h:270
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Real TimeStamp
Definition: TimeStamp.h:26
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: HashVector.h:40
Templated vector class.
Definition: Vector.h:52
A step event listener managing N contact event listeners with different filters.
agxCollide::GeometryContact * getGeometryContact(agx::UInt32 index) const
Inheritance with partial specialization due to bug with ref_ptr containers.
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
uint32_t UInt32
Definition: Integer.h:40
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97