diff --git a/Apps/Sandcastle/CesiumSandcastle.css b/Apps/Sandcastle/CesiumSandcastle.css index 2c87c1799c4e..5013fc8d8d93 100644 --- a/Apps/Sandcastle/CesiumSandcastle.css +++ b/Apps/Sandcastle/CesiumSandcastle.css @@ -138,7 +138,7 @@ html, body { height: 100%; transition-property: transform; transition-duration: 0.5s; - transform-origin: 200px 150px; + transform-origin: 200px 152px; /* These numbers should be divisible by 4 because of scaling in .makeThumbnail */ } .makeThumbnail { diff --git a/Apps/Sandcastle/gallery/development/3D Models Articulations.html b/Apps/Sandcastle/gallery/development/3D Models Articulations.html new file mode 100644 index 000000000000..3393d1b4a3b1 --- /dev/null +++ b/Apps/Sandcastle/gallery/development/3D Models Articulations.html @@ -0,0 +1,152 @@ + + + + + + + + + Cesium Demo + + + + + + +
+

Loading...

+
+
Articulation: + +
+ + + + + + + +
+ + +
+
+ + + diff --git a/Apps/Sandcastle/gallery/development/3D Models Articulations.jpg b/Apps/Sandcastle/gallery/development/3D Models Articulations.jpg new file mode 100644 index 000000000000..5d98733e8854 Binary files /dev/null and b/Apps/Sandcastle/gallery/development/3D Models Articulations.jpg differ diff --git a/CHANGES.md b/CHANGES.md index 345f06499a36..6f1d23b8fe28 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ Change Log * Added syntax to delete data from existing properties via CZML. [#7818](https://github.com/AnalyticalGraphicsInc/cesium/pull/7818) * Added `checkerboard` material to CZML. [#7845](https://github.com/AnalyticalGraphicsInc/cesium/pull/7845) * `BingMapsImageryProvider` now uses `DiscardEmptyTileImagePolicy` by default to detect missing tiles as zero-length responses instead of inspecting pixel values. [#7810](https://github.com/AnalyticalGraphicsInc/cesium/pull/7810) +* Added support for the [AGI_articulations](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/AGI_articulations) vendor extension of glTF 2.0 to the Model primitive graphics API. [#7835](https://github.com/AnalyticalGraphicsInc/cesium/pull/7835) * Reduce the number of Bing transactions and ion Bing sessions used when destroying and recreating the same imagery layer to 1. [#7848](https://github.com/AnalyticalGraphicsInc/cesium/pull/7848) ##### Fixes :wrench: diff --git a/Source/DataSources/ModelVisualizer.js b/Source/DataSources/ModelVisualizer.js index 3ce724f63523..06469ee82796 100644 --- a/Source/DataSources/ModelVisualizer.js +++ b/Source/DataSources/ModelVisualizer.js @@ -137,7 +137,6 @@ define([ url : resource.url, animationsRunning : false, nodeTransformationsScratch : {}, - originalNodeMatrixHash : {}, loadFail : false }; modelHash[entity.id] = modelData; @@ -179,7 +178,6 @@ define([ // Apply node transformations var nodeTransformations = Property.getValueOrUndefined(modelGraphics._nodeTransformations, time, modelData.nodeTransformationsScratch); if (defined(nodeTransformations)) { - var originalNodeMatrixHash = modelData.originalNodeMatrixHash; var nodeNames = Object.keys(nodeTransformations); for (var nodeIndex = 0, nodeLength = nodeNames.length; nodeIndex < nodeLength; ++nodeIndex) { var nodeName = nodeNames[nodeIndex]; @@ -194,14 +192,8 @@ define([ continue; } - var originalNodeMatrix = originalNodeMatrixHash[nodeName]; - if (!defined(originalNodeMatrix)) { - originalNodeMatrix = modelNode.matrix.clone(); - originalNodeMatrixHash[nodeName] = originalNodeMatrix; - } - var transformationMatrix = Matrix4.fromTranslationRotationScale(nodeTransformation, nodeMatrixScratch); - modelNode.matrix = Matrix4.multiply(originalNodeMatrix, transformationMatrix, transformationMatrix); + modelNode.matrix = Matrix4.multiply(modelNode.originalMatrix, transformationMatrix, transformationMatrix); } } } diff --git a/Source/Scene/Model.js b/Source/Scene/Model.js index 1892df92f71e..b85b12f86276 100644 --- a/Source/Scene/Model.js +++ b/Source/Scene/Model.js @@ -169,6 +169,8 @@ define([ // glTF MIME types discussed in https://github.com/KhronosGroup/glTF/issues/412 and https://github.com/KhronosGroup/glTF/issues/943 var defaultModelAccept = 'model/gltf-binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01'; + var articulationEpsilon = CesiumMath.EPSILON16; + /////////////////////////////////////////////////////////////////////////// function setCachedGltf(model, cachedGltf) { @@ -237,21 +239,23 @@ define([ * Cesium supports glTF assets with the following extensions: *