Skip to content

Commit c0eaf28

Browse files
authored
Merge pull request #7050 from OmarShehata/gltf-update-pipeline
Fix tests in #6805
2 parents 015e700 + fb69626 commit c0eaf28

File tree

1 file changed

+43
-8
lines changed

1 file changed

+43
-8
lines changed

Specs/Scene/ModelSpec.js

+43-8
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ defineSuite([
186186
});
187187

188188
function addZoomTo(model) {
189-
model.zoomTo = function() {
189+
model.zoomTo = function(zoom) {
190+
zoom = defaultValue(zoom, 4.0);
191+
190192
var camera = scene.camera;
191193
var center = Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cartesian3());
192-
var r = 4.0 * Math.max(model.boundingSphere.radius, camera.frustum.near);
194+
var r = zoom * Math.max(model.boundingSphere.radius, camera.frustum.near);
193195
camera.lookAt(center, new HeadingPitchRange(0.0, 0.0, r));
194196
};
195197
}
@@ -2735,28 +2737,61 @@ defineSuite([
27352737

27362738
it('renders with the KHR_materials_pbrSpecularGlossiness extension', function() {
27372739
return loadModel(boomBoxPbrSpecularGlossinessUrl).then(function(model) {
2740+
model.show = false;
2741+
model.zoomTo(2.0);
2742+
2743+
var originalColor;
2744+
expect(scene).toRenderAndCall(function(rgba) {
2745+
originalColor = rgba;
2746+
});
2747+
27382748
model.show = true;
2739-
model.zoomTo();
27402749

2741-
scene.renderForSpecs();
2750+
expect(scene).toRenderAndCall(function(rgba) {
2751+
expect(rgba).not.toEqual(originalColor);
2752+
});
2753+
2754+
primitives.remove(model);
27422755
});
27432756
});
27442757

27452758
it('renders with the KHR_materials_pbrSpecularGlossiness extension with defaults', function() {
27462759
return loadModel(boomBoxPbrSpecularGlossinessDefaultsUrl).then(function(model) {
2760+
model.show = false;
2761+
model.zoomTo(2.0);
2762+
2763+
var originalColor;
2764+
expect(scene).toRenderAndCall(function(rgba) {
2765+
originalColor = rgba;
2766+
});
2767+
27472768
model.show = true;
2748-
model.zoomTo();
27492769

2750-
scene.renderForSpecs();
2770+
expect(scene).toRenderAndCall(function(rgba) {
2771+
expect(rgba).not.toEqual(originalColor);
2772+
});
2773+
2774+
primitives.remove(model);
27512775
});
27522776
});
27532777

27542778
it('renders with the KHR_materials_pbrSpecularGlossiness extension when no textures are found', function() {
27552779
return loadModel(boomBoxPbrSpecularGlossinessNoTextureUrl).then(function(model) {
2780+
model.show = false;
2781+
model.zoomTo(2.0);
2782+
2783+
var originalColor;
2784+
expect(scene).toRenderAndCall(function(rgba) {
2785+
originalColor = rgba;
2786+
});
2787+
27562788
model.show = true;
2757-
model.zoomTo();
27582789

2759-
scene.renderForSpecs();
2790+
expect(scene).toRenderAndCall(function(rgba) {
2791+
expect(rgba).not.toEqual(originalColor);
2792+
});
2793+
2794+
primitives.remove(model);
27602795
});
27612796
});
27622797

0 commit comments

Comments
 (0)