How to use the gltf-pipeline.addCesiumRTC function in gltf-pipeline

To help you get started, we’ve selected a few gltf-pipeline examples, based on popular ways it is used in public projects.

github AnalyticalGraphicsInc / 3d-tiles-tools / tools / lib / optimizeGlb.js View on Github external
'use strict';
var Cesium = require('cesium');
var GltfPipeline = require('gltf-pipeline');

var Cartesian3 = Cesium.Cartesian3;
var DeveloperError = Cesium.DeveloperError;
var defaultValue = Cesium.defaultValue;
var defined = Cesium.defined;

var addCesiumRTC = GltfPipeline.addCesiumRTC;
var getBinaryGltf = GltfPipeline.getBinaryGltf;
var loadGltfUris = GltfPipeline.loadGltfUris;
var parseBinaryGltf = GltfPipeline.parseBinaryGltf;
var Pipeline = GltfPipeline.Pipeline;

module.exports = optimizeGlb;

 * Given an input buffer containing a binary glTF asset, optimize it using gltf-pipeline with the provided options
 * @param {Buffer} glbBuffer The buffer containing the binary glTF.
 * @param {Object} [options] Options specifying custom gltf-pipeline behavior.
 * @returns {Promise} A promise that resolves to the optimized binary glTF.
 * @private
function optimizeGlb(glbBuffer, options) {