![]()  | 
  
    Jolt Physics
    
   A multi core friendly Game Physics Engine 
   | 
 
#include <GroupFilterTable.h>
  
Public Member Functions | |
| GroupFilterTable (uint inNumSubGroups=0) | |
| Constructs the table with inNumSubGroups subgroups, initially all collision pairs are enabled except when the sub group ID is the same.  More... | |
| GroupFilterTable (const GroupFilterTable &inRHS) | |
| Copy constructor.  More... | |
| void | DisableCollision (SubGroupID inSubGroup1, SubGroupID inSubGroup2) | 
| Disable collision between two sub groups.  More... | |
| void | EnableCollision (SubGroupID inSubGroup1, SubGroupID inSubGroup2) | 
| Enable collision between two sub groups.  More... | |
| bool | IsCollisionEnabled (SubGroupID inSubGroup1, SubGroupID inSubGroup2) const | 
| Check if the collision between two subgroups is enabled.  More... | |
| virtual bool | CanCollide (const CollisionGroup &inGroup1, const CollisionGroup &inGroup2) const override | 
| Checks if two CollisionGroups collide.  More... | |
| virtual void | SaveBinaryState (StreamOut &inStream) const override | 
| Saves the contents of the group filter in binary form to inStream.  More... | |
  Public Member Functions inherited from GroupFilter | |
| virtual | ~GroupFilter () override=default | 
| Virtual destructor.  More... | |
| virtual bool | CanCollide (const CollisionGroup &inGroup1, const CollisionGroup &inGroup2) const =0 | 
| Check if two groups collide.  More... | |
| virtual void | SaveBinaryState (StreamOut &inStream) const | 
| Saves the contents of the group filter in binary form to inStream.  More... | |
  Public Member Functions inherited from SerializableObject | |
| virtual | ~SerializableObject ()=default | 
| Constructor.  More... | |
  Public Member Functions inherited from RefTarget< GroupFilter > | |
| RefTarget ()=default | |
| Constructor.  More... | |
| RefTarget (const RefTarget &) | |
| ~RefTarget () | |
| assert no one is referencing us  More... | |
| void | SetEmbedded () const | 
| RefTarget & | operator= (const RefTarget &) | 
| Assignment operator.  More... | |
| uint32 | GetRefCount () const | 
| Get current refcount of this object.  More... | |
| void | AddRef () const | 
| Add or release a reference to this object.  More... | |
| void | Release () const | 
Protected Member Functions | |
| virtual void | RestoreBinaryState (StreamIn &inStream) override | 
| This function should not be called directly, it is used by sRestoreFromBinaryState.  More... | |
| virtual void | RestoreBinaryState (StreamIn &inStream) | 
| This function should not be called directly, it is used by sRestoreFromBinaryState.  More... | |
Additional Inherited Members | |
  Public Types inherited from GroupFilter | |
| using | GroupFilterResult = Result< Ref< GroupFilter > > | 
  Static Public Member Functions inherited from GroupFilter | |
| static GroupFilterResult | sRestoreFromBinaryState (StreamIn &inStream) | 
| Creates a GroupFilter of the correct type and restores its contents from the binary stream inStream.  More... | |
  Static Public Member Functions inherited from RefTarget< GroupFilter > | |
| static int | sInternalGetRefCountOffset () | 
| INTERNAL HELPER FUNCTION USED BY SERIALIZATION.  More... | |
  Protected Attributes inherited from RefTarget< GroupFilter > | |
| atomic< uint32 > | mRefCount | 
| Current reference count.  More... | |
  Static Protected Attributes inherited from RefTarget< GroupFilter > | |
| static constexpr uint32 | cEmbedded | 
| A large value that gets added to the refcount to mark the object as embedded.  More... | |
Implementation of GroupFilter that stores a bit table with one bit per sub shape ID pair to determine if they collide or not
The collision rules:
For N = 6 sub shapes the table will look like:
group 1 --->
group 2 x..... | ox.... | oox... V ooox.. oooox. ooooox
x means group 1 == group 2 and we define this to never collide o is a bit that we have to store . is a bit we don't need to store because the table is symmetric, we take care that group 2 > group 1 always by swapping the elements if needed
The total number of bits we need to store is (N * (N - 1)) / 2
      
  | 
  inlineexplicit | 
Constructs the table with inNumSubGroups subgroups, initially all collision pairs are enabled except when the sub group ID is the same.
      
  | 
  inline | 
Copy constructor.
      
  | 
  inlineoverridevirtual | 
Checks if two CollisionGroups collide.
Implements GroupFilter.
      
  | 
  inline | 
Disable collision between two sub groups.
      
  | 
  inline | 
Enable collision between two sub groups.
      
  | 
  inline | 
Check if the collision between two subgroups is enabled.
      
  | 
  overrideprotectedvirtual | 
This function should not be called directly, it is used by sRestoreFromBinaryState.
Reimplemented from GroupFilter.
      
  | 
  overridevirtual | 
Saves the contents of the group filter in binary form to inStream.
Reimplemented from GroupFilter.