diff --git a/Specs/Cesium3DTilesTester.js b/Specs/Cesium3DTilesTester.js index 1e1d3cb5a24d..9f3c33b4323a 100644 --- a/Specs/Cesium3DTilesTester.js +++ b/Specs/Cesium3DTilesTester.js @@ -21,6 +21,7 @@ define([ var mockTile = { contentBoundingVolume : new TileBoundingSphere(), + _contentBoundingVolume : new TileBoundingSphere(), _header : { content : { boundingVolume : { diff --git a/Specs/Scene/Cesium3DTilesetSpec.js b/Specs/Scene/Cesium3DTilesetSpec.js index 5137391f4c5d..56c71f153f96 100644 --- a/Specs/Scene/Cesium3DTilesetSpec.js +++ b/Specs/Scene/Cesium3DTilesetSpec.js @@ -110,6 +110,7 @@ defineSuite([ }); beforeEach(function() { + scene.morphTo3D(0.0); originalMaximumRequests = RequestScheduler.maximumRequests; viewAllTiles(); }); @@ -305,6 +306,27 @@ defineSuite([ }); }); + it('renders tileset in CV', function() { + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function(tileset) { + scene.morphToColumbusView(0.0); + scene.renderForSpecs(); + var stats = tileset._statistics; + expect(stats.visited).toEqual(5); + expect(stats.numberOfCommands).toEqual(5); + }); + }); + + it('renders tileset in 2D', function() { + return Cesium3DTilesTester.loadTileset(scene, tilesetUrl).then(function(tileset) { + scene.morphTo2D(0.0); + tileset.maximumScreenSpaceError = 3; + scene.renderForSpecs(); + var stats = tileset._statistics; + expect(stats.visited).toEqual(5); + expect(stats.numberOfCommands).toEqual(10); + }); + }); + it('renders tileset with empty root tile', function() { return Cesium3DTilesTester.loadTileset(scene, tilesetEmptyRootUrl).then(function(tileset) { scene.renderForSpecs(); @@ -380,7 +402,7 @@ defineSuite([ scene.renderForSpecs(); expect(stats.visited).toEqual(0); expect(stats.numberOfCommands).toEqual(0); - expect(tileset._root.visibility(scene.frameState.cullingVolume, CullingVolume.MASK_INDETERMINATE)).toEqual(CullingVolume.MASK_OUTSIDE); + expect(tileset._root.visibility(scene.frameState, CullingVolume.MASK_INDETERMINATE)).toEqual(CullingVolume.MASK_OUTSIDE); }); }); @@ -1110,7 +1132,7 @@ defineSuite([ var spyUpdate = jasmine.createSpy('listener'); tileset.tileVisible.addEventListener(spyUpdate); scene.renderForSpecs(); - expect(tileset._root.visibility(scene.frameState.cullingVolume, CullingVolume.MASK_INDETERMINATE)).not.toEqual(CullingVolume.MASK_OUTSIDE); + expect(tileset._root.visibility(scene.frameState, CullingVolume.MASK_INDETERMINATE)).not.toEqual(CullingVolume.MASK_OUTSIDE); expect(spyUpdate.calls.count()).toEqual(1); expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset._root); }); @@ -1814,7 +1836,7 @@ defineSuite([ tileset.tileUnload.addEventListener(spyUpdate); scene.renderForSpecs(); - expect(tileset._root.visibility(scene.frameState.cullingVolume, CullingVolume.MASK_INDETERMINATE)).not.toEqual(CullingVolume.MASK_OUTSIDE); + expect(tileset._root.visibility(scene.frameState, CullingVolume.MASK_INDETERMINATE)).not.toEqual(CullingVolume.MASK_OUTSIDE); expect(spyUpdate.calls.count()).toEqual(4); expect(spyUpdate.calls.argsFor(0)[0]).toBe(tileset._root.children[0]); expect(spyUpdate.calls.argsFor(1)[0]).toBe(tileset._root.children[1]); diff --git a/Specs/Scene/PointCloud3DTileContentSpec.js b/Specs/Scene/PointCloud3DTileContentSpec.js index 8b6f4f2c56ac..35dd991e7053 100644 --- a/Specs/Scene/PointCloud3DTileContentSpec.js +++ b/Specs/Scene/PointCloud3DTileContentSpec.js @@ -52,11 +52,7 @@ defineSuite([ } beforeAll(function() { - // Point tiles use RTC, which for now requires scene3DOnly to be true - scene = createScene({ - scene3DOnly : true - }); - + scene = createScene(); scene.frameState.passes.render = true; }); @@ -65,6 +61,7 @@ defineSuite([ }); beforeEach(function() { + scene.morphTo3D(0.0); setCamera(centerLongitude, centerLatitude); }); @@ -259,6 +256,23 @@ defineSuite([ }); }); + it('renders in CV', function() { + return Cesium3DTilesTester.loadTileset(scene, pointCloudRGBUrl).then(function(tileset) { + scene.morphToColumbusView(0.0); + setCamera(centerLongitude, centerLatitude); + expectRenderPointCloud(tileset); + }); + }); + + it('renders in 2D', function() { + return Cesium3DTilesTester.loadTileset(scene, pointCloudRGBUrl).then(function(tileset) { + scene.morphTo2D(0.0); + setCamera(centerLongitude, centerLatitude); + tileset.maximumScreenSpaceError = 3; + expectRenderPointCloud(tileset); + }); + }); + it('picks', function() { return Cesium3DTilesTester.loadTileset(scene, pointCloudRGBUrl).then(function(tileset) { var content = tileset._root.content;