@@ -9,6 +9,7 @@ defineSuite([
9
9
'Core/Ellipsoid' ,
10
10
'Core/GeographicProjection' ,
11
11
'Core/GeometryInstance' ,
12
+ 'Core/HeadingPitchRoll' ,
12
13
'Core/JulianDate' ,
13
14
'Core/Math' ,
14
15
'Core/PerspectiveFrustum' ,
@@ -53,6 +54,7 @@ defineSuite([
53
54
Ellipsoid ,
54
55
GeographicProjection ,
55
56
GeometryInstance ,
57
+ HeadingPitchRoll ,
56
58
JulianDate ,
57
59
CesiumMath ,
58
60
PerspectiveFrustum ,
@@ -487,7 +489,7 @@ defineSuite([
487
489
scene . globe = globe ;
488
490
expect ( globe . isDestroyed ( ) ) . toEqual ( false ) ;
489
491
490
- scene . globe = null ;
492
+ scene . globe = undefined ;
491
493
expect ( globe . isDestroyed ( ) ) . toEqual ( true ) ;
492
494
493
495
scene . destroyForSpecs ( ) ;
@@ -1643,4 +1645,48 @@ defineSuite([
1643
1645
1644
1646
scene . destroyForSpecs ( ) ;
1645
1647
} ) ;
1648
+
1649
+ function getFrustumCommandsLength ( scene ) {
1650
+ var commandsLength = 0 ;
1651
+ var frustumCommandsList = scene . _frustumCommandsList ;
1652
+ var frustumsLength = frustumCommandsList . length ;
1653
+ for ( var i = 0 ; i < frustumsLength ; ++ i ) {
1654
+ var frustumCommands = frustumCommandsList [ i ] ;
1655
+ for ( var j = 0 ; j < Pass . NUMBER_OF_PASSES ; ++ j ) {
1656
+ commandsLength += frustumCommands . indices [ j ] ;
1657
+ }
1658
+ }
1659
+ return commandsLength ;
1660
+ }
1661
+
1662
+ it ( 'occludes primitive' , function ( ) {
1663
+ var scene = createScene ( ) ;
1664
+ scene . globe = new Globe ( Ellipsoid . WGS84 ) ;
1665
+
1666
+ var rectangle = Rectangle . fromDegrees ( - 100.0 , 30.0 , - 90.0 , 40.0 ) ;
1667
+ var rectanglePrimitive = createRectangle ( rectangle , 10 ) ;
1668
+ scene . primitives . add ( rectanglePrimitive ) ;
1669
+
1670
+ scene . camera . setView ( {
1671
+ destination : new Cartesian3 ( - 588536.1057451078 , - 10512475.371849751 , 6737159.100747835 ) ,
1672
+ orientation : new HeadingPitchRoll ( 6.283185307179586 , - 1.5688261558859757 , 0.0 )
1673
+ } ) ;
1674
+ scene . renderForSpecs ( ) ;
1675
+ expect ( getFrustumCommandsLength ( scene ) ) . toBe ( 1 ) ;
1676
+
1677
+ scene . camera . setView ( {
1678
+ destination : new Cartesian3 ( - 5754647.167415793 , 14907694.100240812 , - 483807.2406259497 ) ,
1679
+ orientation : new HeadingPitchRoll ( 6.283185307179586 , - 1.5698869547885104 , 0.0 )
1680
+ } ) ;
1681
+ scene . renderForSpecs ( ) ;
1682
+ expect ( getFrustumCommandsLength ( scene ) ) . toBe ( 0 ) ;
1683
+
1684
+ // Still on opposite side of globe but now show is false, the command should not be occluded anymore
1685
+ scene . globe . show = false ;
1686
+ scene . renderForSpecs ( ) ;
1687
+ expect ( getFrustumCommandsLength ( scene ) ) . toBe ( 1 ) ;
1688
+
1689
+ scene . destroyForSpecs ( ) ;
1690
+ } ) ;
1691
+
1646
1692
} , 'WebGL' ) ;
0 commit comments