浏览代码

Merge pull request #7189 from Popov72/Accessor-func-SubMesh

Added accessor functions for SubMesh._materialDefines
David Catuhe 5 年之前
父节点
当前提交
daabc7538b
共有 2 个文件被更改,包括 15 次插入0 次删除
  1. 1 0
      dist/preview release/what's new.md
  2. 14 0
      src/Meshes/subMesh.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -95,6 +95,7 @@
 - Added new CreateTiledPlane and CreateTiledBox ([JohnK](https://github.com/BabylonJSGuide/))
 - Added absolute scaling and rotation getters ([haroldma](https://github.com/haroldma))
 - Added `BILLBOARDMODE_USE_POSITION` flag to billboards allowing use of camera positioning instead of orientation for mesh rotation ([delaneyj](https://github.com/delaneyj))
+- Added accessor functions for `SubMesh._materialDefines` ([Popov72](https://github.com/Popov72))
 
 ### Physics
 

+ 14 - 0
src/Meshes/subMesh.ts

@@ -29,6 +29,20 @@ export class BaseSubMesh {
     public _materialEffect: Nullable<Effect> = null;
 
     /**
+     * Gets material defines used by the effect associated to the sub mesh
+     */
+    public get materialDefines(): Nullable<MaterialDefines> {
+        return this._materialDefines;
+    }
+
+    /**
+     * Sets material defines used by the effect associated to the sub mesh
+     */
+    public set materialDefines(defines: Nullable<MaterialDefines>) {
+        this._materialDefines = defines;
+    }
+
+    /**
      * Gets associated effect
      */
     public get effect(): Nullable<Effect> {