Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test glTF for required extensions. #4369

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Source/Scene/Model.js
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,7 @@ define([

var castShadows = ShadowMode.castShadows(model._shadows);
var receiveShadows = ShadowMode.receiveShadows(model._shadows);

var command = new DrawCommand({
boundingVolume : new BoundingSphere(), // updated in update()
cull : model.cull,
Expand Down Expand Up @@ -3420,11 +3420,11 @@ define([
}

function checkSupportedExtensions(model) {
var extensionsUsed = model.gltf.extensionsUsed;
if (defined(extensionsUsed)) {
var extensionsUsedCount = extensionsUsed.length;
for (var index=0;index<extensionsUsedCount;++index) {
var extension = extensionsUsed[index];
var extensionsRequired = model.gltf.extensionsRequired;
if (defined(extensionsRequired)) {
var extensionsRequiredCount = extensionsRequired.length;
for (var index=0;index<extensionsRequiredCount;++index) {
var extension = extensionsRequired[index];

if (extension !== 'CESIUM_RTC' && extension !== 'KHR_binary_glTF' &&
extension !== 'KHR_materials_common' && extension !== 'WEB3D_quantized_attributes') {
Expand Down
6 changes: 3 additions & 3 deletions Specs/Scene/ModelSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ defineSuite([

it('Throws because of invalid extension', function() {
return loadJson(boxUrl).then(function(gltf) {
gltf.extensionsUsed = ['NOT_supported_extension'];
gltf.extensionsRequired = ['NOT_supported_extension'];
var model = primitives.add(new Model({
gltf : gltf
}));
Expand All @@ -565,7 +565,7 @@ defineSuite([

it('Throws because of invalid extension', function() {
return loadJson(boxUrl).then(function(gltf) {
gltf.extensionsUsed = ['CESIUM_binary_glTF'];
gltf.extensionsRequired = ['CESIUM_binary_glTF'];
var model = primitives.add(new Model({
gltf : gltf
}));
Expand Down Expand Up @@ -1941,7 +1941,7 @@ defineSuite([
scene.renderForSpecs();
expect(scene.globe.removedCallback).toEqual(true);
expect(scene.globe.callback).not.toBeDefined();

primitives.remove(model);
});
});
Expand Down