浏览代码

Missed MaterialExtension types

master
Palash Bansal 1年前
父节点
当前提交
3b09b70624
没有帐户链接到提交者的电子邮件
共有 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.

正在加载...
取消
保存