( scene, object )
| 21131 | }; |
| 21132 | |
| 21133 | function projectObject( scene, object ) { |
| 21134 | |
| 21135 | if ( object.visible === false ) return; |
| 21136 | |
| 21137 | if ( object instanceof THREE.Scene || object instanceof THREE.Group ) { |
| 21138 | |
| 21139 | // skip |
| 21140 | |
| 21141 | } else { |
| 21142 | |
| 21143 | initObject( object, scene ); |
| 21144 | |
| 21145 | if ( object instanceof THREE.Light ) { |
| 21146 | |
| 21147 | lights.push( object ); |
| 21148 | |
| 21149 | } else if ( object instanceof THREE.Sprite ) { |
| 21150 | |
| 21151 | sprites.push( object ); |
| 21152 | |
| 21153 | } else if ( object instanceof THREE.LensFlare ) { |
| 21154 | |
| 21155 | lensFlares.push( object ); |
| 21156 | |
| 21157 | } else { |
| 21158 | |
| 21159 | var webglObjects = _webglObjects[ object.id ]; |
| 21160 | |
| 21161 | if ( webglObjects && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) { |
| 21162 | |
| 21163 | updateObject( object, scene ); |
| 21164 | |
| 21165 | for ( var i = 0, l = webglObjects.length; i < l; i ++ ) { |
| 21166 | |
| 21167 | var webglObject = webglObjects[i]; |
| 21168 | |
| 21169 | unrollBufferMaterial( webglObject ); |
| 21170 | |
| 21171 | webglObject.render = true; |
| 21172 | |
| 21173 | if ( _this.sortObjects === true ) { |
| 21174 | |
| 21175 | if ( object.renderDepth !== null ) { |
| 21176 | |
| 21177 | webglObject.z = object.renderDepth; |
| 21178 | |
| 21179 | } else { |
| 21180 | |
| 21181 | _vector3.setFromMatrixPosition( object.matrixWorld ); |
| 21182 | _vector3.applyProjection( _projScreenMatrix ); |
| 21183 | |
| 21184 | webglObject.z = _vector3.z; |
| 21185 | |
| 21186 | } |
| 21187 | |
| 21188 | } |
| 21189 | |
| 21190 | } |
no test coverage detected