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

Collision layers defined for the project. More...

#include <CollisionLayers.h>

Public Member Functions

 AZ_TYPE_INFO (CollisionLayers, "{68E7CB59-29BC-4825-AE99-182D6421EE65}")
 
CollisionLayer GetLayer (const AZStd::string &name) const
 
bool TryGetLayer (const AZStd::string &name, CollisionLayer &layer) const
 
const AZStd::string & GetName (CollisionLayer layer) const
 
const AZStd::array< AZStd::string, MaxCollisionLayers > & GetNames () const
 
void SetName (CollisionLayer layer, const AZStd::string &layerName)
 
void SetName (AZ::u64 layerIndex, const AZStd::string &layerName)
 
bool operator== (const CollisionLayers &other) const
 
bool operator!= (const CollisionLayers &other) const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Public Attributes

 AZ_CLASS_ALLOCATOR_DECL
 

Static Public Attributes

static const AZ::u8 MaxCollisionLayers = 64
 

Detailed Description

Collision layers defined for the project.

Member Function Documentation

◆ GetLayer()

CollisionLayer AzPhysics::CollisionLayers::GetLayer ( const AZStd::string &  name) const

Get the requested layer.

Parameters
nameThe name of the layer to retrieve.
Returns
The request layer if found, otherwise CollisionLayer::Defualt.

◆ GetName()

const AZStd::string& AzPhysics::CollisionLayers::GetName ( CollisionLayer  layer) const

Get the name of the requested layer.

Returns
Returns the name of the requested layer

◆ GetNames()

const AZStd::array<AZStd::string, MaxCollisionLayers>& AzPhysics::CollisionLayers::GetNames ( ) const

Get the names of all the layers.

Returns
Returns an array of all the layers names.

◆ SetName() [1/2]

void AzPhysics::CollisionLayers::SetName ( AZ::u64  layerIndex,
const AZStd::string &  layerName 
)

Set the name of the requested layer by index. Will verify layerIndex is within bounds.

Parameters
layerIndexThe requested layer index.
layerNameThe name of the layer.

◆ SetName() [2/2]

void AzPhysics::CollisionLayers::SetName ( CollisionLayer  layer,
const AZStd::string &  layerName 
)

Set the name of the requested layer.

Parameters
layerThe requested layer to modify.
layerNameThe name of the layer.

◆ TryGetLayer()

bool AzPhysics::CollisionLayers::TryGetLayer ( const AZStd::string &  name,
CollisionLayer layer 
) const

Get the requested layer.

Parameters
nameThe name of the layer to retrieve.
layer[OUT] The request layer if found, otherwise layer is left untouched.
Returns
Returns true if the layer was found, otherwise false.

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