From 22a7f464603069e286d406f75795ef7eabbc3b13 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Thu, 12 Apr 2012 02:25:24 +0200 Subject: [PATCH] This should avoid people adding stuff that it's not an Object3D to the Scene Graph. Also, checking if the object is already a children is a bit redudant (the next lines code takes care of that indirectly). --- src/core/Object3D.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Object3D.js b/src/core/Object3D.js index 6c361cd877..97f3682404 100644 --- a/src/core/Object3D.js +++ b/src/core/Object3D.js @@ -114,7 +114,7 @@ THREE.Object3D.prototype = { } - if ( this.children.indexOf( object ) === - 1 ) { + if ( object instanceof THREE.Object3D ) { // && this.children.indexOf( object ) === - 1 if ( object.parent !== undefined ) { -- GitLab