roavatar-renderer 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +118 -126
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15991,76 +15991,76 @@ class PropertyBinding {
|
|
|
15991
15991
|
_setValue_unavailable() {
|
|
15992
15992
|
}
|
|
15993
15993
|
// Getters
|
|
15994
|
-
_getValue_direct(
|
|
15995
|
-
|
|
15994
|
+
_getValue_direct(buffer2, offset) {
|
|
15995
|
+
buffer2[offset] = this.targetObject[this.propertyName];
|
|
15996
15996
|
}
|
|
15997
|
-
_getValue_array(
|
|
15997
|
+
_getValue_array(buffer2, offset) {
|
|
15998
15998
|
const source = this.resolvedProperty;
|
|
15999
15999
|
for (let i = 0, n = source.length; i !== n; ++i) {
|
|
16000
|
-
|
|
16000
|
+
buffer2[offset++] = source[i];
|
|
16001
16001
|
}
|
|
16002
16002
|
}
|
|
16003
|
-
_getValue_arrayElement(
|
|
16004
|
-
|
|
16003
|
+
_getValue_arrayElement(buffer2, offset) {
|
|
16004
|
+
buffer2[offset] = this.resolvedProperty[this.propertyIndex];
|
|
16005
16005
|
}
|
|
16006
|
-
_getValue_toArray(
|
|
16007
|
-
this.resolvedProperty.toArray(
|
|
16006
|
+
_getValue_toArray(buffer2, offset) {
|
|
16007
|
+
this.resolvedProperty.toArray(buffer2, offset);
|
|
16008
16008
|
}
|
|
16009
16009
|
// Direct
|
|
16010
|
-
_setValue_direct(
|
|
16011
|
-
this.targetObject[this.propertyName] =
|
|
16010
|
+
_setValue_direct(buffer2, offset) {
|
|
16011
|
+
this.targetObject[this.propertyName] = buffer2[offset];
|
|
16012
16012
|
}
|
|
16013
|
-
_setValue_direct_setNeedsUpdate(
|
|
16014
|
-
this.targetObject[this.propertyName] =
|
|
16013
|
+
_setValue_direct_setNeedsUpdate(buffer2, offset) {
|
|
16014
|
+
this.targetObject[this.propertyName] = buffer2[offset];
|
|
16015
16015
|
this.targetObject.needsUpdate = true;
|
|
16016
16016
|
}
|
|
16017
|
-
_setValue_direct_setMatrixWorldNeedsUpdate(
|
|
16018
|
-
this.targetObject[this.propertyName] =
|
|
16017
|
+
_setValue_direct_setMatrixWorldNeedsUpdate(buffer2, offset) {
|
|
16018
|
+
this.targetObject[this.propertyName] = buffer2[offset];
|
|
16019
16019
|
this.targetObject.matrixWorldNeedsUpdate = true;
|
|
16020
16020
|
}
|
|
16021
16021
|
// EntireArray
|
|
16022
|
-
_setValue_array(
|
|
16022
|
+
_setValue_array(buffer2, offset) {
|
|
16023
16023
|
const dest = this.resolvedProperty;
|
|
16024
16024
|
for (let i = 0, n = dest.length; i !== n; ++i) {
|
|
16025
|
-
dest[i] =
|
|
16025
|
+
dest[i] = buffer2[offset++];
|
|
16026
16026
|
}
|
|
16027
16027
|
}
|
|
16028
|
-
_setValue_array_setNeedsUpdate(
|
|
16028
|
+
_setValue_array_setNeedsUpdate(buffer2, offset) {
|
|
16029
16029
|
const dest = this.resolvedProperty;
|
|
16030
16030
|
for (let i = 0, n = dest.length; i !== n; ++i) {
|
|
16031
|
-
dest[i] =
|
|
16031
|
+
dest[i] = buffer2[offset++];
|
|
16032
16032
|
}
|
|
16033
16033
|
this.targetObject.needsUpdate = true;
|
|
16034
16034
|
}
|
|
16035
|
-
_setValue_array_setMatrixWorldNeedsUpdate(
|
|
16035
|
+
_setValue_array_setMatrixWorldNeedsUpdate(buffer2, offset) {
|
|
16036
16036
|
const dest = this.resolvedProperty;
|
|
16037
16037
|
for (let i = 0, n = dest.length; i !== n; ++i) {
|
|
16038
|
-
dest[i] =
|
|
16038
|
+
dest[i] = buffer2[offset++];
|
|
16039
16039
|
}
|
|
16040
16040
|
this.targetObject.matrixWorldNeedsUpdate = true;
|
|
16041
16041
|
}
|
|
16042
16042
|
// ArrayElement
|
|
16043
|
-
_setValue_arrayElement(
|
|
16044
|
-
this.resolvedProperty[this.propertyIndex] =
|
|
16043
|
+
_setValue_arrayElement(buffer2, offset) {
|
|
16044
|
+
this.resolvedProperty[this.propertyIndex] = buffer2[offset];
|
|
16045
16045
|
}
|
|
16046
|
-
_setValue_arrayElement_setNeedsUpdate(
|
|
16047
|
-
this.resolvedProperty[this.propertyIndex] =
|
|
16046
|
+
_setValue_arrayElement_setNeedsUpdate(buffer2, offset) {
|
|
16047
|
+
this.resolvedProperty[this.propertyIndex] = buffer2[offset];
|
|
16048
16048
|
this.targetObject.needsUpdate = true;
|
|
16049
16049
|
}
|
|
16050
|
-
_setValue_arrayElement_setMatrixWorldNeedsUpdate(
|
|
16051
|
-
this.resolvedProperty[this.propertyIndex] =
|
|
16050
|
+
_setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer2, offset) {
|
|
16051
|
+
this.resolvedProperty[this.propertyIndex] = buffer2[offset];
|
|
16052
16052
|
this.targetObject.matrixWorldNeedsUpdate = true;
|
|
16053
16053
|
}
|
|
16054
16054
|
// HasToFromArray
|
|
16055
|
-
_setValue_fromArray(
|
|
16056
|
-
this.resolvedProperty.fromArray(
|
|
16055
|
+
_setValue_fromArray(buffer2, offset) {
|
|
16056
|
+
this.resolvedProperty.fromArray(buffer2, offset);
|
|
16057
16057
|
}
|
|
16058
|
-
_setValue_fromArray_setNeedsUpdate(
|
|
16059
|
-
this.resolvedProperty.fromArray(
|
|
16058
|
+
_setValue_fromArray_setNeedsUpdate(buffer2, offset) {
|
|
16059
|
+
this.resolvedProperty.fromArray(buffer2, offset);
|
|
16060
16060
|
this.targetObject.needsUpdate = true;
|
|
16061
16061
|
}
|
|
16062
|
-
_setValue_fromArray_setMatrixWorldNeedsUpdate(
|
|
16063
|
-
this.resolvedProperty.fromArray(
|
|
16062
|
+
_setValue_fromArray_setMatrixWorldNeedsUpdate(buffer2, offset) {
|
|
16063
|
+
this.resolvedProperty.fromArray(buffer2, offset);
|
|
16064
16064
|
this.targetObject.matrixWorldNeedsUpdate = true;
|
|
16065
16065
|
}
|
|
16066
16066
|
_getValue_unbound(targetArray, offset) {
|
|
@@ -16630,8 +16630,8 @@ function WebGLAttributes(gl) {
|
|
|
16630
16630
|
const array = attribute.array;
|
|
16631
16631
|
const usage = attribute.usage;
|
|
16632
16632
|
const size = array.byteLength;
|
|
16633
|
-
const
|
|
16634
|
-
gl.bindBuffer(bufferType,
|
|
16633
|
+
const buffer2 = gl.createBuffer();
|
|
16634
|
+
gl.bindBuffer(bufferType, buffer2);
|
|
16635
16635
|
gl.bufferData(bufferType, array, usage);
|
|
16636
16636
|
attribute.onUploadCallback();
|
|
16637
16637
|
let type;
|
|
@@ -16661,17 +16661,17 @@ function WebGLAttributes(gl) {
|
|
|
16661
16661
|
throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: " + array);
|
|
16662
16662
|
}
|
|
16663
16663
|
return {
|
|
16664
|
-
buffer,
|
|
16664
|
+
buffer: buffer2,
|
|
16665
16665
|
type,
|
|
16666
16666
|
bytesPerElement: array.BYTES_PER_ELEMENT,
|
|
16667
16667
|
version: attribute.version,
|
|
16668
16668
|
size
|
|
16669
16669
|
};
|
|
16670
16670
|
}
|
|
16671
|
-
function updateBuffer(
|
|
16671
|
+
function updateBuffer(buffer2, attribute, bufferType) {
|
|
16672
16672
|
const array = attribute.array;
|
|
16673
16673
|
const updateRanges = attribute.updateRanges;
|
|
16674
|
-
gl.bindBuffer(bufferType,
|
|
16674
|
+
gl.bindBuffer(bufferType, buffer2);
|
|
16675
16675
|
if (updateRanges.length === 0) {
|
|
16676
16676
|
gl.bufferSubData(bufferType, 0, array);
|
|
16677
16677
|
} else {
|
|
@@ -17826,7 +17826,7 @@ function WebGLBindingStates(gl, attributes) {
|
|
|
17826
17826
|
const size = geometryAttribute.itemSize;
|
|
17827
17827
|
const attribute = attributes.get(geometryAttribute);
|
|
17828
17828
|
if (attribute === void 0) continue;
|
|
17829
|
-
const
|
|
17829
|
+
const buffer2 = attribute.buffer;
|
|
17830
17830
|
const type = attribute.type;
|
|
17831
17831
|
const bytesPerElement = attribute.bytesPerElement;
|
|
17832
17832
|
const integer = type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType;
|
|
@@ -17846,7 +17846,7 @@ function WebGLBindingStates(gl, attributes) {
|
|
|
17846
17846
|
enableAttribute(programAttribute.location + i);
|
|
17847
17847
|
}
|
|
17848
17848
|
}
|
|
17849
|
-
gl.bindBuffer(gl.ARRAY_BUFFER,
|
|
17849
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer2);
|
|
17850
17850
|
for (let i = 0; i < programAttribute.locationSize; i++) {
|
|
17851
17851
|
vertexAttribPointer(
|
|
17852
17852
|
programAttribute.location + i,
|
|
@@ -17871,7 +17871,7 @@ function WebGLBindingStates(gl, attributes) {
|
|
|
17871
17871
|
enableAttribute(programAttribute.location + i);
|
|
17872
17872
|
}
|
|
17873
17873
|
}
|
|
17874
|
-
gl.bindBuffer(gl.ARRAY_BUFFER,
|
|
17874
|
+
gl.bindBuffer(gl.ARRAY_BUFFER, buffer2);
|
|
17875
17875
|
for (let i = 0; i < programAttribute.locationSize; i++) {
|
|
17876
17876
|
vertexAttribPointer(
|
|
17877
17877
|
programAttribute.location + i,
|
|
@@ -19242,8 +19242,8 @@ function WebGLMorphtargets(gl, capabilities, textures) {
|
|
|
19242
19242
|
height = Math.ceil(width / capabilities.maxTextureSize);
|
|
19243
19243
|
width = capabilities.maxTextureSize;
|
|
19244
19244
|
}
|
|
19245
|
-
const
|
|
19246
|
-
const texture = new DataArrayTexture(
|
|
19245
|
+
const buffer2 = new Float32Array(width * height * 4 * morphTargetsCount);
|
|
19246
|
+
const texture = new DataArrayTexture(buffer2, width, height, morphTargetsCount);
|
|
19247
19247
|
texture.type = FloatType;
|
|
19248
19248
|
texture.needsUpdate = true;
|
|
19249
19249
|
const vertexDataStride = vertexDataCount * 4;
|
|
@@ -19256,24 +19256,24 @@ function WebGLMorphtargets(gl, capabilities, textures) {
|
|
|
19256
19256
|
const stride = j * vertexDataStride;
|
|
19257
19257
|
if (hasMorphPosition === true) {
|
|
19258
19258
|
morph.fromBufferAttribute(morphTarget, j);
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19259
|
+
buffer2[offset + stride + 0] = morph.x;
|
|
19260
|
+
buffer2[offset + stride + 1] = morph.y;
|
|
19261
|
+
buffer2[offset + stride + 2] = morph.z;
|
|
19262
|
+
buffer2[offset + stride + 3] = 0;
|
|
19263
19263
|
}
|
|
19264
19264
|
if (hasMorphNormals === true) {
|
|
19265
19265
|
morph.fromBufferAttribute(morphNormal, j);
|
|
19266
|
-
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19266
|
+
buffer2[offset + stride + 4] = morph.x;
|
|
19267
|
+
buffer2[offset + stride + 5] = morph.y;
|
|
19268
|
+
buffer2[offset + stride + 6] = morph.z;
|
|
19269
|
+
buffer2[offset + stride + 7] = 0;
|
|
19270
19270
|
}
|
|
19271
19271
|
if (hasMorphColors === true) {
|
|
19272
19272
|
morph.fromBufferAttribute(morphColor, j);
|
|
19273
|
-
|
|
19274
|
-
|
|
19275
|
-
|
|
19276
|
-
|
|
19273
|
+
buffer2[offset + stride + 8] = morph.x;
|
|
19274
|
+
buffer2[offset + stride + 9] = morph.y;
|
|
19275
|
+
buffer2[offset + stride + 10] = morph.z;
|
|
19276
|
+
buffer2[offset + stride + 11] = morphColor.itemSize === 4 ? morph.w : 1;
|
|
19277
19277
|
}
|
|
19278
19278
|
}
|
|
19279
19279
|
}
|
|
@@ -24986,11 +24986,11 @@ function WebGLUniformsGroups(gl, info, capabilities, state) {
|
|
|
24986
24986
|
state.uniformBlockBinding(uniformsGroup, webglProgram);
|
|
24987
24987
|
}
|
|
24988
24988
|
function update(uniformsGroup, program) {
|
|
24989
|
-
let
|
|
24990
|
-
if (
|
|
24989
|
+
let buffer2 = buffers[uniformsGroup.id];
|
|
24990
|
+
if (buffer2 === void 0) {
|
|
24991
24991
|
prepareUniformsGroup(uniformsGroup);
|
|
24992
|
-
|
|
24993
|
-
buffers[uniformsGroup.id] =
|
|
24992
|
+
buffer2 = createBuffer(uniformsGroup);
|
|
24993
|
+
buffers[uniformsGroup.id] = buffer2;
|
|
24994
24994
|
uniformsGroup.addEventListener("dispose", onUniformsGroupsDispose);
|
|
24995
24995
|
}
|
|
24996
24996
|
const webglProgram = program.program;
|
|
@@ -25004,14 +25004,14 @@ function WebGLUniformsGroups(gl, info, capabilities, state) {
|
|
|
25004
25004
|
function createBuffer(uniformsGroup) {
|
|
25005
25005
|
const bindingPointIndex = allocateBindingPointIndex();
|
|
25006
25006
|
uniformsGroup.__bindingPointIndex = bindingPointIndex;
|
|
25007
|
-
const
|
|
25007
|
+
const buffer2 = gl.createBuffer();
|
|
25008
25008
|
const size = uniformsGroup.__size;
|
|
25009
25009
|
const usage = uniformsGroup.usage;
|
|
25010
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER,
|
|
25010
|
+
gl.bindBuffer(gl.UNIFORM_BUFFER, buffer2);
|
|
25011
25011
|
gl.bufferData(gl.UNIFORM_BUFFER, size, usage);
|
|
25012
25012
|
gl.bindBuffer(gl.UNIFORM_BUFFER, null);
|
|
25013
|
-
gl.bindBufferBase(gl.UNIFORM_BUFFER, bindingPointIndex,
|
|
25014
|
-
return
|
|
25013
|
+
gl.bindBufferBase(gl.UNIFORM_BUFFER, bindingPointIndex, buffer2);
|
|
25014
|
+
return buffer2;
|
|
25015
25015
|
}
|
|
25016
25016
|
function allocateBindingPointIndex() {
|
|
25017
25017
|
for (let i = 0; i < maxBindingPoints; i++) {
|
|
@@ -25024,10 +25024,10 @@ function WebGLUniformsGroups(gl, info, capabilities, state) {
|
|
|
25024
25024
|
return 0;
|
|
25025
25025
|
}
|
|
25026
25026
|
function updateBufferData(uniformsGroup) {
|
|
25027
|
-
const
|
|
25027
|
+
const buffer2 = buffers[uniformsGroup.id];
|
|
25028
25028
|
const uniforms = uniformsGroup.uniforms;
|
|
25029
25029
|
const cache = uniformsGroup.__cache;
|
|
25030
|
-
gl.bindBuffer(gl.UNIFORM_BUFFER,
|
|
25030
|
+
gl.bindBuffer(gl.UNIFORM_BUFFER, buffer2);
|
|
25031
25031
|
for (let i = 0, il = uniforms.length; i < il; i++) {
|
|
25032
25032
|
const uniformArray = Array.isArray(uniforms[i]) ? uniforms[i] : [uniforms[i]];
|
|
25033
25033
|
for (let j = 0, jl = uniformArray.length; j < jl; j++) {
|
|
@@ -26416,7 +26416,7 @@ class WebGLRenderer {
|
|
|
26416
26416
|
}
|
|
26417
26417
|
_currentMaterialId = -1;
|
|
26418
26418
|
};
|
|
26419
|
-
this.readRenderTargetPixels = function(renderTarget, x, y, width, height,
|
|
26419
|
+
this.readRenderTargetPixels = function(renderTarget, x, y, width, height, buffer2, activeCubeFaceIndex, textureIndex = 0) {
|
|
26420
26420
|
if (!(renderTarget && renderTarget.isWebGLRenderTarget)) {
|
|
26421
26421
|
console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
|
|
26422
26422
|
return;
|
|
@@ -26441,7 +26441,7 @@ class WebGLRenderer {
|
|
|
26441
26441
|
}
|
|
26442
26442
|
if (x >= 0 && x <= renderTarget.width - width && (y >= 0 && y <= renderTarget.height - height)) {
|
|
26443
26443
|
if (renderTarget.textures.length > 1) _gl.readBuffer(_gl.COLOR_ATTACHMENT0 + textureIndex);
|
|
26444
|
-
_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType),
|
|
26444
|
+
_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer2);
|
|
26445
26445
|
}
|
|
26446
26446
|
} finally {
|
|
26447
26447
|
const framebuffer2 = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null;
|
|
@@ -26449,7 +26449,7 @@ class WebGLRenderer {
|
|
|
26449
26449
|
}
|
|
26450
26450
|
}
|
|
26451
26451
|
};
|
|
26452
|
-
this.readRenderTargetPixelsAsync = async function(renderTarget, x, y, width, height,
|
|
26452
|
+
this.readRenderTargetPixelsAsync = async function(renderTarget, x, y, width, height, buffer2, activeCubeFaceIndex, textureIndex = 0) {
|
|
26453
26453
|
if (!(renderTarget && renderTarget.isWebGLRenderTarget)) {
|
|
26454
26454
|
throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
|
|
26455
26455
|
}
|
|
@@ -26471,7 +26471,7 @@ class WebGLRenderer {
|
|
|
26471
26471
|
}
|
|
26472
26472
|
const glBuffer = _gl.createBuffer();
|
|
26473
26473
|
_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER, glBuffer);
|
|
26474
|
-
_gl.bufferData(_gl.PIXEL_PACK_BUFFER,
|
|
26474
|
+
_gl.bufferData(_gl.PIXEL_PACK_BUFFER, buffer2.byteLength, _gl.STREAM_READ);
|
|
26475
26475
|
if (renderTarget.textures.length > 1) _gl.readBuffer(_gl.COLOR_ATTACHMENT0 + textureIndex);
|
|
26476
26476
|
_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), 0);
|
|
26477
26477
|
const currFramebuffer = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null;
|
|
@@ -26480,10 +26480,10 @@ class WebGLRenderer {
|
|
|
26480
26480
|
_gl.flush();
|
|
26481
26481
|
await probeAsync(_gl, sync, 4);
|
|
26482
26482
|
_gl.bindBuffer(_gl.PIXEL_PACK_BUFFER, glBuffer);
|
|
26483
|
-
_gl.getBufferSubData(_gl.PIXEL_PACK_BUFFER, 0,
|
|
26483
|
+
_gl.getBufferSubData(_gl.PIXEL_PACK_BUFFER, 0, buffer2);
|
|
26484
26484
|
_gl.deleteBuffer(glBuffer);
|
|
26485
26485
|
_gl.deleteSync(sync);
|
|
26486
|
-
return
|
|
26486
|
+
return buffer2;
|
|
26487
26487
|
} else {
|
|
26488
26488
|
throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
|
|
26489
26489
|
}
|
|
@@ -26705,9 +26705,9 @@ class SimpleView {
|
|
|
26705
26705
|
viewOffset;
|
|
26706
26706
|
bitOffset = 0;
|
|
26707
26707
|
buffer;
|
|
26708
|
-
constructor(
|
|
26709
|
-
this.view = new DataView(
|
|
26710
|
-
this.buffer =
|
|
26708
|
+
constructor(buffer2) {
|
|
26709
|
+
this.view = new DataView(buffer2);
|
|
26710
|
+
this.buffer = buffer2;
|
|
26711
26711
|
this.viewOffset = 0;
|
|
26712
26712
|
}
|
|
26713
26713
|
readBits(n) {
|
|
@@ -26749,9 +26749,9 @@ class SimpleView {
|
|
|
26749
26749
|
}
|
|
26750
26750
|
}
|
|
26751
26751
|
readBuffer(bufferLength) {
|
|
26752
|
-
const
|
|
26752
|
+
const buffer2 = new Uint8Array(this.view.buffer).slice(this.viewOffset, this.viewOffset + bufferLength);
|
|
26753
26753
|
this.viewOffset += bufferLength;
|
|
26754
|
-
return
|
|
26754
|
+
return buffer2;
|
|
26755
26755
|
}
|
|
26756
26756
|
readUtf8String(stringLength) {
|
|
26757
26757
|
if (!stringLength) {
|
|
@@ -26848,19 +26848,12 @@ class SimpleView {
|
|
|
26848
26848
|
return value;
|
|
26849
26849
|
}
|
|
26850
26850
|
}
|
|
26851
|
-
|
|
26852
|
-
|
|
26853
|
-
|
|
26854
|
-
|
|
26855
|
-
|
|
26856
|
-
|
|
26857
|
-
}
|
|
26858
|
-
const buffer = new ArrayBuffer(4);
|
|
26859
|
-
const uint8View = new Uint8Array(buffer);
|
|
26860
|
-
for (let i = 32, byteIndex = 0; i > 0; i -= 8) {
|
|
26861
|
-
uint8View[byteIndex++] = parseInt(bitString.substring(i - 8, i), 2);
|
|
26862
|
-
}
|
|
26863
|
-
return new Float32Array(buffer)[0];
|
|
26851
|
+
const buffer = new ArrayBuffer(4);
|
|
26852
|
+
const uint32View = new Uint32Array(buffer);
|
|
26853
|
+
const float32View = new Float32Array(buffer);
|
|
26854
|
+
function bitsToFloat32(value) {
|
|
26855
|
+
uint32View[0] = value >>> 0;
|
|
26856
|
+
return float32View[0];
|
|
26864
26857
|
}
|
|
26865
26858
|
function untransformInt32(num) {
|
|
26866
26859
|
if (num % 2 === 0) {
|
|
@@ -26901,9 +26894,9 @@ class RBXSimpleView {
|
|
|
26901
26894
|
viewOffset;
|
|
26902
26895
|
buffer;
|
|
26903
26896
|
locked = false;
|
|
26904
|
-
constructor(
|
|
26905
|
-
this.view = new DataView(
|
|
26906
|
-
this.buffer =
|
|
26897
|
+
constructor(buffer2) {
|
|
26898
|
+
this.view = new DataView(buffer2);
|
|
26899
|
+
this.buffer = buffer2;
|
|
26907
26900
|
this.viewOffset = 0;
|
|
26908
26901
|
}
|
|
26909
26902
|
lock() {
|
|
@@ -26954,10 +26947,9 @@ class RBXSimpleView {
|
|
|
26954
26947
|
readFloat32(littleEndian = true) {
|
|
26955
26948
|
this.lockCheck();
|
|
26956
26949
|
const value = this.view.getUint32(this.viewOffset, littleEndian);
|
|
26957
|
-
const
|
|
26958
|
-
const
|
|
26959
|
-
const
|
|
26960
|
-
const valueFloat = bitsToFloat32(newBitsValue);
|
|
26950
|
+
const signBit = value & 1;
|
|
26951
|
+
const valueTransformed = value >>> 1 | signBit << 31;
|
|
26952
|
+
const valueFloat = bitsToFloat32(valueTransformed);
|
|
26961
26953
|
this.viewOffset += 4;
|
|
26962
26954
|
return valueFloat;
|
|
26963
26955
|
}
|
|
@@ -31159,19 +31151,19 @@ class RBX {
|
|
|
31159
31151
|
}
|
|
31160
31152
|
this.treeGenerated = true;
|
|
31161
31153
|
}
|
|
31162
|
-
fromBuffer(
|
|
31154
|
+
fromBuffer(buffer2) {
|
|
31163
31155
|
this.reset();
|
|
31164
|
-
const view = new RBXSimpleView(
|
|
31156
|
+
const view = new RBXSimpleView(buffer2);
|
|
31165
31157
|
const readMagic = view.readUtf8String(magic.length);
|
|
31166
31158
|
if (readMagic !== magic) {
|
|
31167
31159
|
if (readMagic === xmlMagic) {
|
|
31168
|
-
const xmlString = new TextDecoder("utf-8").decode(
|
|
31160
|
+
const xmlString = new TextDecoder("utf-8").decode(buffer2);
|
|
31169
31161
|
const xml = new DOMParser().parseFromString(xmlString, "text/xml");
|
|
31170
31162
|
this.xmlString = xmlString;
|
|
31171
31163
|
this.fromXML(xml);
|
|
31172
31164
|
return;
|
|
31173
31165
|
} else {
|
|
31174
|
-
error(
|
|
31166
|
+
error(buffer2);
|
|
31175
31167
|
throw new Error("Not a valid file, missing magic");
|
|
31176
31168
|
}
|
|
31177
31169
|
}
|
|
@@ -31180,7 +31172,7 @@ class RBX {
|
|
|
31180
31172
|
this.classCount = view.readInt32();
|
|
31181
31173
|
this.instanceCount = view.readInt32();
|
|
31182
31174
|
view.viewOffset += 8;
|
|
31183
|
-
log(false, `FILESIZE: ${
|
|
31175
|
+
log(false, `FILESIZE: ${buffer2.byteLength}, CLASSCOUNT: ${this.classCount}, INSTCOUNT: ${this.instanceCount}`);
|
|
31184
31176
|
let timeout = 0;
|
|
31185
31177
|
let foundEnd = false;
|
|
31186
31178
|
while (!foundEnd) {
|
|
@@ -31369,8 +31361,8 @@ class RBX {
|
|
|
31369
31361
|
}
|
|
31370
31362
|
}
|
|
31371
31363
|
}
|
|
31372
|
-
const
|
|
31373
|
-
const view = new RBXSimpleView(
|
|
31364
|
+
const buffer2 = new ArrayBuffer(bufferLength);
|
|
31365
|
+
const view = new RBXSimpleView(buffer2);
|
|
31374
31366
|
view.writeUtf8String("<roblox", false);
|
|
31375
31367
|
view.writeUint32(168689545);
|
|
31376
31368
|
view.writeUint16(2586);
|
|
@@ -31391,7 +31383,7 @@ class RBX {
|
|
|
31391
31383
|
view.writeUint32(referent);
|
|
31392
31384
|
}
|
|
31393
31385
|
}
|
|
31394
|
-
return
|
|
31386
|
+
return buffer2;
|
|
31395
31387
|
}
|
|
31396
31388
|
generateTree() {
|
|
31397
31389
|
if (this.treeGenerated) {
|
|
@@ -31646,9 +31638,9 @@ function rgbToHex(r, g, b) {
|
|
|
31646
31638
|
}
|
|
31647
31639
|
return ("" + componentToHex(r) + componentToHex(g) + componentToHex(b)).toUpperCase();
|
|
31648
31640
|
}
|
|
31649
|
-
function arrayBufferToBase64(
|
|
31641
|
+
function arrayBufferToBase64(buffer2) {
|
|
31650
31642
|
let binary = "";
|
|
31651
|
-
const bytes = new Uint8Array(
|
|
31643
|
+
const bytes = new Uint8Array(buffer2);
|
|
31652
31644
|
const len = bytes.byteLength;
|
|
31653
31645
|
for (let i = 0; i < len; i++) {
|
|
31654
31646
|
binary += String.fromCharCode(bytes[i]);
|
|
@@ -33160,8 +33152,8 @@ class Outfit {
|
|
|
33160
33152
|
}
|
|
33161
33153
|
return true;
|
|
33162
33154
|
}
|
|
33163
|
-
async fromBuffer(
|
|
33164
|
-
const view = new SimpleView(
|
|
33155
|
+
async fromBuffer(buffer2, auth) {
|
|
33156
|
+
const view = new SimpleView(buffer2);
|
|
33165
33157
|
const outfitFlags = view.readUint8();
|
|
33166
33158
|
const allSameColor = !!(outfitFlags & 2);
|
|
33167
33159
|
const hasCreatorId = !!(outfitFlags & 4);
|
|
@@ -33329,8 +33321,8 @@ class Outfit {
|
|
|
33329
33321
|
if (scale) bufferSize += 3;
|
|
33330
33322
|
if (headShape !== void 0) bufferSize += 4 + headShape.length;
|
|
33331
33323
|
}
|
|
33332
|
-
const
|
|
33333
|
-
const view = new SimpleView(
|
|
33324
|
+
const buffer2 = new ArrayBuffer(bufferSize);
|
|
33325
|
+
const view = new SimpleView(buffer2);
|
|
33334
33326
|
let outfitFlags = 0;
|
|
33335
33327
|
if (this.playerAvatarType === AvatarType.R15) outfitFlags += 1;
|
|
33336
33328
|
if (allSameColor) outfitFlags += 2;
|
|
@@ -34462,11 +34454,11 @@ class FileMesh {
|
|
|
34462
34454
|
} else if (version === 2) {
|
|
34463
34455
|
log(false, "COREMESH v2");
|
|
34464
34456
|
const dracoBitStreamSize = view.readUint32();
|
|
34465
|
-
const
|
|
34457
|
+
const buffer2 = view.buffer.slice(view.viewOffset, view.viewOffset + dracoBitStreamSize);
|
|
34466
34458
|
const decoderModule = await DracoDecoderModule();
|
|
34467
34459
|
const decoder = new decoderModule.Decoder();
|
|
34468
34460
|
const mesh = new decoderModule.Mesh();
|
|
34469
|
-
const status = decoder.DecodeArrayToMesh(new Int8Array(
|
|
34461
|
+
const status = decoder.DecodeArrayToMesh(new Int8Array(buffer2), dracoBitStreamSize, mesh);
|
|
34470
34462
|
if (!status.ok() || mesh.ptr === 0) {
|
|
34471
34463
|
throw new Error("Draco decode failed");
|
|
34472
34464
|
}
|
|
@@ -34543,9 +34535,9 @@ class FileMesh {
|
|
|
34543
34535
|
view.readUint32();
|
|
34544
34536
|
this.facs = readFACS(view);
|
|
34545
34537
|
}
|
|
34546
|
-
async fromBuffer(
|
|
34538
|
+
async fromBuffer(buffer2) {
|
|
34547
34539
|
this.reset();
|
|
34548
|
-
const view = new SimpleView(
|
|
34540
|
+
const view = new SimpleView(buffer2);
|
|
34549
34541
|
const version = view.readUtf8String(13);
|
|
34550
34542
|
this.version = version;
|
|
34551
34543
|
switch (version) {
|
|
@@ -34553,7 +34545,7 @@ class FileMesh {
|
|
|
34553
34545
|
case "version 1.00\n":
|
|
34554
34546
|
case "version 1.01\r":
|
|
34555
34547
|
case "version 1.01\n": {
|
|
34556
|
-
const bufferAsLines = new TextDecoder().decode(
|
|
34548
|
+
const bufferAsLines = new TextDecoder().decode(buffer2).split("\n");
|
|
34557
34549
|
this.coreMesh.numfaces = Number(bufferAsLines[1]);
|
|
34558
34550
|
this.coreMesh.numverts = this.coreMesh.numfaces * 3;
|
|
34559
34551
|
const vertData = bufferAsLines[2].replaceAll("[", "").split("]");
|
|
@@ -35701,9 +35693,9 @@ const API = {
|
|
|
35701
35693
|
}
|
|
35702
35694
|
const response = await this.GetAssetBuffer(fetchStr, headers, extraStr);
|
|
35703
35695
|
if (response instanceof ArrayBuffer) {
|
|
35704
|
-
const
|
|
35696
|
+
const buffer2 = response;
|
|
35705
35697
|
const rbx = new RBX();
|
|
35706
|
-
rbx.fromBuffer(
|
|
35698
|
+
rbx.fromBuffer(buffer2);
|
|
35707
35699
|
if (FLAGS.ENABLE_API_CACHE && FLAGS.ENABLE_API_RBX_CACHE) {
|
|
35708
35700
|
CACHE.RBX.set(cacheStr, rbx.clone());
|
|
35709
35701
|
}
|
|
@@ -35729,9 +35721,9 @@ const API = {
|
|
|
35729
35721
|
} else {
|
|
35730
35722
|
const response = await this.GetAssetBuffer(fetchStr, headers);
|
|
35731
35723
|
if (response instanceof ArrayBuffer) {
|
|
35732
|
-
const
|
|
35724
|
+
const buffer2 = response;
|
|
35733
35725
|
const mesh = new FileMesh();
|
|
35734
|
-
await mesh.fromBuffer(
|
|
35726
|
+
await mesh.fromBuffer(buffer2);
|
|
35735
35727
|
if (FLAGS.ENABLE_API_CACHE && FLAGS.ENABLE_API_MESH_CACHE) {
|
|
35736
35728
|
CACHE.Mesh.set(cacheStr, mesh.clone());
|
|
35737
35729
|
}
|
|
@@ -37899,11 +37891,11 @@ class GLTFWriter {
|
|
|
37899
37891
|
* @param {ArrayBuffer} buffer
|
|
37900
37892
|
* @return {0}
|
|
37901
37893
|
*/
|
|
37902
|
-
processBuffer(
|
|
37894
|
+
processBuffer(buffer2) {
|
|
37903
37895
|
const json = this.json;
|
|
37904
37896
|
const buffers = this.buffers;
|
|
37905
37897
|
if (!json.buffers) json.buffers = [{ byteLength: 0 }];
|
|
37906
|
-
buffers.push(
|
|
37898
|
+
buffers.push(buffer2);
|
|
37907
37899
|
return 0;
|
|
37908
37900
|
}
|
|
37909
37901
|
/**
|
|
@@ -38003,13 +37995,13 @@ class GLTFWriter {
|
|
|
38003
37995
|
const reader = new FileReader();
|
|
38004
37996
|
reader.readAsArrayBuffer(blob2);
|
|
38005
37997
|
reader.onloadend = function() {
|
|
38006
|
-
const
|
|
37998
|
+
const buffer2 = getPaddedArrayBuffer(reader.result);
|
|
38007
37999
|
const bufferViewDef = {
|
|
38008
|
-
buffer: writer.processBuffer(
|
|
38000
|
+
buffer: writer.processBuffer(buffer2),
|
|
38009
38001
|
byteOffset: writer.byteOffset,
|
|
38010
|
-
byteLength:
|
|
38002
|
+
byteLength: buffer2.byteLength
|
|
38011
38003
|
};
|
|
38012
|
-
writer.byteOffset +=
|
|
38004
|
+
writer.byteOffset += buffer2.byteLength;
|
|
38013
38005
|
resolve(json.bufferViews.push(bufferViewDef) - 1);
|
|
38014
38006
|
};
|
|
38015
38007
|
});
|
|
@@ -48723,8 +48715,8 @@ class SoundWrapper extends InstanceWrapper {
|
|
|
48723
48715
|
if (audioUrl && audioUrl.length > 0) {
|
|
48724
48716
|
API.Asset.GetAssetBuffer(audioUrl).then((responseBuffer) => {
|
|
48725
48717
|
if (responseBuffer instanceof Response || !this.data.audioContext) return;
|
|
48726
|
-
const
|
|
48727
|
-
this.data.audioContext.decodeAudioData(
|
|
48718
|
+
const buffer2 = responseBuffer.slice(0);
|
|
48719
|
+
this.data.audioContext.decodeAudioData(buffer2).then((decodedData) => {
|
|
48728
48720
|
if (!this.data.audioContext || !this.data.gainNode) return;
|
|
48729
48721
|
this.data.buffer = decodedData;
|
|
48730
48722
|
this.playSource();
|