roavatar-renderer 1.2.13 → 1.2.15
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/README.md +15 -9
- package/dist/index.d.ts +9 -3
- package/dist/index.js +222 -143
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
# Renderer for RoAvatar
|
|
2
|
-
|
|
2
|
+
The Roblox Avatar renderer used by https://github.com/steinann/RoAvatar
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
Links: [npm](https://www.npmjs.com/package/roavatar-renderer) | [GitHub](https://github.com/steinann/RoAvatar-Renderer)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
> **IMPORTANT** <br>
|
|
7
|
+
> Assets are *NOT* included in the npm module or this repository, you have to get them from the main RoAvatar repository OR set
|
|
8
|
+
> ```FLAGS.ONLINE_ASSETS = true```
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
Basic example on how to load an avatar using OutfitRenderer (to make it simpler):
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
**HTML:**
|
|
11
13
|
```html
|
|
12
|
-
<!--
|
|
14
|
+
<!--This script has to be loaded in before loading any meshes-->
|
|
13
15
|
<script src="/draco_decoder.js"></script>
|
|
14
16
|
```
|
|
17
|
+
**TYPESCRIPT:**
|
|
15
18
|
```ts
|
|
16
19
|
//setup flags that are compatible with you environment
|
|
17
|
-
FLAGS.ONLINE_ASSETS =
|
|
20
|
+
FLAGS.ONLINE_ASSETS = true //set false to true if you want assets to be loaded locally
|
|
18
21
|
|
|
22
|
+
//if we arent using online assets we have to provide the renderer with the paths
|
|
19
23
|
if (!FLAGS.ONLINE_ASSETS) {
|
|
20
24
|
//path to asset files from RoAvatar
|
|
21
25
|
FLAGS.ASSETS_PATH = chrome.runtime.getURL("assets/rbxasset/")
|
|
@@ -47,9 +51,11 @@ if (!(outfit instanceof Outfit)) throw new Error("Failed to get outfit")
|
|
|
47
51
|
//used by api
|
|
48
52
|
const auth = new Authentication()
|
|
49
53
|
//manages outfit rendering for you
|
|
50
|
-
const outfitRenderer = new OutfitRenderer(auth, outfit
|
|
54
|
+
const outfitRenderer = new OutfitRenderer(auth, outfit)
|
|
51
55
|
outfitRenderer.startAnimating()
|
|
52
56
|
outfitRenderer.setMainAnimation("idle")
|
|
53
57
|
```
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
More info available in ```/docs```
|
|
60
|
+
|
|
61
|
+
Also the OutfitRenderer code or RoAvatar source code is useful, especially ```avatarPreview.ts```
|
package/dist/index.d.ts
CHANGED
|
@@ -880,6 +880,10 @@ declare class Event_2 {
|
|
|
880
880
|
}
|
|
881
881
|
export { Event_2 as Event }
|
|
882
882
|
|
|
883
|
+
export declare function exposeAPI(): void;
|
|
884
|
+
|
|
885
|
+
export declare function exposeMesh(): void;
|
|
886
|
+
|
|
883
887
|
export declare const FaceControlNames: string[];
|
|
884
888
|
|
|
885
889
|
export declare class FaceControlsWrapper extends InstanceWrapper {
|
|
@@ -1279,7 +1283,7 @@ export declare class Instance {
|
|
|
1279
1283
|
PropOrDefault(name: string, def: unknown): unknown;
|
|
1280
1284
|
PropertyType(name: string): number | undefined;
|
|
1281
1285
|
getPropertyNames(): string[];
|
|
1282
|
-
setParent(instance: Instance | undefined | null): void;
|
|
1286
|
+
setParent(instance: Instance | undefined | null, fireEvents?: boolean): void;
|
|
1283
1287
|
Destroy(): void;
|
|
1284
1288
|
GetFullName(): string;
|
|
1285
1289
|
GetChildren(): Instance[];
|
|
@@ -1882,13 +1886,15 @@ export declare class OutfitRenderer {
|
|
|
1882
1886
|
hasNewUpdate: boolean;
|
|
1883
1887
|
lastFrameTime: number;
|
|
1884
1888
|
animationInterval?: NodeJS.Timeout;
|
|
1889
|
+
animationFPS: number;
|
|
1890
|
+
deltaTimeMultiplier: number;
|
|
1885
1891
|
/**
|
|
1886
1892
|
* Creates a new OutfitRenderer which makes it easy to render outfits
|
|
1887
1893
|
* @param auth The authentication object, you should have one you use for everything
|
|
1888
1894
|
* @param outfit The outfit you want to render, it can be updated later by calling setOutfit()
|
|
1889
|
-
* @param rigPath The path that contains RigR6.rbxm and RigR15.rbxm,
|
|
1895
|
+
* @param rigPath The path that contains RigR6.rbxm and RigR15.rbxm, should always be "roavatar://" as rig path is now controlled by FLAGS
|
|
1890
1896
|
*/
|
|
1891
|
-
constructor(auth: Authentication, outfit: Outfit, rigPath
|
|
1897
|
+
constructor(auth: Authentication, outfit: Outfit, rigPath?: string);
|
|
1892
1898
|
/**
|
|
1893
1899
|
* Updates the current rig, called internally by _updateOutfit()
|
|
1894
1900
|
*/
|
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
|
}
|
|
@@ -29545,16 +29537,16 @@ const FLAGS = {
|
|
|
29545
29537
|
};
|
|
29546
29538
|
function log(critical, ...args) {
|
|
29547
29539
|
if (critical || FLAGS.VERBOSE_LOGGING) {
|
|
29548
|
-
console.log(args);
|
|
29540
|
+
console.log(...args);
|
|
29549
29541
|
}
|
|
29550
29542
|
}
|
|
29551
29543
|
function warn(critical, ...args) {
|
|
29552
29544
|
if (critical || FLAGS.VERBOSE_LOGGING) {
|
|
29553
|
-
console.warn(args);
|
|
29545
|
+
console.warn(...args);
|
|
29554
29546
|
}
|
|
29555
29547
|
}
|
|
29556
29548
|
function error(...args) {
|
|
29557
|
-
console.error(args);
|
|
29549
|
+
console.error(...args);
|
|
29558
29550
|
}
|
|
29559
29551
|
function time(label) {
|
|
29560
29552
|
if (FLAGS.VERBOSE_LOGGING) {
|
|
@@ -30274,7 +30266,7 @@ class Instance {
|
|
|
30274
30266
|
getPropertyNames() {
|
|
30275
30267
|
return Array.from(this._properties.keys());
|
|
30276
30268
|
}
|
|
30277
|
-
setParent(instance) {
|
|
30269
|
+
setParent(instance, fireEvents = true) {
|
|
30278
30270
|
if (!instance) {
|
|
30279
30271
|
instance = void 0;
|
|
30280
30272
|
}
|
|
@@ -30294,10 +30286,14 @@ class Instance {
|
|
|
30294
30286
|
}
|
|
30295
30287
|
if (instance) {
|
|
30296
30288
|
instance.children.push(this);
|
|
30297
|
-
instance.ChildAdded.Fire(this);
|
|
30298
|
-
instance.AncestryChanged.Fire(this, instance);
|
|
30299
30289
|
}
|
|
30300
|
-
|
|
30290
|
+
if (fireEvents) {
|
|
30291
|
+
if (instance) {
|
|
30292
|
+
instance.ChildAdded.Fire(this);
|
|
30293
|
+
instance.AncestryChanged.Fire(this, instance);
|
|
30294
|
+
}
|
|
30295
|
+
this.AncestryChanged.Fire(this, instance);
|
|
30296
|
+
}
|
|
30301
30297
|
}
|
|
30302
30298
|
Destroy() {
|
|
30303
30299
|
for (const connection of this._connectionReferences) {
|
|
@@ -30352,8 +30348,8 @@ class Instance {
|
|
|
30352
30348
|
return childrenList;
|
|
30353
30349
|
}
|
|
30354
30350
|
GetDescendants() {
|
|
30355
|
-
let descendants = this.
|
|
30356
|
-
for (const child of this.
|
|
30351
|
+
let descendants = this.GetChildren();
|
|
30352
|
+
for (const child of this.GetChildren()) {
|
|
30357
30353
|
descendants = descendants.concat(child.GetDescendants());
|
|
30358
30354
|
}
|
|
30359
30355
|
return descendants;
|
|
@@ -30848,6 +30844,7 @@ class RBX {
|
|
|
30848
30844
|
const content = new Content();
|
|
30849
30845
|
content.sourceType = sourceTypes[i];
|
|
30850
30846
|
switch (content.sourceType) {
|
|
30847
|
+
//2 - Uri, 0 - Object/None,
|
|
30851
30848
|
case 0:
|
|
30852
30849
|
break;
|
|
30853
30850
|
case 1:
|
|
@@ -31159,19 +31156,19 @@ class RBX {
|
|
|
31159
31156
|
}
|
|
31160
31157
|
this.treeGenerated = true;
|
|
31161
31158
|
}
|
|
31162
|
-
fromBuffer(
|
|
31159
|
+
fromBuffer(buffer2) {
|
|
31163
31160
|
this.reset();
|
|
31164
|
-
const view = new RBXSimpleView(
|
|
31161
|
+
const view = new RBXSimpleView(buffer2);
|
|
31165
31162
|
const readMagic = view.readUtf8String(magic.length);
|
|
31166
31163
|
if (readMagic !== magic) {
|
|
31167
31164
|
if (readMagic === xmlMagic) {
|
|
31168
|
-
const xmlString = new TextDecoder("utf-8").decode(
|
|
31165
|
+
const xmlString = new TextDecoder("utf-8").decode(buffer2);
|
|
31169
31166
|
const xml = new DOMParser().parseFromString(xmlString, "text/xml");
|
|
31170
31167
|
this.xmlString = xmlString;
|
|
31171
31168
|
this.fromXML(xml);
|
|
31172
31169
|
return;
|
|
31173
31170
|
} else {
|
|
31174
|
-
error(
|
|
31171
|
+
error(buffer2);
|
|
31175
31172
|
throw new Error("Not a valid file, missing magic");
|
|
31176
31173
|
}
|
|
31177
31174
|
}
|
|
@@ -31180,7 +31177,7 @@ class RBX {
|
|
|
31180
31177
|
this.classCount = view.readInt32();
|
|
31181
31178
|
this.instanceCount = view.readInt32();
|
|
31182
31179
|
view.viewOffset += 8;
|
|
31183
|
-
log(false, `FILESIZE: ${
|
|
31180
|
+
log(false, `FILESIZE: ${buffer2.byteLength}, CLASSCOUNT: ${this.classCount}, INSTCOUNT: ${this.instanceCount}`);
|
|
31184
31181
|
let timeout = 0;
|
|
31185
31182
|
let foundEnd = false;
|
|
31186
31183
|
while (!foundEnd) {
|
|
@@ -31369,8 +31366,8 @@ class RBX {
|
|
|
31369
31366
|
}
|
|
31370
31367
|
}
|
|
31371
31368
|
}
|
|
31372
|
-
const
|
|
31373
|
-
const view = new RBXSimpleView(
|
|
31369
|
+
const buffer2 = new ArrayBuffer(bufferLength);
|
|
31370
|
+
const view = new RBXSimpleView(buffer2);
|
|
31374
31371
|
view.writeUtf8String("<roblox", false);
|
|
31375
31372
|
view.writeUint32(168689545);
|
|
31376
31373
|
view.writeUint16(2586);
|
|
@@ -31391,7 +31388,7 @@ class RBX {
|
|
|
31391
31388
|
view.writeUint32(referent);
|
|
31392
31389
|
}
|
|
31393
31390
|
}
|
|
31394
|
-
return
|
|
31391
|
+
return buffer2;
|
|
31395
31392
|
}
|
|
31396
31393
|
generateTree() {
|
|
31397
31394
|
if (this.treeGenerated) {
|
|
@@ -31646,9 +31643,9 @@ function rgbToHex(r, g, b) {
|
|
|
31646
31643
|
}
|
|
31647
31644
|
return ("" + componentToHex(r) + componentToHex(g) + componentToHex(b)).toUpperCase();
|
|
31648
31645
|
}
|
|
31649
|
-
function arrayBufferToBase64(
|
|
31646
|
+
function arrayBufferToBase64(buffer2) {
|
|
31650
31647
|
let binary = "";
|
|
31651
|
-
const bytes = new Uint8Array(
|
|
31648
|
+
const bytes = new Uint8Array(buffer2);
|
|
31652
31649
|
const len = bytes.byteLength;
|
|
31653
31650
|
for (let i = 0; i < len; i++) {
|
|
31654
31651
|
binary += String.fromCharCode(bytes[i]);
|
|
@@ -33160,8 +33157,8 @@ class Outfit {
|
|
|
33160
33157
|
}
|
|
33161
33158
|
return true;
|
|
33162
33159
|
}
|
|
33163
|
-
async fromBuffer(
|
|
33164
|
-
const view = new SimpleView(
|
|
33160
|
+
async fromBuffer(buffer2, auth) {
|
|
33161
|
+
const view = new SimpleView(buffer2);
|
|
33165
33162
|
const outfitFlags = view.readUint8();
|
|
33166
33163
|
const allSameColor = !!(outfitFlags & 2);
|
|
33167
33164
|
const hasCreatorId = !!(outfitFlags & 4);
|
|
@@ -33329,8 +33326,8 @@ class Outfit {
|
|
|
33329
33326
|
if (scale) bufferSize += 3;
|
|
33330
33327
|
if (headShape !== void 0) bufferSize += 4 + headShape.length;
|
|
33331
33328
|
}
|
|
33332
|
-
const
|
|
33333
|
-
const view = new SimpleView(
|
|
33329
|
+
const buffer2 = new ArrayBuffer(bufferSize);
|
|
33330
|
+
const view = new SimpleView(buffer2);
|
|
33334
33331
|
let outfitFlags = 0;
|
|
33335
33332
|
if (this.playerAvatarType === AvatarType.R15) outfitFlags += 1;
|
|
33336
33333
|
if (allSameColor) outfitFlags += 2;
|
|
@@ -34462,11 +34459,11 @@ class FileMesh {
|
|
|
34462
34459
|
} else if (version === 2) {
|
|
34463
34460
|
log(false, "COREMESH v2");
|
|
34464
34461
|
const dracoBitStreamSize = view.readUint32();
|
|
34465
|
-
const
|
|
34462
|
+
const buffer2 = view.buffer.slice(view.viewOffset, view.viewOffset + dracoBitStreamSize);
|
|
34466
34463
|
const decoderModule = await DracoDecoderModule();
|
|
34467
34464
|
const decoder = new decoderModule.Decoder();
|
|
34468
34465
|
const mesh = new decoderModule.Mesh();
|
|
34469
|
-
const status = decoder.DecodeArrayToMesh(new Int8Array(
|
|
34466
|
+
const status = decoder.DecodeArrayToMesh(new Int8Array(buffer2), dracoBitStreamSize, mesh);
|
|
34470
34467
|
if (!status.ok() || mesh.ptr === 0) {
|
|
34471
34468
|
throw new Error("Draco decode failed");
|
|
34472
34469
|
}
|
|
@@ -34543,9 +34540,9 @@ class FileMesh {
|
|
|
34543
34540
|
view.readUint32();
|
|
34544
34541
|
this.facs = readFACS(view);
|
|
34545
34542
|
}
|
|
34546
|
-
async fromBuffer(
|
|
34543
|
+
async fromBuffer(buffer2) {
|
|
34547
34544
|
this.reset();
|
|
34548
|
-
const view = new SimpleView(
|
|
34545
|
+
const view = new SimpleView(buffer2);
|
|
34549
34546
|
const version = view.readUtf8String(13);
|
|
34550
34547
|
this.version = version;
|
|
34551
34548
|
switch (version) {
|
|
@@ -34553,7 +34550,7 @@ class FileMesh {
|
|
|
34553
34550
|
case "version 1.00\n":
|
|
34554
34551
|
case "version 1.01\r":
|
|
34555
34552
|
case "version 1.01\n": {
|
|
34556
|
-
const bufferAsLines = new TextDecoder().decode(
|
|
34553
|
+
const bufferAsLines = new TextDecoder().decode(buffer2).split("\n");
|
|
34557
34554
|
this.coreMesh.numfaces = Number(bufferAsLines[1]);
|
|
34558
34555
|
this.coreMesh.numverts = this.coreMesh.numfaces * 3;
|
|
34559
34556
|
const vertData = bufferAsLines[2].replaceAll("[", "").split("]");
|
|
@@ -35701,9 +35698,9 @@ const API = {
|
|
|
35701
35698
|
}
|
|
35702
35699
|
const response = await this.GetAssetBuffer(fetchStr, headers, extraStr);
|
|
35703
35700
|
if (response instanceof ArrayBuffer) {
|
|
35704
|
-
const
|
|
35701
|
+
const buffer2 = response;
|
|
35705
35702
|
const rbx = new RBX();
|
|
35706
|
-
rbx.fromBuffer(
|
|
35703
|
+
rbx.fromBuffer(buffer2);
|
|
35707
35704
|
if (FLAGS.ENABLE_API_CACHE && FLAGS.ENABLE_API_RBX_CACHE) {
|
|
35708
35705
|
CACHE.RBX.set(cacheStr, rbx.clone());
|
|
35709
35706
|
}
|
|
@@ -35729,9 +35726,9 @@ const API = {
|
|
|
35729
35726
|
} else {
|
|
35730
35727
|
const response = await this.GetAssetBuffer(fetchStr, headers);
|
|
35731
35728
|
if (response instanceof ArrayBuffer) {
|
|
35732
|
-
const
|
|
35729
|
+
const buffer2 = response;
|
|
35733
35730
|
const mesh = new FileMesh();
|
|
35734
|
-
await mesh.fromBuffer(
|
|
35731
|
+
await mesh.fromBuffer(buffer2);
|
|
35735
35732
|
if (FLAGS.ENABLE_API_CACHE && FLAGS.ENABLE_API_MESH_CACHE) {
|
|
35736
35733
|
CACHE.Mesh.set(cacheStr, mesh.clone());
|
|
35737
35734
|
}
|
|
@@ -37899,11 +37896,11 @@ class GLTFWriter {
|
|
|
37899
37896
|
* @param {ArrayBuffer} buffer
|
|
37900
37897
|
* @return {0}
|
|
37901
37898
|
*/
|
|
37902
|
-
processBuffer(
|
|
37899
|
+
processBuffer(buffer2) {
|
|
37903
37900
|
const json = this.json;
|
|
37904
37901
|
const buffers = this.buffers;
|
|
37905
37902
|
if (!json.buffers) json.buffers = [{ byteLength: 0 }];
|
|
37906
|
-
buffers.push(
|
|
37903
|
+
buffers.push(buffer2);
|
|
37907
37904
|
return 0;
|
|
37908
37905
|
}
|
|
37909
37906
|
/**
|
|
@@ -38003,13 +38000,13 @@ class GLTFWriter {
|
|
|
38003
38000
|
const reader = new FileReader();
|
|
38004
38001
|
reader.readAsArrayBuffer(blob2);
|
|
38005
38002
|
reader.onloadend = function() {
|
|
38006
|
-
const
|
|
38003
|
+
const buffer2 = getPaddedArrayBuffer(reader.result);
|
|
38007
38004
|
const bufferViewDef = {
|
|
38008
|
-
buffer: writer.processBuffer(
|
|
38005
|
+
buffer: writer.processBuffer(buffer2),
|
|
38009
38006
|
byteOffset: writer.byteOffset,
|
|
38010
|
-
byteLength:
|
|
38007
|
+
byteLength: buffer2.byteLength
|
|
38011
38008
|
};
|
|
38012
|
-
writer.byteOffset +=
|
|
38009
|
+
writer.byteOffset += buffer2.byteLength;
|
|
38013
38010
|
resolve(json.bufferViews.push(bufferViewDef) - 1);
|
|
38014
38011
|
};
|
|
38015
38012
|
});
|
|
@@ -41193,7 +41190,7 @@ function TraverseRigFromAttachmentsInternal(self2, part, characterParts, buildJo
|
|
|
41193
41190
|
if (attachment.className === "Attachment") {
|
|
41194
41191
|
const attachmentName = attachment.Prop("Name");
|
|
41195
41192
|
const findPos = attachmentName.indexOf(rigAttachmentName);
|
|
41196
|
-
if (findPos) {
|
|
41193
|
+
if (findPos !== -1) {
|
|
41197
41194
|
const jointName = attachmentName.substring(0, findPos);
|
|
41198
41195
|
const joint = part.FindFirstChild(jointName);
|
|
41199
41196
|
if (!joint || joint.className !== "Motor6D") {
|
|
@@ -41201,6 +41198,7 @@ function TraverseRigFromAttachmentsInternal(self2, part, characterParts, buildJo
|
|
|
41201
41198
|
if (part !== characterPart) {
|
|
41202
41199
|
const matchingAttachment = characterPart.FindFirstChild(attachmentName);
|
|
41203
41200
|
if (matchingAttachment && matchingAttachment.className === "Attachment") {
|
|
41201
|
+
log(false, "matchingAtt", part, characterPart, attachmentName);
|
|
41204
41202
|
AdjustRootRigAttachmentPosition(self2, part, characterPart, attachment, matchingAttachment);
|
|
41205
41203
|
{
|
|
41206
41204
|
createJoint(jointName, attachment, matchingAttachment);
|
|
@@ -42638,6 +42636,26 @@ class MeshDesc {
|
|
|
42638
42636
|
const meshIdStr = child.Property("MeshId");
|
|
42639
42637
|
this.mesh = meshIdStr;
|
|
42640
42638
|
this.scaleIsRelative = true;
|
|
42639
|
+
if (!FLAGS.AVATAR_JOINT_UPGRADE) {
|
|
42640
|
+
if (child.FindFirstChildOfClass("Bone")) {
|
|
42641
|
+
this.canHaveSkinning = false;
|
|
42642
|
+
} else {
|
|
42643
|
+
if (child.Prop("Name").includes("Arm")) {
|
|
42644
|
+
const rig = child.parent;
|
|
42645
|
+
if (rig) {
|
|
42646
|
+
const humanoid = rig.FindFirstChildOfClass("Humanoid");
|
|
42647
|
+
if (humanoid) {
|
|
42648
|
+
const side = child.Prop("Name").startsWith("Right") ? "Right" : "Left";
|
|
42649
|
+
const handName = side + "Hand";
|
|
42650
|
+
const hand = rig.FindFirstChild(handName);
|
|
42651
|
+
if (hand && hand.FindFirstChildOfClass("Bone")) {
|
|
42652
|
+
this.canHaveSkinning = false;
|
|
42653
|
+
}
|
|
42654
|
+
}
|
|
42655
|
+
}
|
|
42656
|
+
}
|
|
42657
|
+
}
|
|
42658
|
+
}
|
|
42641
42659
|
const surfaceAppearance = child.FindLastChildOfClass("SurfaceAppearance");
|
|
42642
42660
|
if (surfaceAppearance) {
|
|
42643
42661
|
const color = surfaceAppearance.HasProperty("Color") ? surfaceAppearance.Prop("Color") : new Color3(1, 1, 1);
|
|
@@ -43988,6 +44006,7 @@ function setBoneToCFrame$1(bone, cf) {
|
|
|
43988
44006
|
bone.rotation.y = rad(cf.Orientation[1]);
|
|
43989
44007
|
bone.rotation.z = rad(cf.Orientation[2]);
|
|
43990
44008
|
}
|
|
44009
|
+
const BaseR15Bones = ["Root", "HumanoidRootNode", "LowerTorso", "UpperTorso", "RightUpperArm", "RightLowerArm", "RightHand", "LeftUpperArm", "LeftLowerArm", "LeftHand", "Head", "DynamicHead"];
|
|
43991
44010
|
function getJointForInstances$1(parent, child, includeTransform) {
|
|
43992
44011
|
const childMotor = child.FindFirstChildOfClass("Motor6D");
|
|
43993
44012
|
const parentMotor = parent.FindFirstChildOfClass("Motor6D");
|
|
@@ -44015,6 +44034,21 @@ function boneIsChildOf(bone, parentName) {
|
|
|
44015
44034
|
}
|
|
44016
44035
|
return false;
|
|
44017
44036
|
}
|
|
44037
|
+
function getBoneBaseR15Parent(bone) {
|
|
44038
|
+
let currentParent = bone.parent;
|
|
44039
|
+
if (!currentParent) return;
|
|
44040
|
+
while (currentParent && !BaseR15Bones.includes(currentParent.name)) {
|
|
44041
|
+
currentParent = currentParent.parent;
|
|
44042
|
+
}
|
|
44043
|
+
if (!currentParent) {
|
|
44044
|
+
return bone.parent;
|
|
44045
|
+
} else {
|
|
44046
|
+
return currentParent;
|
|
44047
|
+
}
|
|
44048
|
+
}
|
|
44049
|
+
function boneIsBaseR15(bone) {
|
|
44050
|
+
return BaseR15Bones.includes(bone.name);
|
|
44051
|
+
}
|
|
44018
44052
|
function getMotorsInRig(rigChildren) {
|
|
44019
44053
|
const motors = [];
|
|
44020
44054
|
for (const child of rigChildren) {
|
|
@@ -44033,15 +44067,17 @@ function getBoneDependencies(rig) {
|
|
|
44033
44067
|
let currentSearchOrigin = hrp ? ["Root"] : [];
|
|
44034
44068
|
const children = rig.GetChildren();
|
|
44035
44069
|
const motors = getMotorsInRig(children);
|
|
44070
|
+
const searchedParts = [];
|
|
44036
44071
|
while (currentSearch.length > 0 && currentSearch[0]) {
|
|
44037
44072
|
const newCurrentSearch = [];
|
|
44038
44073
|
const newCurrentSearchOrigin = [];
|
|
44039
44074
|
for (let i = 0; i < currentSearch.length; i++) {
|
|
44040
44075
|
const toSearch = currentSearch[i];
|
|
44076
|
+
searchedParts.push(toSearch);
|
|
44041
44077
|
const selfName = toSearch === hrp ? "HumanoidRootNode" : toSearch.Prop("Name");
|
|
44042
44078
|
names.set(selfName, currentSearchOrigin[i]);
|
|
44043
44079
|
for (const motor of motors) {
|
|
44044
|
-
if (motor.Prop("Part0") === toSearch) {
|
|
44080
|
+
if (motor.Prop("Part0") === toSearch && !searchedParts.includes(motor.parent)) {
|
|
44045
44081
|
newCurrentSearch.push(motor.parent);
|
|
44046
44082
|
newCurrentSearchOrigin.push(selfName);
|
|
44047
44083
|
}
|
|
@@ -44245,7 +44281,8 @@ let SkeletonDesc$1 = class SkeletonDesc {
|
|
|
44245
44281
|
for (let i = 0; i < this.bones.length; i++) {
|
|
44246
44282
|
const bone = this.bones[i];
|
|
44247
44283
|
const partEquivalent = this.getPartEquivalent(selfInstance, bone.name);
|
|
44248
|
-
const
|
|
44284
|
+
const boneParent = boneIsBaseR15(bone) ? getBoneBaseR15Parent(bone) : bone.parent;
|
|
44285
|
+
const parentPartEquivalent = boneParent ? boneParent.name !== "HumanoidRootNode" ? this.getPartEquivalent(selfInstance, boneParent.name) : humanoidRootPartEquivalent : void 0;
|
|
44249
44286
|
let rootBoneCF = new CFrame();
|
|
44250
44287
|
if (bone.name === "Root") {
|
|
44251
44288
|
rootBoneCF = rootBoneCFog;
|
|
@@ -47214,6 +47251,32 @@ function isSameAccessoryDesc(desc0, desc1) {
|
|
|
47214
47251
|
function isSameMakeupDesc(desc0, desc1) {
|
|
47215
47252
|
return hasSameVal(desc0, desc1, "AssetId") && hasSameVal(desc0, desc1, "MakeupType") && hasSameVal(desc0, desc1, "Order");
|
|
47216
47253
|
}
|
|
47254
|
+
function moveAttachmentsToBase(rigPart) {
|
|
47255
|
+
let nextCollapse = rigPart.GetChildren();
|
|
47256
|
+
let cframeHierarchy = new Array(nextCollapse.length).fill(new CFrame());
|
|
47257
|
+
while (nextCollapse.length > 0) {
|
|
47258
|
+
const newNextCollapse = [];
|
|
47259
|
+
const newCFrameHierarchy = [];
|
|
47260
|
+
for (let i = 0; i < nextCollapse.length; i++) {
|
|
47261
|
+
const child = nextCollapse[i];
|
|
47262
|
+
if (child.className !== "Bone" && child.className !== "Attachment" || !child.HasProperty("CFrame")) {
|
|
47263
|
+
continue;
|
|
47264
|
+
}
|
|
47265
|
+
const selfCFrameHierarchy = cframeHierarchy[i];
|
|
47266
|
+
const originalCFrame = child.Prop("CFrame");
|
|
47267
|
+
const newCFrame = selfCFrameHierarchy.multiply(originalCFrame);
|
|
47268
|
+
child.setProperty("CFrame", newCFrame);
|
|
47269
|
+
const childChildren = child.GetChildren();
|
|
47270
|
+
for (const childChild of childChildren) {
|
|
47271
|
+
newNextCollapse.push(childChild);
|
|
47272
|
+
newCFrameHierarchy.push(newCFrame);
|
|
47273
|
+
}
|
|
47274
|
+
child.setParent(rigPart);
|
|
47275
|
+
}
|
|
47276
|
+
nextCollapse = newNextCollapse;
|
|
47277
|
+
cframeHierarchy = newCFrameHierarchy;
|
|
47278
|
+
}
|
|
47279
|
+
}
|
|
47217
47280
|
class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
47218
47281
|
static className = "HumanoidDescription";
|
|
47219
47282
|
static requiredProperties = [
|
|
@@ -47868,6 +47931,9 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
|
47868
47931
|
if (R15Folder) {
|
|
47869
47932
|
const children = R15Folder.GetChildren();
|
|
47870
47933
|
for (const child of children) {
|
|
47934
|
+
if (!FLAGS.AVATAR_JOINT_UPGRADE) {
|
|
47935
|
+
moveAttachmentsToBase(child);
|
|
47936
|
+
}
|
|
47871
47937
|
replaceBodyPart(rig, child);
|
|
47872
47938
|
}
|
|
47873
47939
|
}
|
|
@@ -48723,8 +48789,8 @@ class SoundWrapper extends InstanceWrapper {
|
|
|
48723
48789
|
if (audioUrl && audioUrl.length > 0) {
|
|
48724
48790
|
API.Asset.GetAssetBuffer(audioUrl).then((responseBuffer) => {
|
|
48725
48791
|
if (responseBuffer instanceof Response || !this.data.audioContext) return;
|
|
48726
|
-
const
|
|
48727
|
-
this.data.audioContext.decodeAudioData(
|
|
48792
|
+
const buffer2 = responseBuffer.slice(0);
|
|
48793
|
+
this.data.audioContext.decodeAudioData(buffer2).then((decodedData) => {
|
|
48728
48794
|
if (!this.data.audioContext || !this.data.gainNode) return;
|
|
48729
48795
|
this.data.buffer = decodedData;
|
|
48730
48796
|
this.playSource();
|
|
@@ -49481,6 +49547,14 @@ class HSR {
|
|
|
49481
49547
|
}
|
|
49482
49548
|
}
|
|
49483
49549
|
}
|
|
49550
|
+
function exposeAPI() {
|
|
49551
|
+
globalThis.API = API;
|
|
49552
|
+
globalThis.APICACHE = CACHE;
|
|
49553
|
+
globalThis.Authentication = Authentication;
|
|
49554
|
+
}
|
|
49555
|
+
function exposeMesh() {
|
|
49556
|
+
globalThis.fileMeshToTHREEGeometry = fileMeshToTHREEGeometry;
|
|
49557
|
+
}
|
|
49484
49558
|
function getCorners(cframe, size) {
|
|
49485
49559
|
const halfX = size.X / 2;
|
|
49486
49560
|
const halfY = size.Y / 2;
|
|
@@ -49594,13 +49668,15 @@ class OutfitRenderer {
|
|
|
49594
49668
|
hasNewUpdate = false;
|
|
49595
49669
|
lastFrameTime = Date.now() / 100;
|
|
49596
49670
|
animationInterval;
|
|
49671
|
+
animationFPS = 60;
|
|
49672
|
+
deltaTimeMultiplier = 1;
|
|
49597
49673
|
/**
|
|
49598
49674
|
* Creates a new OutfitRenderer which makes it easy to render outfits
|
|
49599
49675
|
* @param auth The authentication object, you should have one you use for everything
|
|
49600
49676
|
* @param outfit The outfit you want to render, it can be updated later by calling setOutfit()
|
|
49601
|
-
* @param rigPath The path that contains RigR6.rbxm and RigR15.rbxm,
|
|
49677
|
+
* @param rigPath The path that contains RigR6.rbxm and RigR15.rbxm, should always be "roavatar://" as rig path is now controlled by FLAGS
|
|
49602
49678
|
*/
|
|
49603
|
-
constructor(auth, outfit, rigPath) {
|
|
49679
|
+
constructor(auth, outfit, rigPath = "roavatar://") {
|
|
49604
49680
|
this.auth = auth;
|
|
49605
49681
|
this.outfit = outfit;
|
|
49606
49682
|
this.currentRigType = outfit.playerAvatarType;
|
|
@@ -49711,7 +49787,7 @@ class OutfitRenderer {
|
|
|
49711
49787
|
*/
|
|
49712
49788
|
startAnimating() {
|
|
49713
49789
|
if (this.animationInterval !== void 0) return;
|
|
49714
|
-
this.lastFrameTime = Date.now() /
|
|
49790
|
+
this.lastFrameTime = Date.now() / 1e3;
|
|
49715
49791
|
this.animationInterval = setInterval(() => {
|
|
49716
49792
|
if (this.currentRig && this.doCameraUpdate) {
|
|
49717
49793
|
this.centerCamera();
|
|
@@ -49721,7 +49797,7 @@ class OutfitRenderer {
|
|
|
49721
49797
|
if (humanoid) {
|
|
49722
49798
|
const animator = humanoid.FindFirstChildOfClass("Animator");
|
|
49723
49799
|
if (animator) {
|
|
49724
|
-
const deltaTime = Date.now() / 1e3 - this.lastFrameTime;
|
|
49800
|
+
const deltaTime = (Date.now() / 1e3 - this.lastFrameTime) * this.deltaTimeMultiplier;
|
|
49725
49801
|
this.lastFrameTime = Date.now() / 1e3;
|
|
49726
49802
|
const animatorW = new AnimatorWrapper(animator);
|
|
49727
49803
|
animatorW.renderAnimation(deltaTime);
|
|
@@ -49730,7 +49806,7 @@ class OutfitRenderer {
|
|
|
49730
49806
|
}
|
|
49731
49807
|
}
|
|
49732
49808
|
}
|
|
49733
|
-
}, 1e3 /
|
|
49809
|
+
}, 1e3 / this.animationFPS);
|
|
49734
49810
|
}
|
|
49735
49811
|
/**
|
|
49736
49812
|
* Stops updating the animation of the outfit per frame
|
|
@@ -49738,6 +49814,7 @@ class OutfitRenderer {
|
|
|
49738
49814
|
stopAnimating() {
|
|
49739
49815
|
if (this.animationInterval) {
|
|
49740
49816
|
clearInterval(this.animationInterval);
|
|
49817
|
+
this.animationInterval = void 0;
|
|
49741
49818
|
}
|
|
49742
49819
|
}
|
|
49743
49820
|
/**
|
|
@@ -49921,6 +49998,8 @@ export {
|
|
|
49921
49998
|
divide,
|
|
49922
49999
|
dot,
|
|
49923
50000
|
download,
|
|
50001
|
+
exposeAPI,
|
|
50002
|
+
exposeMesh,
|
|
49924
50003
|
floor,
|
|
49925
50004
|
gaussian_rbf,
|
|
49926
50005
|
generateUUIDv4,
|