fromValue static method

MaterialMapIndex fromValue(
  1. int value
)

Returns the MaterialMapIndex for the given native value.

Throws ArgumentError if value does not correspond to a known entry.

Implementation

static MaterialMapIndex fromValue(int value) => switch (value) {
  0 => MATERIAL_MAP_ALBEDO,
  1 => MATERIAL_MAP_METALNESS,
  2 => MATERIAL_MAP_NORMAL,
  3 => MATERIAL_MAP_ROUGHNESS,
  4 => MATERIAL_MAP_OCCLUSION,
  5 => MATERIAL_MAP_EMISSION,
  6 => MATERIAL_MAP_HEIGHT,
  7 => MATERIAL_MAP_CUBEMAP,
  8 => MATERIAL_MAP_IRRADIANCE,
  9 => MATERIAL_MAP_PREFILTER,
  10 => MATERIAL_MAP_BRDF,
  _ => throw ArgumentError('Unknown value for $MaterialMapIndex: $value'),
};