AGX Dynamics 2.41.2.0
Loading...
Searching...
No Matches
agxCollide::CollisionGroupManager Class Reference

#include <CollisionGroupManager.h>

+ Inheritance diagram for agxCollide::CollisionGroupManager:

Public Types

typedef agx::HashSet< agx::UInt64CollisionHash
 
typedef agx::HashSet< agx::Physics::CollisionGroupPtrGroupHash
 
typedef agx::HashSet< agx::UInt32GroupIdHash
 
typedef agx::HashSet< agx::Physics::CollisionGroupSetPtrGroupSetHash
 
typedef agx::Vector< agx::Physics::CollisionGroupSetPtrGroupSetVector
 
typedef agx::Vector< agx::Physics::CollisionGroupPtrGroupVector
 
typedef agx::Vector< agx::SymmetricPair< agx::Physics::CollisionGroupPtr > > SymmetricCollisionGroupVector
 
- Public Types inherited from agx::Component
typedef Event2< Component *, Object * > ObjectEvent
 Event when adding removing child objects.
 
typedef Callback1< Object * > TraverseCallback
 
- Public Types inherited from agx::Object
typedef agx::observer_ptr< const EventEventConstObserver
 
typedef agx::ref_ptr< const EventEventConstRef
 
typedef agx::observer_ptr< EventEventObserver
 
typedef agx::Vector< EventObserverEventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< EventEventRef
 
typedef agx::Vector< EventRefEventRefVector
 

Public Member Functions

 CollisionGroupManager ()
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxCollide::CollisionGroupManager)
 
bool canGroupsCollide (agx::UInt32 group1, agx::UInt32 group2) const
 
bool canSetsCollide (agx::Physics::CollisionGroupSetPtr set1, agx::Physics::CollisionGroupSetPtr set2) const
 
bool canSetsCollide (agx::UInt32 set1, agx::UInt32 set2) const
 
agx::UInt32 generateUniqueId ()
 
const agxData::EntityStoragegetCollisionGroupSetStorage () const
 
const agxData::EntityStoragegetCollisionGroupStorage () const
 
SymmetricCollisionGroupVector getDisabledCollisionGroupPairs () const
 
const CollisionHashgetDisabledGroupCollisions () const
 
const CollisionHashgetDisabledSetCollisions () const
 
agx::Physics::CollisionGroupSetPtr getExtendedSet (agx::Physics::CollisionGroupSetPtr set, agx::UInt32 groupId, bool unreferenceOldSet=true)
 Extend an existing group set by adding an additional group (can be nullptr pointer)
 
agx::Physics::CollisionGroupSetPtr getExtendedSetFromAddedSet (agx::Physics::CollisionGroupSetPtr set, agx::Physics::CollisionGroupSetPtr set2, bool unreferenceOldSet=true)
 Extend an existing group set by adding an additional group set.
 
agx::Physics::CollisionGroupPtr getGroup (agx::UInt32 groupId)
 
agx::Physics::CollisionGroupPtr getGroup (const agx::Name &groupName)
 
agx::UInt32 getGroupId (const agx::Name &groupName)
 
agx::Physics::CollisionGroupSetPtr getMatchingSet (agx::Physics::CollisionGroupSetPtr set)
 Get the matching set stored in another CollisionGroupManager NOTE: The old set must be manually unreferenced by calling unreferenceSet on the other manager.
 
agx::Physics::CollisionGroupSetPtr getReducedSet (agx::Physics::CollisionGroupSetPtr set, agx::UInt32 groupId, bool unreferenceOldSet=true)
 Reduce an existing group set by removing a group.
 
bool hasGroup (agx::UInt32 groupId) const
 
bool hasGroup (const agx::Name &groupName) const
 
void internal_restore (agxStream::InputArchive &in)
 
void setEnableCollisions (agx::UInt32 groupId1, agx::UInt32 groupId2, bool flag)
 Enable/disable collisions between two groups.
 
void unreferenceSet (agx::Physics::CollisionGroupSetPtr set)
 Unreference a set when it is no longer used.
 
- Public Member Functions inherited from agx::Component
 Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component.
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
void configure (Model *model)
 
virtual void configure (TiXmlElement *eComponent) override
 
agx::DevicegetDevice ()
 
template<typename T >
T * getDevice ()
 
const agx::DevicegetDevice () const
 
template<typename T >
const T * getDevice () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
agx::ObjectgetObject (const agx::Name &name, size_t index=0)
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
const agx::ObjectgetObject (const agx::Name &name, size_t index=0) const
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVectorgetObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
virtual ObjectgetResourceImpl (const Path &path, agx::Model *model) override
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
virtual void rebind () override
 
void removeAllObjects ()
 Remove all components.
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component.
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component.
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
void traverse (ComponentVisitor *)
 
void traverse (const TraverseCallback &callback)
 
- Public Member Functions inherited from agx::Object
 Object (const Name &name=Name(), Model *model=Object::ClassModel())
 
void addListener (EventListener *listener)
 
virtual void buildNavigationTree (agxJson::Value &eNode) const
 
virtual void configure (TiXmlElement *)
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::ObjectgetContext ()
 
template<typename T >
T * getContext ()
 
const agx::ObjectgetContext () const
 
template<typename T >
const T * getContext () const
 
agx::UInt32 getId () const
 
const agx::NamegetImplementationName () const
 
agx::ModelgetModel ()
 
const agx::ModelgetModel () const
 
const agx::NamegetName () const
 
agx::ObjectgetNextSibling ()
 
const agx::ObjectgetNextSibling () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::ObjectgetResource (const agx::Path &path, agx::Model *model=nullptr) const
 
virtual agx::ObjectgetResourceImpl (const agx::Path &path, agx::Model *model)
 
agx::ObjectgetRootContext ()
 
const agx::ObjectgetRootContext () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
bool isUnique () const
 
virtual void printSubtree () const
 
virtual void rebind ()
 
void removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically).
 
void setName (const agx::Name &name)
 Set the name of the object.
 
virtual void snapshot (TiXmlNode *, const String &) const
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referencedoperator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agxStream::Serializablecreate (agxStream::InputArchive &)
 
static CollisionGroupManagerdefaultManager ()
 
static bool hasGroup (agx::Physics::CollisionGroupSetPtr set, agx::UInt32 groupId)
 
static bool hasGroup (agx::Physics::CollisionGroupSetPtr set, const agx::Name &groupName)
 
static void printSet (const agx::Physics::CollisionGroupSetPtr &set)
 
static bool verify (agx::Physics::CollisionGroupSetPtr set)
 
- Static Public Member Functions inherited from agx::Component
static Component_load (TiXmlElement *eComponent, Device *device)
 
static agx::ModelClassModel ()
 
static Componentload (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Componentload (const String &path, const Path &_namespace=Path())
 
static Componentload (const String &path, Device *device, const Path &_namespace=Path())
 
static Componentload (TiXmlElement *eComponent, Device *device)
 
- Static Public Member Functions inherited from agx::Object
static agx::ModelClassModel ()
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting.
 
static Objectload (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static Objectload (const String &path, Device *device, const String &type="", size_t instance=0)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static Objectload (TiXmlElement *eObject, Device *device)
 
template<typename T >
static T * load (TiXmlElement *eObject, Device *device)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting).
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

virtual ~CollisionGroupManager ()
 
- Protected Member Functions inherited from agx::Component
virtual ~Component ()
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
void setDevice (Device *device)
 
- Protected Member Functions inherited from agx::Object
virtual ~Object ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Additional Inherited Members

- Public Attributes inherited from agx::Component
ObjectEvent addObjectEvent
 
ObjectEvent removeObjectEvent
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandlergetDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Definition at line 30 of file CollisionGroupManager.h.

Member Typedef Documentation

◆ CollisionHash

◆ GroupHash

◆ GroupIdHash

◆ GroupSetHash

◆ GroupSetVector

◆ GroupVector

◆ SymmetricCollisionGroupVector

Constructor & Destructor Documentation

◆ CollisionGroupManager()

agxCollide::CollisionGroupManager::CollisionGroupManager ( )

◆ ~CollisionGroupManager()

virtual agxCollide::CollisionGroupManager::~CollisionGroupManager ( )
protectedvirtual

Member Function Documentation

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxCollide::CollisionGroupManager::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxCollide::CollisionGroupManager  )

◆ canGroupsCollide()

bool agxCollide::CollisionGroupManager::canGroupsCollide ( agx::UInt32  group1,
agx::UInt32  group2 
) const
Returns
true if the requested collision groups can collide. No mutex lock is used due to performance, assumes setEnableCollisions is not called at the same time

Definition at line 514 of file CollisionGroupManager.h.

References agx::buildHashKey(), and agx::HashSetImplementation< KeyT, HashT, AllocatorT >::contains().

◆ canSetsCollide() [1/2]

bool agxCollide::CollisionGroupManager::canSetsCollide ( agx::Physics::CollisionGroupSetPtr  set1,
agx::Physics::CollisionGroupSetPtr  set2 
) const

◆ canSetsCollide() [2/2]

bool agxCollide::CollisionGroupManager::canSetsCollide ( agx::UInt32  set1,
agx::UInt32  set2 
) const
Returns
true if the requested collision sets can collide. NOTE: Parameters are set IDs, not indices No mutex lock is used due to performance, assumes setEnableCollisions is not called at the same time

Definition at line 499 of file CollisionGroupManager.h.

References agx::buildHashKey(), and agx::HashSetImplementation< KeyT, HashT, AllocatorT >::contains().

Referenced by canSetsCollide().

◆ create()

static agxStream::Serializable * agxCollide::CollisionGroupManager::create ( agxStream::InputArchive )
inlinestatic

Definition at line 136 of file CollisionGroupManager.h.

◆ defaultManager()

static CollisionGroupManager * agxCollide::CollisionGroupManager::defaultManager ( )
static

◆ generateUniqueId()

agx::UInt32 agxCollide::CollisionGroupManager::generateUniqueId ( )
Returns
A unique group id.

◆ getCollisionGroupSetStorage()

const agxData::EntityStorage * agxCollide::CollisionGroupManager::getCollisionGroupSetStorage ( ) const

◆ getCollisionGroupStorage()

const agxData::EntityStorage * agxCollide::CollisionGroupManager::getCollisionGroupStorage ( ) const

◆ getDisabledCollisionGroupPairs()

SymmetricCollisionGroupVector agxCollide::CollisionGroupManager::getDisabledCollisionGroupPairs ( ) const
Returns
a vector of all pairs of disabled collision groups

◆ getDisabledGroupCollisions()

const CollisionGroupManager::CollisionHash & agxCollide::CollisionGroupManager::getDisabledGroupCollisions ( ) const

Definition at line 519 of file CollisionGroupManager.h.

◆ getDisabledSetCollisions()

const CollisionGroupManager::CollisionHash & agxCollide::CollisionGroupManager::getDisabledSetCollisions ( ) const

Definition at line 520 of file CollisionGroupManager.h.

◆ getExtendedSet()

agx::Physics::CollisionGroupSetPtr agxCollide::CollisionGroupManager::getExtendedSet ( agx::Physics::CollisionGroupSetPtr  set,
agx::UInt32  groupId,
bool  unreferenceOldSet = true 
)

Extend an existing group set by adding an additional group (can be nullptr pointer)

Returns
The extended group set

◆ getExtendedSetFromAddedSet()

agx::Physics::CollisionGroupSetPtr agxCollide::CollisionGroupManager::getExtendedSetFromAddedSet ( agx::Physics::CollisionGroupSetPtr  set,
agx::Physics::CollisionGroupSetPtr  set2,
bool  unreferenceOldSet = true 
)

Extend an existing group set by adding an additional group set.

Returns
The extended group set

◆ getGroup() [1/2]

agx::Physics::CollisionGroupPtr agxCollide::CollisionGroupManager::getGroup ( agx::UInt32  groupId)

◆ getGroup() [2/2]

agx::Physics::CollisionGroupPtr agxCollide::CollisionGroupManager::getGroup ( const agx::Name groupName)

◆ getGroupId()

agx::UInt32 agxCollide::CollisionGroupManager::getGroupId ( const agx::Name groupName)

◆ getMatchingSet()

agx::Physics::CollisionGroupSetPtr agxCollide::CollisionGroupManager::getMatchingSet ( agx::Physics::CollisionGroupSetPtr  set)

Get the matching set stored in another CollisionGroupManager NOTE: The old set must be manually unreferenced by calling unreferenceSet on the other manager.

Returns
The matching set in this manager

◆ getReducedSet()

agx::Physics::CollisionGroupSetPtr agxCollide::CollisionGroupManager::getReducedSet ( agx::Physics::CollisionGroupSetPtr  set,
agx::UInt32  groupId,
bool  unreferenceOldSet = true 
)

Reduce an existing group set by removing a group.

Returns
The reduced group set

◆ hasGroup() [1/4]

static bool agxCollide::CollisionGroupManager::hasGroup ( agx::Physics::CollisionGroupSetPtr  set,
agx::UInt32  groupId 
)
static

◆ hasGroup() [2/4]

static bool agxCollide::CollisionGroupManager::hasGroup ( agx::Physics::CollisionGroupSetPtr  set,
const agx::Name groupName 
)
static

◆ hasGroup() [3/4]

bool agxCollide::CollisionGroupManager::hasGroup ( agx::UInt32  groupId) const

◆ hasGroup() [4/4]

bool agxCollide::CollisionGroupManager::hasGroup ( const agx::Name groupName) const

◆ internal_restore()

void agxCollide::CollisionGroupManager::internal_restore ( agxStream::InputArchive in)

◆ printSet()

static void agxCollide::CollisionGroupManager::printSet ( const agx::Physics::CollisionGroupSetPtr set)
static

◆ setEnableCollisions()

void agxCollide::CollisionGroupManager::setEnableCollisions ( agx::UInt32  groupId1,
agx::UInt32  groupId2,
bool  flag 
)

Enable/disable collisions between two groups.

◆ unreferenceSet()

void agxCollide::CollisionGroupManager::unreferenceSet ( agx::Physics::CollisionGroupSetPtr  set)

Unreference a set when it is no longer used.

◆ verify()

static bool agxCollide::CollisionGroupManager::verify ( agx::Physics::CollisionGroupSetPtr  set)
static

The documentation for this class was generated from the following file: