![]() |
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.
|
#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 |
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.
Physics::MaterialId Physics::MaterialSelection::GetMaterialId | ( | int | slotIndex = 0 | ) | const |
Returns the material id assigned to this selection at a specific slotIndex.
slotIndex | Index of the slot to retrieve the MaterialId |
void Physics::MaterialSelection::SetMaterialId | ( | const Physics::MaterialId & | materialId, |
int | slotIndex = 0 |
||
) |
Sets the MaterialId as the selected material at a specific slotIndex.
materialId | MaterialId that user selected |
slotIndex | Index of the slot to set the MaterialId |
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.
slots | Array of names for slots. Can be empty, in this case Default slot will be created |