Open 3D Engine AzFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzPhysics::CollisionGroup Class Reference

#include <CollisionGroups.h>

Public Member Functions

 AZ_TYPE_INFO (CollisionGroup, "{E6DA080B-7ED1-4135-A78C-A6A5E495A43E}")
 
 CollisionGroup (AZ::u64 mask=All.GetMask())
 
 CollisionGroup (const AZStd::string &groupName)
 
void SetLayer (CollisionLayer layer, bool set)
 
bool IsSet (CollisionLayer layer) const
 
AZ::u64 GetMask () const
 Get the groups bitmask.
 
bool operator== (const CollisionGroup &collisionGroup) const
 
bool operator!= (const CollisionGroup &collisionGroup) const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Public Attributes

 AZ_CLASS_ALLOCATOR_DECL
 

Static Public Attributes

static const CollisionGroup None
 Collide with nothing.
 
static const CollisionGroup All
 Collide with everything.
 

Detailed Description

This class represents the layers a collider should collide with. For two colliders to collide, each layer must be present in the other colliders group.

Constructor & Destructor Documentation

◆ CollisionGroup() [1/2]

AzPhysics::CollisionGroup::CollisionGroup ( AZ::u64  mask = All.GetMask())

Construct a Group with the given bitmask. The each bit in the bitmask corresponds to a CollisionLayer.

Parameters
maskThe bitmask to assign to the group.

◆ CollisionGroup() [2/2]

AzPhysics::CollisionGroup::CollisionGroup ( const AZStd::string &  groupName)

Construct a Group with the given name. This will lookup the group name to retrieve the group mask. If not found, CollisionGroup::All is set.

Parameters
groupNameThe name of the group to look up the group mask.

Member Function Documentation

◆ IsSet()

bool AzPhysics::CollisionGroup::IsSet ( CollisionLayer  layer) const

Check is the given CollisionLayer is ON in this group.

Parameters
layerThe layer to check.
Returns
Returns true if the given layer is ON in this group, otherwise returns false.

◆ SetLayer()

void AzPhysics::CollisionGroup::SetLayer ( CollisionLayer  layer,
bool  set 
)

Enable/Disable a CollisionLayer on this group.

Parameters
layerThe layer to modify.
setIf true, toggle the layer ON for this group, otherwise toggle OFF.

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