@gltf-transform/core
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -106,21 +106,11 @@ 'use strict'; | ||
var start = (bufferView.byteOffset || 0) + (accessor.byteOffset || 0); | ||
var elementSize; | ||
var data; | ||
switch (accessor.componentType) { | ||
case AccessorComponentType.FLOAT: | ||
elementSize = Float32Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Float32Array(data); | ||
return new Float32Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_INT: | ||
elementSize = Uint32Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint32Array(data); | ||
return new Uint32Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_SHORT: | ||
elementSize = Uint16Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint16Array(data); | ||
return new Uint16Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_BYTE: | ||
elementSize = Uint8Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint8Array(data); | ||
return new Uint8Array(resource, start, accessor.count * valueSize); | ||
default: | ||
@@ -165,3 +155,3 @@ throw new Error("Accessor componentType " + accessor.componentType + " not implemented."); | ||
Logger.prototype.info = function (text) { | ||
if (this.verbosity >= exports.LoggerVerbosity.INFO) { | ||
if (this.verbosity <= exports.LoggerVerbosity.INFO) { | ||
console.log(this.name + ": " + text); | ||
@@ -175,3 +165,3 @@ } | ||
Logger.prototype.warn = function (text) { | ||
if (this.verbosity >= exports.LoggerVerbosity.WARNING) { | ||
if (this.verbosity <= exports.LoggerVerbosity.WARNING) { | ||
console.warn(this.name + ": " + text); | ||
@@ -185,3 +175,3 @@ } | ||
Logger.prototype.error = function (text) { | ||
if (this.verbosity >= exports.LoggerVerbosity.ERROR) { | ||
if (this.verbosity <= exports.LoggerVerbosity.ERROR) { | ||
console.error(this.name + ": " + text); | ||
@@ -188,0 +178,0 @@ } |
@@ -102,21 +102,11 @@ var AccessorType = { | ||
var start = (bufferView.byteOffset || 0) + (accessor.byteOffset || 0); | ||
var elementSize; | ||
var data; | ||
switch (accessor.componentType) { | ||
case AccessorComponentType.FLOAT: | ||
elementSize = Float32Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Float32Array(data); | ||
return new Float32Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_INT: | ||
elementSize = Uint32Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint32Array(data); | ||
return new Uint32Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_SHORT: | ||
elementSize = Uint16Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint16Array(data); | ||
return new Uint16Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_BYTE: | ||
elementSize = Uint8Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint8Array(data); | ||
return new Uint8Array(resource, start, accessor.count * valueSize); | ||
default: | ||
@@ -162,3 +152,3 @@ throw new Error("Accessor componentType " + accessor.componentType + " not implemented."); | ||
Logger.prototype.info = function (text) { | ||
if (this.verbosity >= LoggerVerbosity.INFO) { | ||
if (this.verbosity <= LoggerVerbosity.INFO) { | ||
console.log(this.name + ": " + text); | ||
@@ -172,3 +162,3 @@ } | ||
Logger.prototype.warn = function (text) { | ||
if (this.verbosity >= LoggerVerbosity.WARNING) { | ||
if (this.verbosity <= LoggerVerbosity.WARNING) { | ||
console.warn(this.name + ": " + text); | ||
@@ -182,3 +172,3 @@ } | ||
Logger.prototype.error = function (text) { | ||
if (this.verbosity >= LoggerVerbosity.ERROR) { | ||
if (this.verbosity <= LoggerVerbosity.ERROR) { | ||
console.error(this.name + ": " + text); | ||
@@ -185,0 +175,0 @@ } |
@@ -108,21 +108,11 @@ (function (global, factory) { | ||
var start = (bufferView.byteOffset || 0) + (accessor.byteOffset || 0); | ||
var elementSize; | ||
var data; | ||
switch (accessor.componentType) { | ||
case AccessorComponentType.FLOAT: | ||
elementSize = Float32Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Float32Array(data); | ||
return new Float32Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_INT: | ||
elementSize = Uint32Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint32Array(data); | ||
return new Uint32Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_SHORT: | ||
elementSize = Uint16Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint16Array(data); | ||
return new Uint16Array(resource, start, accessor.count * valueSize); | ||
case AccessorComponentType.UNSIGNED_BYTE: | ||
elementSize = Uint8Array.BYTES_PER_ELEMENT; | ||
data = resource.slice(start, start + accessor.count * valueSize * elementSize); | ||
return new Uint8Array(data); | ||
return new Uint8Array(resource, start, accessor.count * valueSize); | ||
default: | ||
@@ -167,3 +157,3 @@ throw new Error("Accessor componentType " + accessor.componentType + " not implemented."); | ||
Logger.prototype.info = function (text) { | ||
if (this.verbosity >= exports.LoggerVerbosity.INFO) { | ||
if (this.verbosity <= exports.LoggerVerbosity.INFO) { | ||
console.log(this.name + ": " + text); | ||
@@ -177,3 +167,3 @@ } | ||
Logger.prototype.warn = function (text) { | ||
if (this.verbosity >= exports.LoggerVerbosity.WARNING) { | ||
if (this.verbosity <= exports.LoggerVerbosity.WARNING) { | ||
console.warn(this.name + ": " + text); | ||
@@ -187,3 +177,3 @@ } | ||
Logger.prototype.error = function (text) { | ||
if (this.verbosity >= exports.LoggerVerbosity.ERROR) { | ||
if (this.verbosity <= exports.LoggerVerbosity.ERROR) { | ||
console.error(this.name + ": " + text); | ||
@@ -190,0 +180,0 @@ } |
{ | ||
"name": "@gltf-transform/core", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"repository": "github:donmccurdy/glTF-Transform", | ||
@@ -28,3 +28,3 @@ "description": "JavaScript and TypeScript utilities for processing glTF 3D models", | ||
], | ||
"gitHead": "307e9d15746e9125f4377ad65433619e44448429" | ||
"gitHead": "0737e8fe1ca770cd98637f2daf9b02ac099d57a5" | ||
} |
Sorry, the diff of this file is not supported yet
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
22375
26
156848
3772