MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / projectObject

Function projectObject

webgl/js/three.min.js:3593–3632  ·  view source on GitHub ↗
( object )

Source from the content-addressed store, hash-verified

3591 _renderData.lights.length = 0;
3592
3593 var projectObject = function ( object ) {
3594
3595 if ( object.visible === false ) return;
3596
3597 if ( ( object instanceof THREE.Mesh || object instanceof THREE.Line ) &&
3598 ( object.frustumCulled === false || _frustum.contains( object ) === true ) ) {
3599
3600 _vector3.copy( object.matrixWorld.getPosition() );
3601 _viewProjectionMatrix.multiplyVector3( _vector3 );
3602
3603 _object = getNextObjectInPool();
3604 _object.object = object;
3605 _object.z = _vector3.z;
3606
3607 _renderData.objects.push( _object );
3608
3609 } else if ( object instanceof THREE.Sprite || object instanceof THREE.Particle ) {
3610
3611 _vector3.copy( object.matrixWorld.getPosition() );
3612 _viewProjectionMatrix.multiplyVector3( _vector3 );
3613
3614 _object = getNextObjectInPool();
3615 _object.object = object;
3616 _object.z = _vector3.z;
3617
3618 _renderData.sprites.push( _object );
3619
3620 } else if ( object instanceof THREE.Light ) {
3621
3622 _renderData.lights.push( object );
3623
3624 }
3625
3626 for ( var c = 0, cl = object.children.length; c < cl; c ++ ) {
3627
3628 projectObject( object.children[ c ] );
3629
3630 }
3631
3632 };
3633
3634 projectObject( root );
3635

Callers 1

projectGraphFunction · 0.85

Calls 1

getNextObjectInPoolFunction · 0.85

Tested by

no test coverage detected