@@ -550,7 +550,7 @@ var Camera = new Class({
550550 {
551551 var object = renderableObjects [ index ] ;
552552
553- if ( ! object . hasOwnProperty ( 'width' ) )
553+ if ( ! object . hasOwnProperty ( 'width' ) || object . parentContainer )
554554 {
555555 culledObjects . push ( object ) ;
556556 continue ;
@@ -628,7 +628,7 @@ var Camera = new Class({
628628 {
629629 var object = interactiveObjects [ index ] . gameObject ;
630630
631- if ( ! object . hasOwnProperty ( 'width' ) )
631+ if ( ! object . hasOwnProperty ( 'width' ) || object . parentContainer )
632632 {
633633 culledObjects . push ( interactiveObjects [ index ] ) ;
634634 continue ;
@@ -655,73 +655,6 @@ var Camera = new Class({
655655 return culledObjects ;
656656 } ,
657657
658- /**
659- * [description]
660- *
661- * @method Phaser.Cameras.Scene2D.Camera#cullTilemap
662- * @since 3.0.0
663- *
664- * @param {Phaser.Tilemaps.Tilemap } tilemap - [description]
665- *
666- * @return {Phaser.GameObjects.GameObject[] } [description]
667- */
668- cullTilemap : function ( tilemap )
669- {
670- var cameraMatrix = this . matrix . matrix ;
671-
672- var mva = cameraMatrix [ 0 ] ;
673- var mvb = cameraMatrix [ 1 ] ;
674- var mvc = cameraMatrix [ 2 ] ;
675- var mvd = cameraMatrix [ 3 ] ;
676-
677- /* First Invert Matrix */
678- var determinant = ( mva * mvd ) - ( mvb * mvc ) ;
679-
680- var tiles = tilemap . tiles ;
681-
682- if ( ! determinant )
683- {
684- return tiles ;
685- }
686-
687- var mve = cameraMatrix [ 4 ] ;
688- var mvf = cameraMatrix [ 5 ] ;
689- var scrollX = this . scrollX ;
690- var scrollY = this . scrollY ;
691- var cameraW = this . width ;
692- var cameraH = this . height ;
693- var culledObjects = this . culledObjects ;
694- var length = tiles . length ;
695- var tileW = tilemap . tileWidth ;
696- var tileH = tilemap . tileHeight ;
697- var cullW = cameraW + tileW ;
698- var cullH = cameraH + tileH ;
699- var scrollFactorX = tilemap . scrollFactorX ;
700- var scrollFactorY = tilemap . scrollFactorY ;
701-
702- determinant = 1 / determinant ;
703-
704- culledObjects . length = 0 ;
705-
706- for ( var index = 0 ; index < length ; ++ index )
707- {
708- var tile = tiles [ index ] ;
709- var tileX = ( tile . x - ( scrollX * scrollFactorX ) ) ;
710- var tileY = ( tile . y - ( scrollY * scrollFactorY ) ) ;
711- var tx = ( tileX * mva + tileY * mvc + mve ) ;
712- var ty = ( tileX * mvb + tileY * mvd + mvf ) ;
713- var tw = ( ( tileX + tileW ) * mva + ( tileY + tileH ) * mvc + mve ) ;
714- var th = ( ( tileX + tileW ) * mvb + ( tileY + tileH ) * mvd + mvf ) ;
715-
716- if ( tx > - tileW && ty > - tileH && tw < cullW && th < cullH )
717- {
718- culledObjects . push ( tile ) ;
719- }
720- }
721-
722- return culledObjects ;
723- } ,
724-
725658 /**
726659 * Fades the Camera in from the given color over the duration specified.
727660 *
0 commit comments