瀏覽代碼

MeshPhysicalMaterial: Update version for certain transmission changes. (#22379)

Michael Herzog 3 年之前
父節點
當前提交
fcf526d01d
共有 1 個文件被更改,包括 21 次插入0 次删除
  1. 21 0
      src/materials/MeshPhysicalMaterial.js

+ 21 - 0
src/materials/MeshPhysicalMaterial.js

@@ -34,6 +34,8 @@ import * as MathUtils from '../math/MathUtils.js';
 
 class MeshPhysicalMaterial extends MeshStandardMaterial {
 
+	#transmission = 0;
+
 	constructor( parameters ) {
 
 		super();
@@ -88,6 +90,25 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
 
 	}
 
+	get transmission() {
+
+		return this.#transmission;
+
+	}
+
+	set transmission( value ) {
+
+		if ( this.#transmission > 0 !== value > 0 ) {
+
+			this.version ++;
+
+		}
+
+		this.#transmission = value;
+
+	}
+
+
 	copy( source ) {
 
 		super.copy( source );