#include <CollisionGroups.h>
Classes | |
class | Id |
struct | Preset |
Public Member Functions | |
AZ_TYPE_INFO (CollisionGroups, "{309B0B28-F51F-48E2-972E-DA7618ED7249}") | |
Id | CreateGroup (const AZStd::string &name, CollisionGroup group, Id id=Id::Create(), bool readOnly=false) |
void | DeleteGroup (Id id) |
Delete a group with the given CollisionGroup::Id. | |
void | SetGroupName (Id id, const AZStd::string &groupName) |
Set the name of a group with the given CollisionGroup::Id. | |
void | SetLayer (Id id, CollisionLayer layer, bool enabled) |
CollisionGroup | FindGroupById (Id id) const |
CollisionGroup | FindGroupByName (const AZStd::string &groupName) const |
bool | TryFindGroupByName (const AZStd::string &groupName, CollisionGroup &group) const |
Id | FindGroupIdByName (const AZStd::string &groupName) const |
AZStd::string | FindGroupNameById (Id id) const |
const AZStd::vector< Preset > & | GetPresets () const |
Retrieve a list of all current Presets (see CollisionGroup::Preset). | |
bool | operator== (const CollisionGroups &other) const |
bool | operator!= (const CollisionGroups &other) const |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Public Attributes | |
AZ_CLASS_ALLOCATOR_DECL | |
Collision groups can be defined and edited in the PhysXConfiguration window. The idea is that collision groups are authored there, and then assigned to components via the edit context by reflecting Physics::CollisionGroups::Id, or alternatively can be retrieved by name from the CollisionConfiguration.
Id AzPhysics::CollisionGroups::CreateGroup | ( | const AZStd::string & | name, |
CollisionGroup | group, | ||
Id | id = Id::Create() , |
||
bool | readOnly = false |
||
) |
Create a CollisionGroup.
name | The name to give the group. |
group | The CollisionGroup data to set to this group. |
id | A CollisionGroup::Id to assign to the group. By default will create a new Id. |
readOnly | Mark the group as read only. Default false. |
CollisionGroup AzPhysics::CollisionGroups::FindGroupById | ( | Id | id | ) | const |
id | The CollisionGroup::Id to find. |
CollisionGroup AzPhysics::CollisionGroups::FindGroupByName | ( | const AZStd::string & | groupName | ) | const |
groupName | The CollisionGroup name to find. |
Id AzPhysics::CollisionGroups::FindGroupIdByName | ( | const AZStd::string & | groupName | ) | const |
Retrieve the CollisionGroup::Id of the request name.
groupName | The name of the CollisionGroup to lookup. |
AZStd::string AzPhysics::CollisionGroups::FindGroupNameById | ( | Id | id | ) | const |
Retrieve the name of the requested CollisionGroup::Id.
id | The CollisionGroup::Id to preform a name lookup for. |
void AzPhysics::CollisionGroups::SetLayer | ( | Id | id, |
CollisionLayer | layer, | ||
bool | enabled | ||
) |
Set a CollisionLayer ON or OFF on in the given CollisionGroup::Id. This will verify id is valid.
id | The group id to affect. |
layer | The CollisionLayer to turn ON or OFF. |
enabled | If true toggle the given CollisionLayer to ON, otherwise OFF |
bool AzPhysics::CollisionGroups::TryFindGroupByName | ( | const AZStd::string & | groupName, |
CollisionGroup & | group | ||
) | const |
groupName | The CollisionGroup name to find. |
group | [Out] The requested CollisionGroup if successful. Otherwise group is unchanged. |