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.
Physics::MaterialSlots Class Reference

#include <PhysicsMaterialSlots.h>

Classes

struct  MaterialSlot
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (Physics::MaterialSlots, AZ::SystemAllocator)
 
 AZ_RTTI (Physics::MaterialSlots, "{8A0D64CB-C98E-42E3-96A9-B81D7118CA6F}")
 
 MaterialSlots ()
 Contstructor will already provide a valid default slot.
 
void SetSlots (MaterialDefaultSlot)
 
void SetSlots (const AZStd::vector< AZStd::string > &slots)
 
void SetMaterialAsset (size_t slotIndex, const AZ::Data::Asset< MaterialAsset > &materialAsset)
 Sets a material asset to a specific slot.
 
size_t GetSlotsCount () const
 Returns the number of slots.
 
AZStd::string_view GetSlotName (size_t slotIndex) const
 Returns the name of a specific slot.
 
AZStd::vector< AZStd::string > GetSlotsNames () const
 Returns the names of all slots.
 
const AZ::Data::Asset< MaterialAssetGetMaterialAsset (size_t slotIndex) const
 
void SetSlotsReadOnly (bool readOnly)
 Set if the material slots are editable in the edit context.
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Static Public Attributes

static const char *const EntireObjectSlotName
 

Protected Attributes

AZStd::vector< MaterialSlotm_slots
 

Detailed Description

The class is used to store a list of material assets. Each material will be assigned to a slot and when reflected to edit context it will show it for each slot entry.

Member Function Documentation

◆ GetMaterialAsset()

const AZ::Data::Asset< MaterialAsset > Physics::MaterialSlots::GetMaterialAsset ( size_t  slotIndex) const

Returns the material assigned assigned to a specific slots. A slot can have no asset assigned, in which case it will return a null asset.

◆ SetSlots() [1/2]

void Physics::MaterialSlots::SetSlots ( const AZStd::vector< AZStd::string > &  slots)

Sets an array of material slots. It will resize the material slots but without reassigning the material assets in them.

Parameters
slotsList of labels for slots. It can be empty, in which case it's the same as calling SetSlots(MaterialDefaultSlot::Default).

◆ SetSlots() [2/2]

void Physics::MaterialSlots::SetSlots ( MaterialDefaultSlot  )

Sets one material slot with the default label "Entire Object". It will resize the material slots but without reassigning the material assets in them.


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