Просмотр исходного кода

Missed MaterialExtension types

master
Palash Bansal 1 год назад
Родитель
Сommit
3b09b70624
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 30 добавлений и 0 удалений
  1. 30
    0
      src/materials/MaterialExtension.ts

+ 30
- 0
src/materials/MaterialExtension.ts Просмотреть файл

@@ -68,6 +68,36 @@ export interface MaterialExtension{
*/
onAfterRender?: (object: Object3D, material: IMaterial, renderer: IWebGLRenderer) => void

/**
* Custom callback to run code when the material is updated. (when `materialUpdate` event is dispatched on the material)
* @param material - material that was updated
*/
onMaterialUpdate?: (material: IMaterial) => void
/**
* Custom callback to run code when the material is added/applied to a mesh or any Object3D.
* @param mesh - object/mesh applied to
* @param material - material that was added
*/
onAddToMesh?: (mesh: Object3D, material: IMaterial) => void
/**
* Custom callback to run code when the material is removed from a mesh or any Object3D.
* @param mesh
* @param material
*/
onRemoveFromMesh?: (mesh: Object3D, material: IMaterial) => void

/**
* Custom callback to run code when this material extension is registered to a material.
* @param material
*/
onRegister?: (material: IMaterial) => void // when this extension is registered to a material
/**
* Custom callback to run code when this material extension is unregistered from a material.
* @param material
*/
onUnregister?: (material: IMaterial) => void // when this extension is registered to a material


/**
* Function to check if this material extension is compatible with the given material.
* If not compatible, the material extension will not be applied.

Загрузка…
Отмена
Сохранить