提交 7695c253 编写于 作者: G gero3

update to make it less dependaned

上级 57b94936
...@@ -45,40 +45,24 @@ THREE.Material.prototype.setValues = function ( values ) { ...@@ -45,40 +45,24 @@ THREE.Material.prototype.setValues = function ( values ) {
var value = values[ key ]; var value = values[ key ];
if ( this[ key ] !== undefined ) { if ( this[ key ] !== undefined && key !== "id") {
switch ( key ) { if (this[key] instanceof THREE.Color) {
case "id": if ( value instanceof THREE.Color ) {
break;
case "color":
case "ambient":
case "emissive":
case "specular":
if ( value instanceof THREE.Color ) {
this[ key ].copy( value );
} else {
this[ key ].setHex( value );
}
break;
case "wrapRGB":
this[ key ].copy( value ); this[ key ].copy( value );
break; } else {
default:
this[ key ] = value; this[ key ].setHex( value );
}
} else if (this[key] instanceof THREE.Vector3){
this[ key ].copy( value );
} else {
this[ key ] = value;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册