AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MultiCollisionFilterContactHandler.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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  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  agxCollide::GeometryContact* getGeometryContact( agx::UInt32 index ) const;
100 
101  public:
103  void addNotification() override;
104 
105  void removeNotification() override;
106 
107  void pre( const agx::TimeStamp& time ) override;
108 
109  void post( const agx::TimeStamp& time ) override;
110 
114  agx::UInt32 getContactIndex( agxCollide::GeometryContact* geometryContact );
116 
117  protected:
122 
123  private:
127  void reset();
128 
129  private:
130  agxCollide::GeometryContactPtrVector m_geometryContacts;
133  agx::UInt32 m_contactPointCounter = 0;
134  };
135 
137  {
138  if ( index >= (agx::UInt32)m_geometryContacts.size() )
139  return nullptr;
140  return m_geometryContacts[ index ];
141  }
142 }
Derive from this class to implement a listener for simulation Step events.
agxCollide::GeometryContact * getGeometryContact(agx::UInt32 index) const
Abstract base class that implements a filter that selects which events should trigger a Listener...
Definition: ExecuteFilter.h:34
A contact between two geometries.
Definition: Contacts.h:270
#define AGXPHYSICS_EXPORT
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agx::Real TimeStamp
Definition: TimeStamp.h:26
size_t size() const
Definition: Container.h:134
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Definition: HashVector.h:40
A step event listener managing N contact event listeners with different filters.
Inheritance with partial specialization due to bug with ref_ptr containers.
uint32_t UInt32
Definition: Integer.h:40
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:101
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:100