Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var Cesium = require('cesium');
var gltfPipeline = require('gltf-pipeline');
var path = require('path');
var Promise = require('bluebird');
var getBufferPadded = require('./getBufferPadded');
var Cartesian3 = Cesium.Cartesian3;
var defaultValue = Cesium.defaultValue;
var defined = Cesium.defined;
var gltfToGlb = gltfPipeline.gltfToGlb;
module.exports = createGltf;
var rootDirectory = path.join(__dirname, '../');
var sizeOfUint8 = 1;
var sizeOfUint16 = 2;
var sizeOfFloat32 = 4;
/**
* Create a glTF from a Mesh.
*
* @param {Object} options An object with the following properties:
* @param {Mesh} options.mesh The mesh.
* @param {Boolean} [options.useBatchIds=true] Modify the glTF to include the batchId vertex attribute.
* @param {Boolean} [options.relativeToCenter=false] Set mesh positions relative to center.