roavatar-renderer 1.2.10 → 1.2.12
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 +9 -4
- package/dist/index.d.ts +21 -1
- package/dist/index.js +247 -67
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ It was originally a part of that repository but has now gained independence
|
|
|
5
5
|
|
|
6
6
|
Also available on npm: https://www.npmjs.com/package/roavatar-renderer
|
|
7
7
|
|
|
8
|
-
IMPORTANT: Assets are NOT included in the npm module or this repository, you have to get them from the main RoAvatar repository
|
|
8
|
+
IMPORTANT: Assets are NOT included in the npm module or this repository, you have to get them from the main RoAvatar repository OR set FLAGS.ONLINE_ASSETS = true
|
|
9
9
|
|
|
10
10
|
Basic example on how to load an avatar, that is also untested:
|
|
11
11
|
```html
|
|
@@ -14,8 +14,13 @@ Basic example on how to load an avatar, that is also untested:
|
|
|
14
14
|
```
|
|
15
15
|
```ts
|
|
16
16
|
//setup flags that are compatible with you environment
|
|
17
|
-
//
|
|
18
|
-
|
|
17
|
+
FLAGS.ONLINE_ASSETS = false //set this to true if you want assets to be loaded from roblox instead of locally
|
|
18
|
+
|
|
19
|
+
if (!FLAGS.ONLINE_ASSETS) {
|
|
20
|
+
//path to asset files from RoAvatar
|
|
21
|
+
FLAGS.ASSETS_PATH = chrome.runtime.getURL("assets/rbxasset/")
|
|
22
|
+
FLAGS.RIG_PATH = chrome.runtime.getURL("assets/")
|
|
23
|
+
}
|
|
19
24
|
//if layered assets dont work set this to false (workers improve performance)
|
|
20
25
|
FLAGS.USE_WORKERS = true
|
|
21
26
|
|
|
@@ -42,7 +47,7 @@ if (!(outfit instanceof Outfit)) throw new Error("Failed to get outfit")
|
|
|
42
47
|
//used by api
|
|
43
48
|
const auth = new Authentication()
|
|
44
49
|
//manages outfit rendering for you
|
|
45
|
-
const outfitRenderer = new OutfitRenderer(auth, outfit,
|
|
50
|
+
const outfitRenderer = new OutfitRenderer(auth, outfit, "roavatar://")
|
|
46
51
|
outfitRenderer.startAnimating()
|
|
47
52
|
outfitRenderer.setMainAnimation("idle")
|
|
48
53
|
```
|
package/dist/index.d.ts
CHANGED
|
@@ -646,6 +646,9 @@ export declare class CFrame {
|
|
|
646
646
|
getMatrix(): THREE.Matrix4Tuple;
|
|
647
647
|
fromMatrix(m: Mat4x4): this;
|
|
648
648
|
fromRotationMatrix(r00: number, r01: number, r02: number, r10: number, r11: number, r12: number, r20: number, r21: number, r22: number, order?: string): void;
|
|
649
|
+
lookVector(): Vec3;
|
|
650
|
+
static lookAt(eye: Vec3, target: Vec3, up?: Vec3): CFrame;
|
|
651
|
+
static fromEulerAngles(rx: number, ry: number, rz: number, order?: THREE.EulerOrder): CFrame;
|
|
649
652
|
inverse(): CFrame;
|
|
650
653
|
multiply(cf: CFrame): CFrame;
|
|
651
654
|
isSame(other: CFrame): boolean;
|
|
@@ -718,6 +721,8 @@ export declare class Content {
|
|
|
718
721
|
externalObject?: Instance;
|
|
719
722
|
}
|
|
720
723
|
|
|
724
|
+
export declare const ContentMap: Map<string, string>;
|
|
725
|
+
|
|
721
726
|
declare class COREMESH {
|
|
722
727
|
numverts: number;
|
|
723
728
|
verts: FileMeshVertex[];
|
|
@@ -728,6 +733,8 @@ declare class COREMESH {
|
|
|
728
733
|
getTouchingVerts(index: number): number[];
|
|
729
734
|
}
|
|
730
735
|
|
|
736
|
+
export declare function createContentMap(): void;
|
|
737
|
+
|
|
731
738
|
export declare function createMeshChunks(mesh: FileMesh, widthSplit: number, heightSplit: number, depthSplit: number): MeshChunk[];
|
|
732
739
|
|
|
733
740
|
/**THIS FUNCTION IS SO EXPENSIVE IT NEEDS TO BE ASYNC SO JS DOESNT CRASH, USE CHUNKED VERSION INSTEAD
|
|
@@ -782,6 +789,8 @@ export declare const DefaultAnimations: {
|
|
|
782
789
|
*/
|
|
783
790
|
export declare const DefaultAnimationsR6: typeof DefaultAnimations;
|
|
784
791
|
|
|
792
|
+
export declare function DefaultGetWorkerFunc(): Worker;
|
|
793
|
+
|
|
785
794
|
export declare const defaultPantAssetIds: number[];
|
|
786
795
|
|
|
787
796
|
export declare const defaultPantTemplateAssetIds: number[];
|
|
@@ -954,6 +963,8 @@ export declare const FLAGS: {
|
|
|
954
963
|
ROAVATAR_TRYON_PLACE: number;
|
|
955
964
|
ASSETS_PATH: string;
|
|
956
965
|
ASSETDELIVERY_V2: boolean;
|
|
966
|
+
ONLINE_ASSETS: boolean;
|
|
967
|
+
RIG_PATH: string;
|
|
957
968
|
USE_WORKERS: boolean;
|
|
958
969
|
ENABLE_LC_WEIGHT_CACHE: boolean;
|
|
959
970
|
INFLATE_LAYERED_CLOTHING: number;
|
|
@@ -1016,6 +1027,8 @@ export declare function GetAttachedPart(accessory: Instance, rig: Instance): Ins
|
|
|
1016
1027
|
|
|
1017
1028
|
export declare function getDistVertArray(ref: FileMesh, dist: FileMesh): (FileMeshVertex | undefined)[];
|
|
1018
1029
|
|
|
1030
|
+
export declare function getHeadExtents(rig: Instance): [Vector3, Vector3] | undefined;
|
|
1031
|
+
|
|
1019
1032
|
export declare interface GetInfoForId_Result {
|
|
1020
1033
|
"description": string;
|
|
1021
1034
|
"created": string;
|
|
@@ -1077,6 +1090,8 @@ export declare function getUVtoIndexMap(mesh: FileMesh): Map<number, number>;
|
|
|
1077
1090
|
|
|
1078
1091
|
export declare function getUVtoVertMap(mesh: FileMesh): Map<number, FileMeshVertex[]>;
|
|
1079
1092
|
|
|
1093
|
+
export declare function getWorkerOnMessage(): (event: MessageEvent) => void;
|
|
1094
|
+
|
|
1080
1095
|
export declare function hashVec2(x: number, y: number): number;
|
|
1081
1096
|
|
|
1082
1097
|
export declare function hashVec3(x: number, y: number, z: number, distance: number): number;
|
|
@@ -1593,7 +1608,6 @@ export declare class ModelWrapper extends InstanceWrapper {
|
|
|
1593
1608
|
static requiredProperties: string[];
|
|
1594
1609
|
setup(): void;
|
|
1595
1610
|
GetModelCFrame(): CFrame;
|
|
1596
|
-
GetExtentsSize(): Vector3;
|
|
1597
1611
|
}
|
|
1598
1612
|
|
|
1599
1613
|
/**
|
|
@@ -2507,6 +2521,8 @@ export declare class UDim2 {
|
|
|
2507
2521
|
clone(): UDim2;
|
|
2508
2522
|
}
|
|
2509
2523
|
|
|
2524
|
+
export declare function updateCameraForHeadshotCustomized(rig: Instance, fov: number, yRot: number, distance: number): void;
|
|
2525
|
+
|
|
2510
2526
|
declare type UserInfo = {
|
|
2511
2527
|
id: number;
|
|
2512
2528
|
name: string;
|
|
@@ -2623,6 +2639,10 @@ export declare type WeightChunk3 = WeightChunk & {
|
|
|
2623
2639
|
weights: Vec3[];
|
|
2624
2640
|
};
|
|
2625
2641
|
|
|
2642
|
+
export declare const WorkerTypeToFunction: {
|
|
2643
|
+
[K in string]: Function;
|
|
2644
|
+
};
|
|
2645
|
+
|
|
2626
2646
|
export declare const WrapLayerAutoSkin: {
|
|
2627
2647
|
Disabled: number;
|
|
2628
2648
|
EnabledPreserve: number;
|
package/dist/index.js
CHANGED
|
@@ -29696,6 +29696,13 @@ const WorkerTypeToFunction = {
|
|
|
29696
29696
|
"patchRBF": patchRBFWorkerFunc,
|
|
29697
29697
|
"RBFDeformerSolveAsync": RBFDeformerSolveAsync
|
|
29698
29698
|
};
|
|
29699
|
+
function getWorkerOnMessage() {
|
|
29700
|
+
return function(event) {
|
|
29701
|
+
const [id, type, data] = event.data;
|
|
29702
|
+
const func = WorkerTypeToFunction[type];
|
|
29703
|
+
self.postMessage([id, func(data)]);
|
|
29704
|
+
};
|
|
29705
|
+
}
|
|
29699
29706
|
function DefaultGetWorkerFunc() {
|
|
29700
29707
|
return new WorkerWrapper();
|
|
29701
29708
|
}
|
|
@@ -29712,8 +29719,11 @@ const FLAGS = {
|
|
|
29712
29719
|
ROAVATAR_DATA_URL: "rbxassetid://102463700065175",
|
|
29713
29720
|
//url of model to load that lists issues with specific versions
|
|
29714
29721
|
ROAVATAR_TRYON_PLACE: 135979364355750,
|
|
29715
|
-
ASSETS_PATH: "../assets/rbxasset/",
|
|
29716
29722
|
ASSETDELIVERY_V2: true,
|
|
29723
|
+
//assets
|
|
29724
|
+
ONLINE_ASSETS: false,
|
|
29725
|
+
ASSETS_PATH: "../assets/rbxasset/",
|
|
29726
|
+
RIG_PATH: "../assets/",
|
|
29717
29727
|
//layered clothing
|
|
29718
29728
|
USE_WORKERS: true,
|
|
29719
29729
|
ENABLE_LC_WEIGHT_CACHE: true,
|
|
@@ -30104,6 +30114,27 @@ class CFrame {
|
|
|
30104
30114
|
r22
|
|
30105
30115
|
], order);
|
|
30106
30116
|
}
|
|
30117
|
+
lookVector() {
|
|
30118
|
+
const matrix2 = this.getTHREEMatrix();
|
|
30119
|
+
const pos = new Vector3$1();
|
|
30120
|
+
const quat = new Quaternion();
|
|
30121
|
+
const scale = new Vector3$1();
|
|
30122
|
+
matrix2.decompose(pos, quat, scale);
|
|
30123
|
+
const lookVector = new Vector3$1(0, 0, -1);
|
|
30124
|
+
lookVector.applyQuaternion(quat);
|
|
30125
|
+
return lookVector.toArray();
|
|
30126
|
+
}
|
|
30127
|
+
static lookAt(eye, target, up = [0, 1, 0]) {
|
|
30128
|
+
const matrix2 = new Matrix4().lookAt(new Vector3$1(...eye), new Vector3$1(...target), new Vector3$1(...up));
|
|
30129
|
+
const newCFrame = new CFrame();
|
|
30130
|
+
newCFrame.fromMatrix(matrix2.elements);
|
|
30131
|
+
newCFrame.Position = [...eye];
|
|
30132
|
+
return newCFrame;
|
|
30133
|
+
}
|
|
30134
|
+
static fromEulerAngles(rx, ry, rz, order = "XYZ") {
|
|
30135
|
+
const matrix2 = new Matrix4().makeRotationFromEuler(new Euler(rx, ry, rz, order));
|
|
30136
|
+
return new CFrame().fromMatrix(matrix2.elements);
|
|
30137
|
+
}
|
|
30107
30138
|
inverse() {
|
|
30108
30139
|
const thisM = new Matrix4().fromArray(this.getMatrix());
|
|
30109
30140
|
const inverse = thisM.clone();
|
|
@@ -35053,25 +35084,106 @@ const CACHE = {
|
|
|
35053
35084
|
"UserInfo": void 0
|
|
35054
35085
|
};
|
|
35055
35086
|
const ContentMap = /* @__PURE__ */ new Map();
|
|
35056
|
-
|
|
35057
|
-
ContentMap.set("rbxasset://fonts/
|
|
35058
|
-
ContentMap.set("rbxasset://fonts/
|
|
35059
|
-
ContentMap.set("rbxasset://fonts/
|
|
35060
|
-
ContentMap.set("rbxasset://fonts/
|
|
35061
|
-
ContentMap.set("rbxasset://fonts/
|
|
35062
|
-
ContentMap.set("rbxasset://fonts/
|
|
35063
|
-
ContentMap.set("rbxasset://fonts/
|
|
35064
|
-
ContentMap.set("rbxasset://fonts/
|
|
35065
|
-
ContentMap.set("rbxasset://fonts/
|
|
35066
|
-
ContentMap.set("rbxasset://fonts/
|
|
35067
|
-
ContentMap.set("rbxasset://fonts/
|
|
35068
|
-
ContentMap.set("rbxasset://fonts/
|
|
35069
|
-
ContentMap.set("rbxasset://fonts/
|
|
35070
|
-
ContentMap.set("rbxasset://fonts/
|
|
35071
|
-
ContentMap.set("rbxasset://fonts/
|
|
35072
|
-
ContentMap.set("rbxasset://fonts/
|
|
35073
|
-
ContentMap.set("rbxasset://fonts/
|
|
35074
|
-
ContentMap.set("rbxasset://fonts/
|
|
35087
|
+
function createContentMap() {
|
|
35088
|
+
ContentMap.set("rbxasset://fonts/BaseballCap.mesh", "12220916");
|
|
35089
|
+
ContentMap.set("rbxasset://fonts/clonewand.mesh", "12221344");
|
|
35090
|
+
ContentMap.set("rbxasset://fonts/fusedgirl.mesh", "12221423");
|
|
35091
|
+
ContentMap.set("rbxasset://fonts/girlhair.mesh", "12221431");
|
|
35092
|
+
ContentMap.set("rbxasset://fonts/hammer.mesh", "12221451");
|
|
35093
|
+
ContentMap.set("rbxasset://fonts/NinjaMask.mesh", "12221524");
|
|
35094
|
+
ContentMap.set("rbxasset://fonts/paintballgun.mesh", "11900867");
|
|
35095
|
+
ContentMap.set("rbxasset://fonts/pawn.mesh", "12221585");
|
|
35096
|
+
ContentMap.set("rbxasset://fonts/PirateHat.mesh", "12221595");
|
|
35097
|
+
ContentMap.set("rbxasset://fonts/PoliceCap.mesh", "12221603");
|
|
35098
|
+
ContentMap.set("rbxasset://fonts/rocketlauncher.mesh", "12221651");
|
|
35099
|
+
ContentMap.set("rbxasset://fonts/slingshot.mesh", "12221682");
|
|
35100
|
+
ContentMap.set("rbxasset://fonts/sombrero.mesh", "12221705");
|
|
35101
|
+
ContentMap.set("rbxasset://fonts/sword.mesh", "12221720");
|
|
35102
|
+
ContentMap.set("rbxasset://fonts/timebomb.mesh", "12221733");
|
|
35103
|
+
ContentMap.set("rbxasset://fonts/tophat.mesh", "12221750");
|
|
35104
|
+
ContentMap.set("rbxasset://fonts/tree.mesh", "12221787");
|
|
35105
|
+
ContentMap.set("rbxasset://fonts/trowel.mesh", "12221793");
|
|
35106
|
+
ContentMap.set("rbxasset://fonts/VikingHelmet.mesh", "12221815");
|
|
35107
|
+
if (FLAGS.ONLINE_ASSETS) {
|
|
35108
|
+
ContentMap.set("rbxasset://textures/particles/SquareParticle.png", "rbxassetid://81536466622192");
|
|
35109
|
+
ContentMap.set("rbxasset://textures/particles/sparkles_main.png", "rbxassetid://87394320952325");
|
|
35110
|
+
ContentMap.set("rbxasset://textures/particles/sparkles_color.png", "rbxassetid://133057519435872");
|
|
35111
|
+
ContentMap.set("rbxasset://textures/particles/smoke_main.png", "rbxassetid://138162637433023");
|
|
35112
|
+
ContentMap.set("rbxasset://textures/particles/smoke_color.png", "rbxassetid://125845160650254");
|
|
35113
|
+
ContentMap.set("rbxasset://textures/particles/legacy_fire_alpha_color.png", "rbxassetid://118480963109188");
|
|
35114
|
+
ContentMap.set("rbxasset://textures/particles/forcefield_vortex_main.png", "rbxassetid://90748587720186");
|
|
35115
|
+
ContentMap.set("rbxasset://textures/particles/forcefield_vortex_color.png", "rbxassetid://114134905691033");
|
|
35116
|
+
ContentMap.set("rbxasset://textures/particles/forcefield_glow_main.png", "rbxassetid://118476782259878");
|
|
35117
|
+
ContentMap.set("rbxasset://textures/particles/forcefield_glow_color.png", "rbxassetid://136830612119909");
|
|
35118
|
+
ContentMap.set("rbxasset://textures/particles/forcefield_glow_alpha.png", "rbxassetid://127202098262235");
|
|
35119
|
+
ContentMap.set("rbxasset://textures/particles/forcefield_alpha.png", "rbxassetid://114076943026381");
|
|
35120
|
+
ContentMap.set("rbxasset://textures/particles/fire_sparks_main.png", "rbxassetid://104223768023861");
|
|
35121
|
+
ContentMap.set("rbxasset://textures/particles/fire_sparks_color.png", "rbxassetid://140709297018478");
|
|
35122
|
+
ContentMap.set("rbxasset://textures/particles/fire_main.png", "rbxassetid://95195318391696");
|
|
35123
|
+
ContentMap.set("rbxasset://textures/particles/fire_color.png", "rbxassetid://71855354689630");
|
|
35124
|
+
ContentMap.set("rbxasset://textures/particles/fire_alpha.png", "rbxassetid://137123937216738");
|
|
35125
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_smoke_main.png", "rbxassetid://93992972651499");
|
|
35126
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_smoke_color_new.png", "rbxassetid://86144670293531");
|
|
35127
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_smoke_alpha.png", "rbxassetid://138742967158809");
|
|
35128
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_shockwave_main.png", "rbxassetid://116101962979677");
|
|
35129
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_implosion_main.png", "rbxassetid://86764380638770");
|
|
35130
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_implosion_color.png", "rbxassetid://127669378194473");
|
|
35131
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_core_main.png", "rbxassetid://94075508535469");
|
|
35132
|
+
ContentMap.set("rbxasset://textures/particles/explosion01_core_alpha.png", "rbxassetid://99241903368204");
|
|
35133
|
+
ContentMap.set("rbxasset://textures/particles/explosion_color.png", "rbxassetid://93670753826336");
|
|
35134
|
+
ContentMap.set("rbxasset://textures/particles/explosion_alpha.png", "rbxassetid://115975840525503");
|
|
35135
|
+
ContentMap.set("rbxasset://textures/particles/common_alpha.png", "rbxassetid://76897028114182");
|
|
35136
|
+
ContentMap.set("rbxasset://textures/face.png", "rbxassetid://126076136486265");
|
|
35137
|
+
ContentMap.set("rbxasset://avatar/meshes/torso.mesh", "85617550700848");
|
|
35138
|
+
ContentMap.set("rbxasset://avatar/meshes/rightleg.mesh", "72388106457735");
|
|
35139
|
+
ContentMap.set("rbxasset://avatar/meshes/rightarm.mesh", "111146997566389");
|
|
35140
|
+
ContentMap.set("rbxasset://avatar/meshes/leftleg.mesh", "90013209978879");
|
|
35141
|
+
ContentMap.set("rbxasset://avatar/meshes/leftarm.mesh", "107015122138989");
|
|
35142
|
+
ContentMap.set("rbxasset://avatar/heads/headP.mesh", "92893933522111");
|
|
35143
|
+
ContentMap.set("rbxasset://avatar/heads/headO.mesh", "77541016415293");
|
|
35144
|
+
ContentMap.set("rbxasset://avatar/heads/headN.mesh", "135830315772083");
|
|
35145
|
+
ContentMap.set("rbxasset://avatar/heads/headM.mesh", "72296270663395");
|
|
35146
|
+
ContentMap.set("rbxasset://avatar/heads/headL.mesh", "118173713712494");
|
|
35147
|
+
ContentMap.set("rbxasset://avatar/heads/headK.mesh", "87988019718389");
|
|
35148
|
+
ContentMap.set("rbxasset://avatar/heads/headJ.mesh", "87602015805248");
|
|
35149
|
+
ContentMap.set("rbxasset://avatar/heads/headI.mesh", "105758863945258");
|
|
35150
|
+
ContentMap.set("rbxasset://avatar/heads/headH.mesh", "82654813279081");
|
|
35151
|
+
ContentMap.set("rbxasset://avatar/heads/headG.mesh", "78217037620613");
|
|
35152
|
+
ContentMap.set("rbxasset://avatar/heads/headF.mesh", "81353062523004");
|
|
35153
|
+
ContentMap.set("rbxasset://avatar/heads/headE.mesh", "113298530836166");
|
|
35154
|
+
ContentMap.set("rbxasset://avatar/heads/headD.mesh", "84378174703962");
|
|
35155
|
+
ContentMap.set("rbxasset://avatar/heads/headC.mesh", "114955209749256");
|
|
35156
|
+
ContentMap.set("rbxasset://avatar/heads/headB.mesh", "86540893905615");
|
|
35157
|
+
ContentMap.set("rbxasset://avatar/heads/headA.mesh", "77314442147190");
|
|
35158
|
+
ContentMap.set("rbxasset://avatar/heads/head.mesh", "84927473172716");
|
|
35159
|
+
ContentMap.set("rbxasset://avatar/compositing/R15CompositTorsoBase.mesh", "128898737887110");
|
|
35160
|
+
ContentMap.set("rbxasset://avatar/compositing/R15CompositRightArmBase.mesh", "130403245999873");
|
|
35161
|
+
ContentMap.set("rbxasset://avatar/compositing/R15CompositLeftArmBase.mesh", "122438986243654");
|
|
35162
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositTShirt.mesh", "73352601509228");
|
|
35163
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositTorsoBase.mesh", "110815013780474");
|
|
35164
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositShirtTemplate.mesh", "99918409598660");
|
|
35165
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositRightLegBase.mesh", "107252470435894");
|
|
35166
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositRightArmBase.mesh", "86285571969113");
|
|
35167
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositQuad.mesh", "86988649991001");
|
|
35168
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositPantsTemplate.mesh", "108749124518615");
|
|
35169
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositLeftLegBase.mesh", "126843307192697");
|
|
35170
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositLeftArmBase.mesh", "124757651657333");
|
|
35171
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositFullAtlasOverlayTexture.mesh", "99832238544592");
|
|
35172
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositFullAtlasBaseTexture.mesh", "82745085603378");
|
|
35173
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositExtraSlot4.mesh", "90442767118712");
|
|
35174
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositExtraSlot3.mesh", "114465125672717");
|
|
35175
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositExtraSlot2.mesh", "111697299800137");
|
|
35176
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositExtraSlot1.mesh", "92101687933174");
|
|
35177
|
+
ContentMap.set("rbxasset://avatar/compositing/CompositExtraSlot0.mesh", "115275146529093");
|
|
35178
|
+
}
|
|
35179
|
+
if (FLAGS.ONLINE_ASSETS) {
|
|
35180
|
+
ContentMap.set("roavatar://RigR6.rbxm", "134202675113006");
|
|
35181
|
+
ContentMap.set("roavatar://RigR15.rbxm", "117612227055721");
|
|
35182
|
+
} else {
|
|
35183
|
+
ContentMap.set("roavatar://RigR6.rbxm", FLAGS.RIG_PATH + "RigR6.rbxm");
|
|
35184
|
+
ContentMap.set("roavatar://RigR15.rbxm", FLAGS.RIG_PATH + "RigR15.rbxm");
|
|
35185
|
+
}
|
|
35186
|
+
}
|
|
35075
35187
|
let CachedRoAvatarData = void 0;
|
|
35076
35188
|
let ThumbnailsToBatch = [];
|
|
35077
35189
|
const API = {
|
|
@@ -35092,7 +35204,7 @@ const API = {
|
|
|
35092
35204
|
let url = str;
|
|
35093
35205
|
const contentUrl = ContentMap.get(str);
|
|
35094
35206
|
if (contentUrl) {
|
|
35095
|
-
console.log(
|
|
35207
|
+
console.log(`ContentMap: ${str} -> ${contentUrl}`);
|
|
35096
35208
|
str = contentUrl;
|
|
35097
35209
|
url = str;
|
|
35098
35210
|
}
|
|
@@ -61072,7 +61184,7 @@ class HumanoidDescriptionWrapper extends InstanceWrapper {
|
|
|
61072
61184
|
}));
|
|
61073
61185
|
} else {
|
|
61074
61186
|
promises.push(new Promise((resolve) => {
|
|
61075
|
-
API.Asset.GetRBX(avatarType === AvatarType.R6 ? "
|
|
61187
|
+
API.Asset.GetRBX(avatarType === AvatarType.R6 ? "roavatar://RigR6.rbxm" : "roavatar://RigR15.rbxm", void 0).then((result) => {
|
|
61076
61188
|
if (this.cancelApply) resolve(void 0);
|
|
61077
61189
|
if (result instanceof RBX) {
|
|
61078
61190
|
const dataModel = result.generateTree();
|
|
@@ -61783,35 +61895,6 @@ class WeldWrapper extends InstanceWrapper {
|
|
|
61783
61895
|
class ManualWeldWrapper extends WeldWrapper {
|
|
61784
61896
|
static className = "ManualWeld";
|
|
61785
61897
|
}
|
|
61786
|
-
function getCorners(cframe, size2) {
|
|
61787
|
-
const halfX = size2.X / 2;
|
|
61788
|
-
const halfY = size2.Y / 2;
|
|
61789
|
-
const halfZ = size2.Z / 2;
|
|
61790
|
-
return [
|
|
61791
|
-
cframe.multiply(new CFrame(halfX, halfY, halfZ)),
|
|
61792
|
-
cframe.multiply(new CFrame(halfX, halfY, -halfZ)),
|
|
61793
|
-
cframe.multiply(new CFrame(-halfX, halfY, halfZ)),
|
|
61794
|
-
cframe.multiply(new CFrame(-halfX, halfY, -halfZ)),
|
|
61795
|
-
cframe.multiply(new CFrame(halfX, -halfY, halfZ)),
|
|
61796
|
-
cframe.multiply(new CFrame(halfX, -halfY, -halfZ)),
|
|
61797
|
-
cframe.multiply(new CFrame(-halfX, -halfY, halfZ)),
|
|
61798
|
-
cframe.multiply(new CFrame(-halfX, -halfY, -halfZ))
|
|
61799
|
-
];
|
|
61800
|
-
}
|
|
61801
|
-
function getLower(a, b) {
|
|
61802
|
-
return new Vector32(
|
|
61803
|
-
a.X < b.X ? a.X : b.X,
|
|
61804
|
-
a.Y < b.Y ? a.Y : b.Y,
|
|
61805
|
-
a.Z < b.Z ? a.Z : b.Z
|
|
61806
|
-
);
|
|
61807
|
-
}
|
|
61808
|
-
function getHigher(a, b) {
|
|
61809
|
-
return new Vector32(
|
|
61810
|
-
a.X > b.X ? a.X : b.X,
|
|
61811
|
-
a.Y > b.Y ? a.Y : b.Y,
|
|
61812
|
-
a.Z > b.Z ? a.Z : b.Z
|
|
61813
|
-
);
|
|
61814
|
-
}
|
|
61815
61898
|
class ModelWrapper extends InstanceWrapper {
|
|
61816
61899
|
static className = "Model";
|
|
61817
61900
|
static requiredProperties = ["Name", "PrimaryPart"];
|
|
@@ -61826,22 +61909,6 @@ class ModelWrapper extends InstanceWrapper {
|
|
|
61826
61909
|
}
|
|
61827
61910
|
throw new Error("Model has no PrimaryPart");
|
|
61828
61911
|
}
|
|
61829
|
-
GetExtentsSize() {
|
|
61830
|
-
let lowerExtents = new Vector32(0, 0, 0);
|
|
61831
|
-
let higherExtents = new Vector32(0, 0, 0);
|
|
61832
|
-
for (const child of this.instance.GetDescendants()) {
|
|
61833
|
-
if (child.className === "Part" || child.className === "MeshPart") {
|
|
61834
|
-
const cframe = traverseRigCFrame(child);
|
|
61835
|
-
const size2 = child.Prop("Size");
|
|
61836
|
-
const corners = getCorners(cframe, size2);
|
|
61837
|
-
for (const corner of corners) {
|
|
61838
|
-
lowerExtents = getLower(lowerExtents, new Vector32().fromVec3(corner.Position));
|
|
61839
|
-
higherExtents = getHigher(higherExtents, new Vector32().fromVec3(corner.Position));
|
|
61840
|
-
}
|
|
61841
|
-
}
|
|
61842
|
-
}
|
|
61843
|
-
return higherExtents.minus(lowerExtents);
|
|
61844
|
-
}
|
|
61845
61912
|
}
|
|
61846
61913
|
class Motor6DWrapper extends WeldWrapper {
|
|
61847
61914
|
static className = "Motor6D";
|
|
@@ -62108,6 +62175,7 @@ class RBXRenderer {
|
|
|
62108
62175
|
static error;
|
|
62109
62176
|
static async boilerplateSetup() {
|
|
62110
62177
|
RegisterWrappers();
|
|
62178
|
+
createContentMap();
|
|
62111
62179
|
setupWorkerPool();
|
|
62112
62180
|
loadCompositMeshes();
|
|
62113
62181
|
}
|
|
@@ -62650,6 +62718,111 @@ class HSR {
|
|
|
62650
62718
|
}
|
|
62651
62719
|
}
|
|
62652
62720
|
}
|
|
62721
|
+
function getCorners(cframe, size2) {
|
|
62722
|
+
const halfX = size2.X / 2;
|
|
62723
|
+
const halfY = size2.Y / 2;
|
|
62724
|
+
const halfZ = size2.Z / 2;
|
|
62725
|
+
return [
|
|
62726
|
+
cframe.multiply(new CFrame(halfX, halfY, halfZ)),
|
|
62727
|
+
cframe.multiply(new CFrame(halfX, halfY, -halfZ)),
|
|
62728
|
+
cframe.multiply(new CFrame(-halfX, halfY, halfZ)),
|
|
62729
|
+
cframe.multiply(new CFrame(-halfX, halfY, -halfZ)),
|
|
62730
|
+
cframe.multiply(new CFrame(halfX, -halfY, halfZ)),
|
|
62731
|
+
cframe.multiply(new CFrame(halfX, -halfY, -halfZ)),
|
|
62732
|
+
cframe.multiply(new CFrame(-halfX, -halfY, halfZ)),
|
|
62733
|
+
cframe.multiply(new CFrame(-halfX, -halfY, -halfZ))
|
|
62734
|
+
];
|
|
62735
|
+
}
|
|
62736
|
+
function getLower(a, b) {
|
|
62737
|
+
return new Vector32(
|
|
62738
|
+
a.X < b.X ? a.X : b.X,
|
|
62739
|
+
a.Y < b.Y ? a.Y : b.Y,
|
|
62740
|
+
a.Z < b.Z ? a.Z : b.Z
|
|
62741
|
+
);
|
|
62742
|
+
}
|
|
62743
|
+
function getHigher(a, b) {
|
|
62744
|
+
return new Vector32(
|
|
62745
|
+
a.X > b.X ? a.X : b.X,
|
|
62746
|
+
a.Y > b.Y ? a.Y : b.Y,
|
|
62747
|
+
a.Z > b.Z ? a.Z : b.Z
|
|
62748
|
+
);
|
|
62749
|
+
}
|
|
62750
|
+
function getExtents(cframe, parts) {
|
|
62751
|
+
const inverseCF = cframe.inverse();
|
|
62752
|
+
let lowerExtents = new Vector32(0, 0, 0);
|
|
62753
|
+
let higherExtents = new Vector32(0, 0, 0);
|
|
62754
|
+
for (const child of parts) {
|
|
62755
|
+
if (child.className === "Part" || child.className === "MeshPart") {
|
|
62756
|
+
const partCF = child.Prop("CFrame");
|
|
62757
|
+
const partSize = child.Prop("Size");
|
|
62758
|
+
const corners = getCorners(inverseCF.multiply(partCF), partSize);
|
|
62759
|
+
for (const corner of corners) {
|
|
62760
|
+
lowerExtents = getLower(lowerExtents, new Vector32().fromVec3(corner.Position));
|
|
62761
|
+
higherExtents = getHigher(higherExtents, new Vector32().fromVec3(corner.Position));
|
|
62762
|
+
}
|
|
62763
|
+
}
|
|
62764
|
+
}
|
|
62765
|
+
return [lowerExtents, higherExtents];
|
|
62766
|
+
}
|
|
62767
|
+
function zoomExtents(cameraCFrame, modelCFrame, modelSize, targetFOV, distanceScale) {
|
|
62768
|
+
const largestSize = Math.max(modelSize.X, modelSize.Y, modelSize.Z);
|
|
62769
|
+
const fovMultiplier = 70 / targetFOV;
|
|
62770
|
+
const lookDir = multiply$1(normalize(minus(cameraCFrame.Position, modelCFrame.Position)), [distanceScale, distanceScale, distanceScale]);
|
|
62771
|
+
cameraCFrame.Position = add$2(modelCFrame.Position, multiply$1(multiply$1(lookDir, [largestSize, largestSize, largestSize]), [fovMultiplier, fovMultiplier, fovMultiplier]));
|
|
62772
|
+
}
|
|
62773
|
+
function getHeadExtents(rig) {
|
|
62774
|
+
const head = rig.FindFirstChild("Head");
|
|
62775
|
+
if (!head) return;
|
|
62776
|
+
const headParts = [];
|
|
62777
|
+
for (const child of rig.GetDescendants()) {
|
|
62778
|
+
if (child === head) {
|
|
62779
|
+
headParts.push(head);
|
|
62780
|
+
} else {
|
|
62781
|
+
const weld = child.FindFirstChildOfClass("Weld");
|
|
62782
|
+
if (weld && child.parent && child.parent.className === "Accessory") {
|
|
62783
|
+
if (weld.Prop("Part0") === head || weld.Prop("Part1") === head) {
|
|
62784
|
+
headParts.push(child);
|
|
62785
|
+
}
|
|
62786
|
+
}
|
|
62787
|
+
}
|
|
62788
|
+
}
|
|
62789
|
+
const extents = getExtents(head.Prop("CFrame"), headParts);
|
|
62790
|
+
return extents;
|
|
62791
|
+
}
|
|
62792
|
+
function updateCameraForHeadshotCustomized(rig, fov2, yRot, distance2) {
|
|
62793
|
+
const head = rig.FindFirstChild("Head");
|
|
62794
|
+
if (!head) return;
|
|
62795
|
+
const headCF = head.PropOrDefault("CFrame", new CFrame());
|
|
62796
|
+
const headLocalExtents = getHeadExtents(rig);
|
|
62797
|
+
if (!headLocalExtents) return;
|
|
62798
|
+
const headCenterPosLocal = headLocalExtents[0].add(headLocalExtents[1].minus(headLocalExtents[0]).divide(new Vector32(2, 2, 2)));
|
|
62799
|
+
const headCenterPos = new Vector32().fromVec3(headCF.multiply(new CFrame(...headCenterPosLocal.toVec3())).Position);
|
|
62800
|
+
const headCenterCF = new CFrame(...headCenterPos.toVec3());
|
|
62801
|
+
let lookVector = headCF.lookVector();
|
|
62802
|
+
if (Math.abs(lookVector[1]) > 0.95) {
|
|
62803
|
+
lookVector = [0, 0, -1];
|
|
62804
|
+
} else {
|
|
62805
|
+
lookVector[1] = 0;
|
|
62806
|
+
lookVector = normalize(lookVector);
|
|
62807
|
+
}
|
|
62808
|
+
let lookCF = CFrame.lookAt([0, 0, 0], lookVector);
|
|
62809
|
+
lookCF = lookCF.multiply(CFrame.fromEulerAngles(0, yRot, 0, "ZXY"));
|
|
62810
|
+
lookVector = lookCF.lookVector();
|
|
62811
|
+
const fovMultiplier = 70 / fov2;
|
|
62812
|
+
lookCF.Position = add$2(headCenterCF.Position, multiply$1(multiply$1([10, 10, 10], lookVector), [fovMultiplier, fovMultiplier, fovMultiplier]));
|
|
62813
|
+
lookCF = CFrame.lookAt(lookCF.Position, headCenterCF.Position);
|
|
62814
|
+
const cameraCF = lookCF.clone();
|
|
62815
|
+
zoomExtents(cameraCF, headCenterCF, headLocalExtents[1].minus(headLocalExtents[0]), fov2, distance2);
|
|
62816
|
+
const camPos = new Vector3$1();
|
|
62817
|
+
const camQuat = new Quaternion();
|
|
62818
|
+
const camScale = new Vector3$1();
|
|
62819
|
+
const camMatrix = cameraCF.getTHREEMatrix();
|
|
62820
|
+
camMatrix.decompose(camPos, camQuat, camScale);
|
|
62821
|
+
RBXRenderer.getRendererCamera().position.set(...camPos.toArray());
|
|
62822
|
+
RBXRenderer.getRendererCamera().quaternion.set(...camQuat.toArray());
|
|
62823
|
+
RBXRenderer.getRendererCamera().fov = fov2;
|
|
62824
|
+
RBXRenderer.getRendererCamera().updateMatrixWorld();
|
|
62825
|
+
}
|
|
62653
62826
|
class OutfitRenderer {
|
|
62654
62827
|
auth;
|
|
62655
62828
|
outfit;
|
|
@@ -62881,9 +63054,11 @@ export {
|
|
|
62881
63054
|
ColorSequenceKeypoint,
|
|
62882
63055
|
Connection,
|
|
62883
63056
|
Content,
|
|
63057
|
+
ContentMap,
|
|
62884
63058
|
DataType,
|
|
62885
63059
|
DefaultAnimations,
|
|
62886
63060
|
DefaultAnimationsR6,
|
|
63061
|
+
DefaultGetWorkerFunc,
|
|
62887
63062
|
DefaultSearchData,
|
|
62888
63063
|
EmitterGroupDescClassTypes,
|
|
62889
63064
|
Event,
|
|
@@ -62955,6 +63130,7 @@ export {
|
|
|
62955
63130
|
Vector32 as Vector3,
|
|
62956
63131
|
Wait,
|
|
62957
63132
|
WearableAssetTypes,
|
|
63133
|
+
WorkerTypeToFunction,
|
|
62958
63134
|
WrapLayerAutoSkin,
|
|
62959
63135
|
accessoryRefinementLowerBounds,
|
|
62960
63136
|
accessoryRefinementTypes,
|
|
@@ -62977,6 +63153,7 @@ export {
|
|
|
62977
63153
|
clonePrimitiveArray,
|
|
62978
63154
|
cloneSearch_Payload,
|
|
62979
63155
|
closestPointTriangle,
|
|
63156
|
+
createContentMap,
|
|
62980
63157
|
createMeshChunks,
|
|
62981
63158
|
createWeightsForMesh,
|
|
62982
63159
|
createWeightsForMeshChunked,
|
|
@@ -62996,12 +63173,14 @@ export {
|
|
|
62996
63173
|
gaussian_rbf,
|
|
62997
63174
|
generateUUIDv4,
|
|
62998
63175
|
getDistVertArray,
|
|
63176
|
+
getHeadExtents,
|
|
62999
63177
|
getOffsetArray,
|
|
63000
63178
|
getOffsetMap,
|
|
63001
63179
|
getOriginalSize,
|
|
63002
63180
|
getRandomBetweenInclusive,
|
|
63003
63181
|
getUVtoIndexMap,
|
|
63004
63182
|
getUVtoVertMap,
|
|
63183
|
+
getWorkerOnMessage,
|
|
63005
63184
|
hasSameVal,
|
|
63006
63185
|
hasSameValFloat,
|
|
63007
63186
|
hashVec2,
|
|
@@ -63049,6 +63228,7 @@ export {
|
|
|
63049
63228
|
traverseRigCFrame,
|
|
63050
63229
|
traverseRigInstance,
|
|
63051
63230
|
triangleNormal,
|
|
63231
|
+
updateCameraForHeadshotCustomized,
|
|
63052
63232
|
versionToNumber,
|
|
63053
63233
|
vertPosToChunkPos,
|
|
63054
63234
|
xmlMagic
|