![]() |
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. | |
| GroupFilterTable (const GroupFilterTable &inRHS) | |
| Copy constructor. | |
| void | DisableCollision (SubGroupID inSubGroup1, SubGroupID inSubGroup2) |
| Disable collision between two sub groups. | |
| void | EnableCollision (SubGroupID inSubGroup1, SubGroupID inSubGroup2) |
| Enable collision between two sub groups. | |
| bool | IsCollisionEnabled (SubGroupID inSubGroup1, SubGroupID inSubGroup2) const |
| Check if the collision between two subgroups is enabled. | |
| virtual bool | CanCollide (const CollisionGroup &inGroup1, const CollisionGroup &inGroup2) const override |
| Checks if two CollisionGroups collide. | |
| virtual void | SaveBinaryState (StreamOut &inStream) const override |
| Saves the contents of the group filter in binary form to inStream. | |
Public Member Functions inherited from GroupFilter | |
| virtual | ~GroupFilter () override=default |
| Virtual destructor. | |
Public Member Functions inherited from SerializableObject | |
| virtual | ~SerializableObject ()=default |
| Destructor. | |
Public Member Functions inherited from RefTarget< GroupFilter > | |
| RefTarget ()=default | |
| Constructor. | |
| RefTarget (const RefTarget &) | |
| ~RefTarget () | |
| assert no one is referencing us | |
| void | SetEmbedded () const |
| RefTarget & | operator= (const RefTarget &) |
| Assignment operator. | |
| uint32 | GetRefCount () const |
| Get current refcount of this object. | |
| void | AddRef () const |
| Add or release a reference to this object. | |
| void | Release () const |
Protected Member Functions | |
| virtual void | RestoreBinaryState (StreamIn &inStream) override |
| This function should not be called directly, it is used by sRestoreFromBinaryState. | |
Protected Member Functions inherited from GroupFilter | |
| GroupFilter ()=default | |
| Don't allow (copy) constructing this base class, but allow derived classes to (copy) construct themselves. | |
| GroupFilter (const GroupFilter &)=default | |
| GroupFilter & | operator= (const GroupFilter &)=default |
Protected Member Functions inherited from SerializableObject | |
| SerializableObject ()=default | |
| Don't allow (copy) constructing this base class, but allow derived classes to (copy) construct themselves. | |
| SerializableObject (const SerializableObject &)=default | |
| SerializableObject & | operator= (const SerializableObject &)=default |
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. | |
Static Public Member Functions inherited from RefTarget< GroupFilter > | |
| static int | sInternalGetRefCountOffset () |
| INTERNAL HELPER FUNCTION USED BY SERIALIZATION. | |
Protected Attributes inherited from RefTarget< GroupFilter > | |
| atomic< uint32 > | mRefCount |
| Current reference count. | |
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. | |
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 groups the table will look like:
sub group 1 --->
sub group 2 x.....
| ox....
| oox...
V ooox..
oooox.
ooooox
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.