MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / projectObject

Function projectObject

Three.js/js/Three56.js:6646–6727  ·  view source on GitHub ↗
( parent )

Source from the content-addressed store, hash-verified

6644 _renderData.lights.length = 0;
6645
6646 var projectObject = function ( parent ) {
6647
6648 for ( var c = 0, cl = parent.children.length; c < cl; c ++ ) {
6649
6650 var object = parent.children[ c ];
6651
6652 if ( object.visible === false ) continue;
6653
6654 if ( object instanceof THREE.Light ) {
6655
6656 _renderData.lights.push( object );
6657
6658 } else if ( object instanceof THREE.Mesh || object instanceof THREE.Line ) {
6659
6660 if ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) {
6661
6662 _object = getNextObjectInPool();
6663 _object.object = object;
6664
6665 if ( object.renderDepth !== null ) {
6666
6667 _object.z = object.renderDepth;
6668
6669 } else {
6670
6671 _vector3.getPositionFromMatrix( object.matrixWorld );
6672 _vector3.applyProjection( _viewProjectionMatrix );
6673 _object.z = _vector3.z;
6674
6675 }
6676
6677 _renderData.objects.push( _object );
6678
6679 }
6680
6681 } else if ( object instanceof THREE.Sprite || object instanceof THREE.Particle ) {
6682
6683 _object = getNextObjectInPool();
6684 _object.object = object;
6685
6686 // TODO: Find an elegant and performant solution and remove this dupe code.
6687
6688 if ( object.renderDepth !== null ) {
6689
6690 _object.z = object.renderDepth;
6691
6692 } else {
6693
6694 _vector3.getPositionFromMatrix( object.matrixWorld );
6695 _vector3.applyProjection( _viewProjectionMatrix );
6696 _object.z = _vector3.z;
6697
6698 }
6699
6700 _renderData.sprites.push( _object );
6701
6702 } else {
6703

Callers 1

projectGraphFunction · 0.70

Calls 1

getNextObjectInPoolFunction · 0.70

Tested by

no test coverage detected