提交 2caaa3d7 编写于 作者: M Mugen87

OutlinePass: Honor visibility state

上级 bc3aa48e
......@@ -163,7 +163,21 @@ THREE.OutlinePass.prototype = Object.assign( Object.create( THREE.Pass.prototype
function gatherSelectedMeshesCallBack( object ) {
if ( object instanceof THREE.Mesh ) object.visible = bVisible;
if ( object.isMesh ) {
if ( bVisible ) {
object.visible = object.userData.oldVisible;
delete object.userData.oldVisible;
} else {
object.userData.oldVisible = object.visible;
object.visible = bVisible;
}
}
}
......@@ -182,7 +196,7 @@ THREE.OutlinePass.prototype = Object.assign( Object.create( THREE.Pass.prototype
function gatherSelectedMeshesCallBack( object ) {
if ( object instanceof THREE.Mesh ) selectedMeshes.push( object );
if ( object.isMesh ) selectedMeshes.push( object );
}
......@@ -195,7 +209,7 @@ THREE.OutlinePass.prototype = Object.assign( Object.create( THREE.Pass.prototype
function VisibilityChangeCallBack( object ) {
if ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.Sprite ) {
if ( object.isMesh || object.isLine || object.isSprite ) {
var bFound = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册