Classes
Members
(static) diagnostics
Static access to the default registry's diagnostic log.
- Source
_customFallback :object|null
- object |
null
- Source
_fallbackId :string
- string
- Source
_materials :Map.<string, object>
- Map.<string, object>
- Source
diagnostics :Array.<object>
- Array.<object>
- Source
onDiagnostic :function|null
- function |
null
- Source
Methods
(static) get()
Static helper to get a material definition from the default registry.
- Source
(static) getDefault() → {MaterialRegistry}
Get the default singleton instance of MaterialRegistry.
- Source
- Type:
- MaterialRegistry
(static) has()
Static helper to check if a material definition exists in the default registry.
- Source
(static) register()
Static helper to register a material definition on the default registry.
- Source
(static) reset()
Static helper to reset the default registry to built-ins.
- Source
get(id, optionsopt) → {object}
Query a material definition by ID with fallback handling and diagnostic warning.
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string | Material identifier. | |||||||||||
options | object | <optional> | Properties
|
- Source
The material definition or fallback.
- Type:
- object
getAll() → {Array.<object>}
Get all registered material definitions as an array.
- Source
- Type:
- Array.<object>
getIds() → {Array.<string>}
Get all registered material IDs.
- Source
- Type:
- Array.<string>
has(id) → {boolean}
Check if a material is registered.
| Name | Type | Description |
|---|---|---|
id | string | Material identifier. |
- Source
- Type:
- boolean
register(id, def) → {object}
Register or update a material definition.
| Name | Type | Description |
|---|---|---|
id | string | Unique material identifier. |
def | object | Material properties. |
- Source
The registered material definition.
- Type:
- object
reset()
Reset registry to default built-in materials and clear diagnostics.
- Source
setFallback(fallback)
Configure the fallback material.
| Name | Type | Description |
|---|---|---|
fallback | string | | Material ID or definition. |
- Source
unregister(id) → {boolean}
Unregister a material definition.
| Name | Type | Description |
|---|---|---|
id | string |
- Source
- Type:
- boolean