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::CollisionLayer Class Reference

#include <CollisionLayers.h>

Public Member Functions

 AZ_TYPE_INFO (CollisionLayer, "{5AA459C8-2D92-46D2-9154-ED49EE4FE70E}")
 
 CollisionLayer (AZ::u8 index=Default.GetIndex())
 
 CollisionLayer (const AZStd::string &layerName)
 
AZ::u8 GetIndex () const
 
void SetIndex (AZ::u8 index)
 
AZ::u64 GetMask () const
 
bool operator== (const CollisionLayer &other) const
 
bool operator!= (const CollisionLayer &other) const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Public Attributes

 AZ_CLASS_ALLOCATOR_DECL
 

Static Public Attributes

static const CollisionLayer Default
 Default collision layer, 0.
 

Detailed Description

This class represents which layer a collider exists on. A collider can only exist on a single layer, defined by the index. There is a maximum of 64 layers.

Constructor & Destructor Documentation

◆ CollisionLayer() [1/2]

AzPhysics::CollisionLayer::CollisionLayer ( AZ::u8  index = Default.GetIndex())

Construct a layer with the given index.

Parameters
indexThe index of the layer. Must be between 0 - CollisionLayers::MaxCollisionLayers. Default CollisionLayer::Default.

◆ CollisionLayer() [2/2]

AzPhysics::CollisionLayer::CollisionLayer ( const AZStd::string &  layerName)

Construct a layer with the given name. This will lookup the layer name to retrieve the index. If not found will set the index to CollisionLayer::Default.

Parameters
layernameThe name of the layer.

Member Function Documentation

◆ GetIndex()

AZ::u8 AzPhysics::CollisionLayer::GetIndex ( ) const

Get the index of this layer. Index will be between 0 - CollisionLayers::MaxCollisionLayers

Returns
The layers index.

◆ GetMask()

AZ::u64 AzPhysics::CollisionLayer::GetMask ( ) const

Get the Layer index represented as a bitmask.

Returns
A bitmask with the layer index bit toggled on.

◆ SetIndex()

void AzPhysics::CollisionLayer::SetIndex ( AZ::u8  index)

Set the index of this layer.

Parameters
indexThe index to set. Must be between 0 - CollisionLayers::MaxCollisionLayers

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