@gltf-transform/core
Advanced tools
Comparing version 4.0.0-alpha.12 to 4.0.0-alpha.13
@@ -59,3 +59,3 @@ import { BufferViewUsage } from '../constants.js'; | ||
readonly accessorUsageGroupedByParent: Set<string>; | ||
readonly accessorParents: Map<Property<import("../properties/property.js").IProperty>, Set<Accessor>>; | ||
readonly accessorParents: Map<Property<import("core/src/properties/property.js").IProperty>, Set<Accessor>>; | ||
constructor(_doc: Document, jsonDoc: JSONDocument, options: Required<WriterOptions>); | ||
@@ -62,0 +62,0 @@ /** |
import { bbox } from '../constants.js'; | ||
import type { Node, Scene } from '../properties/index.js'; | ||
/** | ||
* Computes bounding box (AABB) in world space for the given {@link Node} or {@link Scene}. | ||
* | ||
* Example: | ||
* | ||
* ```ts | ||
* const {min, max} = getBounds(scene); | ||
* ``` | ||
*/ | ||
/** @hidden Implemented in /core for use by /extensions, publicly exported from /functions. */ | ||
export declare function getBounds(node: Node | Scene): bbox; |
{ | ||
"name": "@gltf-transform/core", | ||
"version": "4.0.0-alpha.12", | ||
"version": "4.0.0-alpha.13", | ||
"repository": "github:donmccurdy/glTF-Transform", | ||
@@ -54,3 +54,3 @@ "homepage": "https://gltf-transform.dev/", | ||
}, | ||
"gitHead": "28df1abd4360a833b6cb170955d6cddae66ca7f7" | ||
"gitHead": "e1040fa15cba3d6c753047e0a974ed3b4176e4d5" | ||
} |
@@ -242,2 +242,3 @@ import { | ||
let maxIndex = -Infinity; | ||
let needSparseWarning = false; | ||
@@ -272,6 +273,4 @@ // (1) Write accessor definitions, gathering indices and values. | ||
if (count > accessor.getCount() / 3) { | ||
// Too late to write non-sparse values in the proper buffer views here. | ||
const pct = ((100 * indices.length) / accessor.getCount()).toFixed(1); | ||
logger.warn(`Sparse accessor with many non-zero elements (${pct}%) may increase file size.`); | ||
if (count > accessor.getCount() / 2) { | ||
needSparseWarning = true; | ||
} | ||
@@ -290,2 +289,6 @@ | ||
if (needSparseWarning) { | ||
logger.warn(`Some sparse accessors have >50% non-zero elements, which may increase file size.`); | ||
} | ||
// (3) Write index buffer view. | ||
@@ -292,0 +295,0 @@ |
@@ -5,11 +5,3 @@ import { transformMat4 } from 'gl-matrix/vec3'; | ||
/** | ||
* Computes bounding box (AABB) in world space for the given {@link Node} or {@link Scene}. | ||
* | ||
* Example: | ||
* | ||
* ```ts | ||
* const {min, max} = getBounds(scene); | ||
* ``` | ||
*/ | ||
/** @hidden Implemented in /core for use by /extensions, publicly exported from /functions. */ | ||
export function getBounds(node: Node | Scene): bbox { | ||
@@ -16,0 +8,0 @@ const resultBounds = createBounds(); |
@@ -28,3 +28,3 @@ import { determinant, getRotation } from 'gl-matrix/mat4'; | ||
// TODO(v4): Compare performance if we replace the switch with individual functions. | ||
// TODO(perf): Compare performance if we replace the switch with individual functions. | ||
public static decodeNormalizedInt(i: number, componentType: GLTF.AccessorComponentType): number { | ||
@@ -48,3 +48,3 @@ // Hardcode enums from accessor.ts to avoid a circular dependency. | ||
// TODO(v4): Compare performance if we replace the switch with individual functions. | ||
// TODO(perf): Compare performance if we replace the switch with individual functions. | ||
public static encodeNormalizedInt(f: number, componentType: GLTF.AccessorComponentType): number { | ||
@@ -51,0 +51,0 @@ // Hardcode enums from accessor.ts to avoid a circular dependency. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2226435
30814