gltf-bounding-box
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"name": "gltf-bounding-box", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Computes the global bounding box of a gltf model", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -15,8 +15,3 @@ "use strict"; | ||
if (primitivesCount > 1) { | ||
console.error( | ||
"gltfReader: Currently unable to load meshes with more than 1 primitive." | ||
); | ||
return null; | ||
} else if (primitivesCount === 0) { | ||
if (primitivesCount === 0) { | ||
console.error("gltfReader: Mesh has no primitive."); | ||
@@ -26,12 +21,15 @@ return null; | ||
const primitive = mesh.primitives[0]; | ||
const positions = []; | ||
mesh.primitives.forEach((primitive) => { | ||
// Attributes | ||
if (!primitive.attributes) return; | ||
// Attributes | ||
const attributes = {}; | ||
if (!primitive.attributes) return []; | ||
return gltfReader._loadAccessor( | ||
gltf, | ||
primitive.attributes.POSITION, | ||
buffers | ||
); | ||
positions.push(...gltfReader._loadAccessor( | ||
gltf, | ||
primitive.attributes.POSITION, | ||
buffers | ||
)); | ||
}) | ||
return positions; | ||
}, | ||
@@ -38,0 +36,0 @@ |
@@ -12,3 +12,3 @@ import gltf1BoundingBox from './gltf1-bounding-box'; | ||
computeBoundings(gltf, buffers={}) { | ||
if (gltf instanceof Buffer) { | ||
if (Boolean(gltf.readUInt32LE)) { | ||
const version = gltf.readUInt32LE(4); | ||
@@ -15,0 +15,0 @@ if (version === 2) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2609788
0
20080