Pārlūkot izejas kodu

Added accessor functions for SubMesh._materialDefines

Popov72 5 gadi atpakaļ
vecāks
revīzija
d8d58292b9
2 mainītis faili ar 16 papildinājumiem un 0 dzēšanām
  1. 1 0
      dist/preview release/what's new.md
  2. 15 0
      src/Meshes/subMesh.ts

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

@@ -86,6 +86,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
 

+ 15 - 0
src/Meshes/subMesh.ts

@@ -29,6 +29,21 @@ 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
+     * @param defines defines the set of defines used to compile the effect
+     */
+    public set materialDefines(defines: Nullable<MaterialDefines>) {
+        this._materialDefines = defines;
+    }
+
+    /**
      * Gets associated effect
      */
     public get effect(): Nullable<Effect> {