diff --git a/src/util/transferable.js b/src/util/transferable.js index c54c011f0..0b8e27655 100644 --- a/src/util/transferable.js +++ b/src/util/transferable.js @@ -93,18 +93,18 @@ var transferableUtil = { options.boundingBox = new BoundingBox(min, max); } + const geometry = new Geometry(options); + //attributes - var attributes = {}; for (var p in object.attributes) { if (object.attributes.hasOwnProperty(p)) { var attr = object.attributes[p]; - attributes[p] = new Geometry.Attribute(attr.name, attr.type, attr.size, attr.semantic); - attributes[p].value = attr.value; + geometry.attributes[p] = new Geometry.Attribute(attr.name, attr.type, attr.size, attr.semantic); + geometry.attributes[p].value = attr.value; } } - options.attributes = attributes; - return new Geometry(options); + return geometry; } } diff --git a/test/unit/util/transferable.spec.js b/test/unit/util/transferable.spec.js index 93de08eb0..9e7e8427e 100644 --- a/test/unit/util/transferable.spec.js +++ b/test/unit/util/transferable.spec.js @@ -74,5 +74,7 @@ describe('util.transferable.Spec', function () { assert(geometry.getAttribute('position').value.length === 156); assert(geometry.getAttribute('texcoord0').value.length === 104); assert(geometry.getAttribute('normal').value.length === 156); + assert(geometry.getAttribute('texcoord0')); + assert(geometry.getAttribute('texcoord1')); }); });