Open 3D Engine AzFramework API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Physics::MaterialSelection Class Reference

#include <Material.h>

Public Types

using SlotsArray = AZStd::vector< AZStd::string >
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (MaterialSelection, AZ::SystemAllocator, 0)
 
 AZ_TYPE_INFO (Physics::MaterialSelection, "{F571AFF4-C4BB-4590-A204-D11D9EEABBC4}")
 
void SetMaterialSlots (const SlotsArray &slots)
 
const AZStd::vector< Physics::MaterialId > & GetMaterialIdsAssignedToSlots () const
 Returns a list of MaterialId that were assigned for each corresponding slot.
 
void SetMaterialId (const Physics::MaterialId &materialId, int slotIndex=0)
 
Physics::MaterialId GetMaterialId (int slotIndex=0) const
 
void OnMaterialLibraryChanged (const AZ::Data::AssetId &defaultMaterialLibraryId)
 Called when the material library has changed.
 
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)
 

Friends

class MaterialSelectionEventHandler
 

Detailed Description

The class is used to store a vector of MaterialIds selected from the library

This class is used to store the user's selection of the materials from this library. You can reflect this class in EditorContext to provide UI for selecting materials on any custom component or QWidget.

Member Function Documentation

◆ GetMaterialId()

Physics::MaterialId Physics::MaterialSelection::GetMaterialId ( int  slotIndex = 0) const

Returns the material id assigned to this selection at a specific slotIndex.

Parameters
slotIndexIndex of the slot to retrieve the MaterialId

◆ SetMaterialId()

void Physics::MaterialSelection::SetMaterialId ( const Physics::MaterialId materialId,
int  slotIndex = 0 
)

Sets the MaterialId as the selected material at a specific slotIndex.

Parameters
materialIdMaterialId that user selected
slotIndexIndex of the slot to set the MaterialId

◆ SetMaterialSlots()

void Physics::MaterialSelection::SetMaterialSlots ( const SlotsArray &  slots)

Sets an array of material slots to pick MaterialIds for. Having multiple slots is required for assigning multiple materials on a mesh or heightfield object. SlotsArray can be empty and in this case Default slot will be created.

Parameters
slotsArray of names for slots. Can be empty, in this case Default slot will be created

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