dist/claygl.es.js
function (object) {
        if (!object) {
            return null;
        }
        if (object.data && object.buffers) {
            return transferableUtil.toGeometry(object.data);
        }
        if (!object.metadata || object.metadata.generator !== META.generator) {
            throw new Error('[util.transferable.toGeometry] the object is not generated by util.transferable.');
        }

        //basic options
        var options = {
            dynamic : object.dynamic,
            indices : object.indices
        };

        if (object.boundingBox) {
            var min = new Vector3().setArray(object.boundingBox.min);
            var max = new Vector3().setArray(object.boundingBox.max);
            options.boundingBox = new BoundingBox(min, max);
        }

        var geometry = new Geometry(options);

        //attributes
        for (var p in object.attributes) {
            if (object.attributes.hasOwnProperty(p)) {
                var attr = object.attributes[p];
                geometry.attributes[p] = new Geometry.Attribute(attr.name, attr.type, attr.size, attr.semantic);
                geometry.attributes[p].value = attr.value;
            }
        }

        return geometry;
    }
function (object) {
        if (!object) {
            return null;
        }
        if (object.data && object.buffers) {
            return transferableUtil.toGeometry(object.data);
        }
        if (!object.metadata || object.metadata.generator !== META.generator) {
            throw new Error('[util.transferable.toGeometry] the object is not generated by util.transferable.');
        }

        //basic options
        var options = {
            dynamic : object.dynamic,
            indices : object.indices
        };

        if (object.boundingBox) {
            var min = new Vector3().setArray(object.boundingBox.min);
            var max = new Vector3().setArray(object.boundingBox.max);
            options.boundingBox = new BoundingBox(min, max);
        }

        var geometry = new Geometry(options);

        //attributes
        for (var p in object.attributes) {
            if (object.attributes.hasOwnProperty(p)) {
                var attr = object.attributes[p];
                geometry.attributes[p] = new Geometry.Attribute(attr.name, attr.type, attr.size, attr.semantic);
                geometry.attributes[p].value = attr.value;
            }
        }

        return geometry;
    }
function ( object ) { if ( ! object ) { return null ; } if ( object . data && object . buffers ) { return transferableUtil . toGeometry ( object . data ) ; } if ( ! object . metadata || object . metadata . generator !== META . generator ) { throw new Error ( '[util.transferable.toGeometry] the object is not generated by util.transferable.' ) ; } //basic options var options = { dynamic : object . dynamic , indices : object . indices } ; if ( object . boundingBox ) { var min = new Vector3 ( ) . setArray ( object . boundingBox . min ) ; var max = new Vector3 ( ) . setArray ( object . boundingBox . max ) ; options . boundingBox = new BoundingBox ( min , max ) ; } var geometry = new Geometry ( options ) ; //attributes for ( var p in object . attributes ) { if ( object . attributes . hasOwnProperty ( p ) ) { var attr = object . attributes [ p ] ; geometry . attributes [ p ] = new Geometry . Attribute ( attr . name , attr . type , attr . size , attr . semantic ) ; geometry . attributes [ p ] . value = attr . value ; } } return geometry ; }
Reproduce a geometry from object generated by toObject
@param {Object} object object generated by toObject
@returns {Geometry} geometry
Reproduce a geometry from object generated by toObject