未验证 提交 0785d483 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #17795 from elalish/cloneMaterial

Material: added vertexTangents to material clone
......@@ -346,6 +346,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
this.blending = source.blending;
this.side = source.side;
this.flatShading = source.flatShading;
this.vertexTangents = source.vertexTangents;
this.vertexColors = source.vertexColors;
this.opacity = source.opacity;
......@@ -362,7 +363,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
this.depthTest = source.depthTest;
this.depthWrite = source.depthWrite;
this.stencilWrite = source.stencilWrite;
this.stencilWriteMask = source.stencilWriteMask;
this.stencilFunc = source.stencilFunc;
this.stencilRef = source.stencilRef;
......@@ -370,6 +370,26 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
this.stencilFail = source.stencilFail;
this.stencilZFail = source.stencilZFail;
this.stencilZPass = source.stencilZPass;
this.stencilWrite = source.stencilWrite;
var srcPlanes = source.clippingPlanes,
dstPlanes = null;
if ( srcPlanes !== null ) {
var n = srcPlanes.length;
dstPlanes = new Array( n );
for ( var i = 0; i !== n; ++ i )
dstPlanes[ i ] = srcPlanes[ i ].clone();
}
this.clippingPlanes = dstPlanes;
this.clipIntersection = source.clipIntersection;
this.clipShadows = source.clipShadows;
this.shadowSide = source.shadowSide;
this.colorWrite = source.colorWrite;
......@@ -390,26 +410,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
this.userData = JSON.parse( JSON.stringify( source.userData ) );
this.clipShadows = source.clipShadows;
this.clipIntersection = source.clipIntersection;
var srcPlanes = source.clippingPlanes,
dstPlanes = null;
if ( srcPlanes !== null ) {
var n = srcPlanes.length;
dstPlanes = new Array( n );
for ( var i = 0; i !== n; ++ i )
dstPlanes[ i ] = srcPlanes[ i ].clone();
}
this.clippingPlanes = dstPlanes;
this.shadowSide = source.shadowSide;
return this;
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册