roavatar-renderer 1.8.0 → 1.9.0
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.d.ts +31 -2
- package/dist/index.js +496 -34
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -431,6 +431,7 @@ export declare class Assembly {
|
|
|
431
431
|
rootNode: AssemblyNode;
|
|
432
432
|
allNodes: AssemblyNode[] | undefined;
|
|
433
433
|
allConnectors: Instance[] | undefined;
|
|
434
|
+
linearVelocity: Vector3;
|
|
434
435
|
constructor(rootPart: Instance);
|
|
435
436
|
getNodeDescendants(): AssemblyNode[];
|
|
436
437
|
getPartDescendants(): Instance[];
|
|
@@ -1655,6 +1656,8 @@ export declare const FLAGS: {
|
|
|
1655
1656
|
* @deprecated This can now be set per-scene
|
|
1656
1657
|
* */
|
|
1657
1658
|
PARTICLES_START_FULL_FRAMERATE: number;
|
|
1659
|
+
/**amount of segments a trail can create per second */
|
|
1660
|
+
TRAIL_FPS: number;
|
|
1658
1661
|
/**shows ThreeJS SkeletonHelper */
|
|
1659
1662
|
SHOW_SKELETON_HELPER: boolean;
|
|
1660
1663
|
/**if set the skeleton helper will only show if the instance has the name */
|
|
@@ -1837,8 +1840,15 @@ export declare function getCameraCFrameForAvatarNonCustomized(rig: Instance): CF
|
|
|
1837
1840
|
*/
|
|
1838
1841
|
export declare function getCameraCFrameForHeadshotCustomized(rig: Instance, fov: number, yRot: number, distance: number): CFrame | undefined;
|
|
1839
1842
|
|
|
1843
|
+
export declare function getCameraCFrameForHeadshotNonCustomized(rig: Instance, newLighting?: boolean): {
|
|
1844
|
+
cframe: CFrame;
|
|
1845
|
+
fov: number;
|
|
1846
|
+
};
|
|
1847
|
+
|
|
1840
1848
|
export declare function getCharacterTorsoCFrame(character: Instance): CFrame;
|
|
1841
1849
|
|
|
1850
|
+
export declare function getCloseupCameraCFrame(character: Instance, newLighting?: boolean): Instance;
|
|
1851
|
+
|
|
1842
1852
|
/**
|
|
1843
1853
|
* @category Mesh
|
|
1844
1854
|
*/
|
|
@@ -2725,7 +2735,16 @@ export declare class ModelWrapper extends InstanceWrapper {
|
|
|
2725
2735
|
/**
|
|
2726
2736
|
* @category InstanceWrapper
|
|
2727
2737
|
*/
|
|
2728
|
-
export declare class Motor6DWrapper extends
|
|
2738
|
+
export declare class Motor6DWrapper extends MotorWrapper {
|
|
2739
|
+
static className: string;
|
|
2740
|
+
static requiredProperties: string[];
|
|
2741
|
+
setup(): void;
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
/**
|
|
2745
|
+
* @category InstanceWrapper
|
|
2746
|
+
*/
|
|
2747
|
+
declare class MotorWrapper extends JointInstanceWrapper {
|
|
2729
2748
|
static className: string;
|
|
2730
2749
|
static requiredProperties: string[];
|
|
2731
2750
|
setup(): void;
|
|
@@ -3096,6 +3115,8 @@ export declare class OutfitRenderer {
|
|
|
3096
3115
|
doCameraUpdateOnLoad: boolean; /**Makes camera update when new avatar has loaded */
|
|
3097
3116
|
doCameraUpdate: boolean; /**Does camera update every frame */
|
|
3098
3117
|
doAddInstance: boolean; /**If outfitRenderer should call RBXRenderer.addInstance(), setting this to false will make OutfitRenderer return success early */
|
|
3118
|
+
doMoveLoose: boolean; /**If outfitRenderer should call this.moveLoose() when certain animations are playing */
|
|
3119
|
+
affectsLinearVelocity: boolean; /**If outfitRenderer should set the AssemblyLinearVelocity every animateOnce */
|
|
3099
3120
|
forceAnimationLoop: boolean; /**If future loaded animations should be set to loop */
|
|
3100
3121
|
backgroundRenderer: BackgroundRenderer;
|
|
3101
3122
|
currentlyChangingRig: boolean;
|
|
@@ -3170,10 +3191,12 @@ export declare class OutfitRenderer {
|
|
|
3170
3191
|
* Starts updating the animation of the outfit per frame
|
|
3171
3192
|
*/
|
|
3172
3193
|
startAnimating(): void;
|
|
3194
|
+
/**Animates moveLoose */
|
|
3195
|
+
animateMoveLoose(deltaTime: number): void;
|
|
3173
3196
|
/**
|
|
3174
3197
|
* Updates the animation once
|
|
3175
3198
|
*/
|
|
3176
|
-
animateOnce(deltaTimeOverride?: number): void;
|
|
3199
|
+
animateOnce(deltaTimeOverride?: number, forceTime?: number, forceKeyframe?: number): void;
|
|
3177
3200
|
/**
|
|
3178
3201
|
* Stops updating the animation of the outfit per frame
|
|
3179
3202
|
*/
|
|
@@ -3201,6 +3224,10 @@ export declare class OutfitRenderer {
|
|
|
3201
3224
|
* Updates rendered particles so they face the camera without simulating them (usually used when generating thumbnails)
|
|
3202
3225
|
*/
|
|
3203
3226
|
updateParticleMatrix(): void;
|
|
3227
|
+
/**
|
|
3228
|
+
* Moves "loose" things such as particles and trails by the Vec3 given, used to simulate character movement without actually moving the character
|
|
3229
|
+
*/
|
|
3230
|
+
moveLoose(vec: Vec3): void;
|
|
3204
3231
|
/**Calls destroy on the rig, stops animating and disconnects connections. The OutfitRenderer should not be interacted with after this */
|
|
3205
3232
|
destroy(): void;
|
|
3206
3233
|
}
|
|
@@ -3717,6 +3744,7 @@ declare class RenderDesc extends DisposableDesc {
|
|
|
3717
3744
|
fromInstance(_child: Instance): void;
|
|
3718
3745
|
compileResults(_renderer: THREE.WebGLRenderer, _scene: THREE.Scene): Promise<THREE.Object3D[] | Response | undefined>;
|
|
3719
3746
|
updateResults(): void;
|
|
3747
|
+
moveLoose(_diff: Vec3): void;
|
|
3720
3748
|
static shouldRenderInstance(_instance: Instance): boolean;
|
|
3721
3749
|
static register(): void;
|
|
3722
3750
|
static(): typeof RenderDesc;
|
|
@@ -3852,6 +3880,7 @@ export declare class ScriptWrapper extends InstanceWrapper {
|
|
|
3852
3880
|
Run(): void;
|
|
3853
3881
|
SoundPlayer(script: Instance): Promise<void>;
|
|
3854
3882
|
HatScript20(script: Instance): Promise<void>;
|
|
3883
|
+
TrailTestRoAvatar(script: Instance): Promise<void>;
|
|
3855
3884
|
}
|
|
3856
3885
|
|
|
3857
3886
|
declare class ScriptWrapperData {
|
package/dist/index.js
CHANGED
|
@@ -32629,6 +32629,7 @@ const FLAGS = {
|
|
|
32629
32629
|
RENDERER_DELTA_TIME_MULTIPLIER: 1,
|
|
32630
32630
|
PARTICLES_START_FULL: 0,
|
|
32631
32631
|
PARTICLES_START_FULL_FRAMERATE: 20,
|
|
32632
|
+
TRAIL_FPS: 30,
|
|
32632
32633
|
//skeleton
|
|
32633
32634
|
SHOW_SKELETON_HELPER: false,
|
|
32634
32635
|
SKELETON_HELPER_INSTANCE_NAME: void 0,
|
|
@@ -43930,6 +43931,9 @@ class RenderDesc extends DisposableDesc {
|
|
|
43930
43931
|
throw new Error("Virtual method updateResults called");
|
|
43931
43932
|
}
|
|
43932
43933
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43934
|
+
moveLoose(_diff2) {
|
|
43935
|
+
}
|
|
43936
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
43933
43937
|
static shouldRenderInstance(_instance) {
|
|
43934
43938
|
return true;
|
|
43935
43939
|
}
|
|
@@ -44075,6 +44079,7 @@ class Assembly {
|
|
|
44075
44079
|
rootNode;
|
|
44076
44080
|
allNodes;
|
|
44077
44081
|
allConnectors;
|
|
44082
|
+
linearVelocity = new Vector3(0, 0, 0);
|
|
44078
44083
|
constructor(rootPart) {
|
|
44079
44084
|
const checked = [rootPart];
|
|
44080
44085
|
let depth = 0;
|
|
@@ -44179,27 +44184,38 @@ class AccessoryWrapper extends InstanceWrapper {
|
|
|
44179
44184
|
}
|
|
44180
44185
|
}
|
|
44181
44186
|
}
|
|
44182
|
-
if (!bodyAttachment) {
|
|
44183
|
-
return;
|
|
44184
|
-
}
|
|
44185
|
-
if (!accessoryAttachment) {
|
|
44186
|
-
return;
|
|
44187
|
-
}
|
|
44188
44187
|
const oldAccessoryWeld = handle.FindFirstChild("AccessoryWeld");
|
|
44189
44188
|
if (oldAccessoryWeld) {
|
|
44190
44189
|
oldAccessoryWeld.Destroy();
|
|
44191
44190
|
}
|
|
44192
|
-
|
|
44193
|
-
|
|
44194
|
-
|
|
44195
|
-
|
|
44196
|
-
|
|
44197
|
-
|
|
44198
|
-
|
|
44199
|
-
|
|
44200
|
-
|
|
44201
|
-
|
|
44202
|
-
|
|
44191
|
+
if (bodyAttachment && accessoryAttachment) {
|
|
44192
|
+
const weld = new Instance("Weld");
|
|
44193
|
+
weld.addProperty(new Property("Name", DataType.String), "AccessoryWeld");
|
|
44194
|
+
weld.addProperty(new Property("Archivable", DataType.Bool), true);
|
|
44195
|
+
weld.addProperty(new Property("C1", DataType.CFrame), accessoryAttachment.Property("CFrame").clone());
|
|
44196
|
+
weld.addProperty(new Property("C0", DataType.CFrame), bodyAttachment.Property("CFrame").clone());
|
|
44197
|
+
weld.addProperty(new Property("Part1", DataType.Referent), accessoryAttachment.parent);
|
|
44198
|
+
weld.addProperty(new Property("Part0", DataType.Referent), bodyAttachment.parent);
|
|
44199
|
+
weld.addProperty(new Property("Active", DataType.Bool), true);
|
|
44200
|
+
weld.addProperty(new Property("Enabled", DataType.Bool), false);
|
|
44201
|
+
weld.setParent(handle);
|
|
44202
|
+
weld.setProperty("Enabled", true);
|
|
44203
|
+
} else {
|
|
44204
|
+
const head = this.instance.parent.FindFirstChild("Head");
|
|
44205
|
+
if (!head) return;
|
|
44206
|
+
const attachmentPoint = this.instance.PropOrDefault("AttachmentPoint", new CFrame());
|
|
44207
|
+
const weld = new Instance("Weld");
|
|
44208
|
+
weld.addProperty(new Property("Name", DataType.String), "AccessoryWeld");
|
|
44209
|
+
weld.addProperty(new Property("Archivable", DataType.Bool), true);
|
|
44210
|
+
weld.addProperty(new Property("C1", DataType.CFrame), attachmentPoint.clone());
|
|
44211
|
+
weld.addProperty(new Property("C0", DataType.CFrame), new CFrame());
|
|
44212
|
+
weld.addProperty(new Property("Part1", DataType.Referent), handle);
|
|
44213
|
+
weld.addProperty(new Property("Part0", DataType.Referent), head);
|
|
44214
|
+
weld.addProperty(new Property("Active", DataType.Bool), true);
|
|
44215
|
+
weld.addProperty(new Property("Enabled", DataType.Bool), false);
|
|
44216
|
+
weld.setParent(handle);
|
|
44217
|
+
weld.setProperty("Enabled", true);
|
|
44218
|
+
}
|
|
44203
44219
|
}
|
|
44204
44220
|
}
|
|
44205
44221
|
}
|
|
@@ -48094,7 +48110,7 @@ class BasePartWrapper extends InstanceWrapper {
|
|
|
48094
48110
|
return connected;
|
|
48095
48111
|
}
|
|
48096
48112
|
}
|
|
48097
|
-
const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
48113
|
+
const __vite_glob_0_5$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
48098
48114
|
__proto__: null,
|
|
48099
48115
|
BasePartWrapper
|
|
48100
48116
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -48650,6 +48666,11 @@ class ObjectDesc extends RenderDesc {
|
|
|
48650
48666
|
}
|
|
48651
48667
|
if (this.materialDesc.result) {
|
|
48652
48668
|
this.materialDesc.updateResult();
|
|
48669
|
+
if (this.results) {
|
|
48670
|
+
for (const result of this.results) {
|
|
48671
|
+
result.visible = this.materialDesc.visible;
|
|
48672
|
+
}
|
|
48673
|
+
}
|
|
48653
48674
|
}
|
|
48654
48675
|
}
|
|
48655
48676
|
static shouldRenderInstance(instance) {
|
|
@@ -51917,7 +51938,20 @@ const __vite_glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
51917
51938
|
__proto__: null,
|
|
51918
51939
|
ModelWrapper
|
|
51919
51940
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
51920
|
-
class
|
|
51941
|
+
class MotorWrapper extends JointInstanceWrapper {
|
|
51942
|
+
static className = "Motor";
|
|
51943
|
+
static requiredProperties = [
|
|
51944
|
+
...super.requiredProperties
|
|
51945
|
+
];
|
|
51946
|
+
setup() {
|
|
51947
|
+
super.setup();
|
|
51948
|
+
}
|
|
51949
|
+
}
|
|
51950
|
+
const __vite_glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51951
|
+
__proto__: null,
|
|
51952
|
+
MotorWrapper
|
|
51953
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
51954
|
+
class Motor6DWrapper extends MotorWrapper {
|
|
51921
51955
|
static className = "Motor6D";
|
|
51922
51956
|
static requiredProperties = [
|
|
51923
51957
|
...super.requiredProperties,
|
|
@@ -51928,7 +51962,7 @@ class Motor6DWrapper extends JointInstanceWrapper {
|
|
|
51928
51962
|
if (!this.instance.HasProperty("Transform")) this.instance.addProperty(new Property("Transform", DataType.CFrame), new CFrame());
|
|
51929
51963
|
}
|
|
51930
51964
|
}
|
|
51931
|
-
const
|
|
51965
|
+
const __vite_glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51932
51966
|
__proto__: null,
|
|
51933
51967
|
Motor6DWrapper
|
|
51934
51968
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -51943,7 +51977,7 @@ class PartWrapper extends BasePartWrapper {
|
|
|
51943
51977
|
if (!this.instance.HasProperty("shape")) this.instance.addProperty(new Property("shape", DataType.Enum), PartType.Block);
|
|
51944
51978
|
}
|
|
51945
51979
|
}
|
|
51946
|
-
const
|
|
51980
|
+
const __vite_glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
51947
51981
|
__proto__: null,
|
|
51948
51982
|
PartWrapper
|
|
51949
51983
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -52412,7 +52446,7 @@ class EmitterDesc extends DisposableDesc {
|
|
|
52412
52446
|
const velocityOriginal = new Vector3$1(...velocityFront.toVec3()).multiply(velocityMultiplier);
|
|
52413
52447
|
const velocityLocal = velocityOriginal.applyQuaternion(groupDesc.getNormalQuaternionForVelocity());
|
|
52414
52448
|
const worldVelocity = velocityLocal.applyQuaternion(new Quaternion().setFromRotationMatrix(groupDesc.cframe.getTHREEMatrix()));
|
|
52415
|
-
const worldVelocityRoblox = new Vector3(...worldVelocity.toArray());
|
|
52449
|
+
const worldVelocityRoblox = new Vector3(...worldVelocity.toArray()).add(groupDesc.parentVelocity);
|
|
52416
52450
|
let localPos = groupDesc.getRandomLocalPos();
|
|
52417
52451
|
localPos = localPos.add(this.offset);
|
|
52418
52452
|
const worldPos = groupDesc.toWorldSpace(localPos);
|
|
@@ -52522,6 +52556,7 @@ class EmitterGroupDesc extends RenderDesc {
|
|
|
52522
52556
|
lastCframe = new CFrame();
|
|
52523
52557
|
cframe = new CFrame();
|
|
52524
52558
|
emitterDir = NormalId.Top;
|
|
52559
|
+
parentVelocity = new Vector3();
|
|
52525
52560
|
emitterDescs = [];
|
|
52526
52561
|
//special for emitter group
|
|
52527
52562
|
getRandomLocalPos() {
|
|
@@ -52621,6 +52656,15 @@ class EmitterGroupDesc extends RenderDesc {
|
|
|
52621
52656
|
this.higherBound = size.multiply(new Vector3(0.5, 0.5, 0.5));
|
|
52622
52657
|
this.lowerBound = size.multiply(new Vector3(-0.5, -0.5, -0.5));
|
|
52623
52658
|
}
|
|
52659
|
+
let lastParent = parent;
|
|
52660
|
+
while (lastParent) {
|
|
52661
|
+
if (lastParent.IsA("BasePart")) {
|
|
52662
|
+
const assembly = lastParent.w.GetAssembly();
|
|
52663
|
+
this.parentVelocity = assembly.linearVelocity.clone();
|
|
52664
|
+
break;
|
|
52665
|
+
}
|
|
52666
|
+
lastParent = lastParent.parent;
|
|
52667
|
+
}
|
|
52624
52668
|
}
|
|
52625
52669
|
this.enabled = child.PropOrDefault("Enabled", true);
|
|
52626
52670
|
const className = child.className;
|
|
@@ -52831,6 +52875,14 @@ class EmitterGroupDesc extends RenderDesc {
|
|
|
52831
52875
|
}
|
|
52832
52876
|
this.lastCframe = this.cframe.clone();
|
|
52833
52877
|
}
|
|
52878
|
+
moveLoose(vec) {
|
|
52879
|
+
for (const emitterDesc of this.emitterDescs) {
|
|
52880
|
+
if (emitterDesc.lockedToPart) continue;
|
|
52881
|
+
for (const particle of emitterDesc.particles) {
|
|
52882
|
+
particle.position = particle.position.add(new Vector3().fromVec3(vec));
|
|
52883
|
+
}
|
|
52884
|
+
}
|
|
52885
|
+
}
|
|
52834
52886
|
}
|
|
52835
52887
|
const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
52836
52888
|
__proto__: null,
|
|
@@ -52857,7 +52909,7 @@ class ParticleEmitterWrapper extends InstanceWrapper {
|
|
|
52857
52909
|
}
|
|
52858
52910
|
}
|
|
52859
52911
|
}
|
|
52860
|
-
const
|
|
52912
|
+
const __vite_glob_0_23 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
52861
52913
|
__proto__: null,
|
|
52862
52914
|
ParticleEmitterWrapper
|
|
52863
52915
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -52963,7 +53015,7 @@ class SoundWrapper extends InstanceWrapper {
|
|
|
52963
53015
|
}
|
|
52964
53016
|
}
|
|
52965
53017
|
}
|
|
52966
|
-
const
|
|
53018
|
+
const __vite_glob_0_25 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
52967
53019
|
__proto__: null,
|
|
52968
53020
|
SoundWrapper
|
|
52969
53021
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -52993,6 +53045,9 @@ class ScriptWrapper extends InstanceWrapper {
|
|
|
52993
53045
|
case "HatScript2.0":
|
|
52994
53046
|
this.HatScript20(this.instance);
|
|
52995
53047
|
break;
|
|
53048
|
+
case "TrailTestRoAvatar":
|
|
53049
|
+
this.TrailTestRoAvatar(this.instance);
|
|
53050
|
+
break;
|
|
52996
53051
|
}
|
|
52997
53052
|
}
|
|
52998
53053
|
//Scripts
|
|
@@ -53216,8 +53271,26 @@ class ScriptWrapper extends InstanceWrapper {
|
|
|
53216
53271
|
}
|
|
53217
53272
|
}
|
|
53218
53273
|
}
|
|
53274
|
+
async TrailTestRoAvatar(script) {
|
|
53275
|
+
await Wait(1);
|
|
53276
|
+
const part = script.parent;
|
|
53277
|
+
if (part) {
|
|
53278
|
+
const ogCF = part.Prop("CFrame").clone();
|
|
53279
|
+
while (true) {
|
|
53280
|
+
if (script.destroyed || this.data.shouldStop) return;
|
|
53281
|
+
const newCF = ogCF.clone();
|
|
53282
|
+
const val = Date.now() / 1e3 % 3 / 3 * 2 * Math.PI;
|
|
53283
|
+
const xAdd = Math.sin(val) * 2;
|
|
53284
|
+
const zAdd = Math.cos(val) * 2;
|
|
53285
|
+
newCF.Position[0] += xAdd;
|
|
53286
|
+
newCF.Position[2] += zAdd;
|
|
53287
|
+
part.setProperty("CFrame", newCF);
|
|
53288
|
+
await Wait(1 / 60);
|
|
53289
|
+
}
|
|
53290
|
+
}
|
|
53291
|
+
}
|
|
53219
53292
|
}
|
|
53220
|
-
const
|
|
53293
|
+
const __vite_glob_0_24 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
53221
53294
|
__proto__: null,
|
|
53222
53295
|
ScriptWrapper
|
|
53223
53296
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -53274,25 +53347,38 @@ class ToolWrapper extends InstanceWrapper {
|
|
|
53274
53347
|
}
|
|
53275
53348
|
}
|
|
53276
53349
|
}
|
|
53277
|
-
const
|
|
53350
|
+
const __vite_glob_0_26 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
53278
53351
|
__proto__: null,
|
|
53279
53352
|
ToolWrapper
|
|
53280
53353
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
53354
|
+
class UnionOperationWrapper extends BasePartWrapper {
|
|
53355
|
+
static className = "UnionOperation";
|
|
53356
|
+
static requiredProperties = [
|
|
53357
|
+
...super.requiredProperties
|
|
53358
|
+
];
|
|
53359
|
+
setup() {
|
|
53360
|
+
super.setup();
|
|
53361
|
+
}
|
|
53362
|
+
}
|
|
53363
|
+
const __vite_glob_0_27 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
53364
|
+
__proto__: null,
|
|
53365
|
+
UnionOperationWrapper
|
|
53366
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
53281
53367
|
class WedgePartWrapper extends BasePartWrapper {
|
|
53282
53368
|
static className = "WedgePart";
|
|
53283
53369
|
}
|
|
53284
|
-
const
|
|
53370
|
+
const __vite_glob_0_28 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
53285
53371
|
__proto__: null,
|
|
53286
53372
|
WedgePartWrapper
|
|
53287
53373
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
53288
53374
|
class WeldWrapper extends JointInstanceWrapper {
|
|
53289
53375
|
static className = "Weld";
|
|
53290
53376
|
}
|
|
53291
|
-
const
|
|
53377
|
+
const __vite_glob_0_29 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
53292
53378
|
__proto__: null,
|
|
53293
53379
|
WeldWrapper
|
|
53294
53380
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
53295
|
-
const modules$1 = /* @__PURE__ */ Object.assign({ "./instance/Accessory.ts": __vite_glob_0_0$1, "./instance/AccessoryDescription.ts": __vite_glob_0_1$1, "./instance/AnimationConstraint.ts": __vite_glob_0_2$1, "./instance/Animator.ts": __vite_glob_0_3$1, "./instance/Attachment.ts": __vite_glob_0_4, "./instance/BasePart.ts": __vite_glob_0_5, "./instance/BodyColors.ts": __vite_glob_0_6, "./instance/BodyPartDescription.ts": __vite_glob_0_7, "./instance/Bone.ts": __vite_glob_0_8, "./instance/Camera.ts": __vite_glob_0_9, "./instance/Constraint.ts": __vite_glob_0_10, "./instance/Decal.ts": __vite_glob_0_11, "./instance/FaceControls.ts": __vite_glob_0_12, "./instance/HumanoidDescription.ts": __vite_glob_0_13, "./instance/InstanceWrapper.ts": __vite_glob_0_14, "./instance/JointInstance.ts": __vite_glob_0_15, "./instance/MakeupDescription.ts": __vite_glob_0_16, "./instance/ManualWeld.ts": __vite_glob_0_17, "./instance/MeshPart.ts": __vite_glob_0_18, "./instance/Model.ts": __vite_glob_0_19, "./instance/
|
|
53381
|
+
const modules$1 = /* @__PURE__ */ Object.assign({ "./instance/Accessory.ts": __vite_glob_0_0$1, "./instance/AccessoryDescription.ts": __vite_glob_0_1$1, "./instance/AnimationConstraint.ts": __vite_glob_0_2$1, "./instance/Animator.ts": __vite_glob_0_3$1, "./instance/Attachment.ts": __vite_glob_0_4, "./instance/BasePart.ts": __vite_glob_0_5$1, "./instance/BodyColors.ts": __vite_glob_0_6, "./instance/BodyPartDescription.ts": __vite_glob_0_7, "./instance/Bone.ts": __vite_glob_0_8, "./instance/Camera.ts": __vite_glob_0_9, "./instance/Constraint.ts": __vite_glob_0_10, "./instance/Decal.ts": __vite_glob_0_11, "./instance/FaceControls.ts": __vite_glob_0_12, "./instance/HumanoidDescription.ts": __vite_glob_0_13, "./instance/InstanceWrapper.ts": __vite_glob_0_14, "./instance/JointInstance.ts": __vite_glob_0_15, "./instance/MakeupDescription.ts": __vite_glob_0_16, "./instance/ManualWeld.ts": __vite_glob_0_17, "./instance/MeshPart.ts": __vite_glob_0_18, "./instance/Model.ts": __vite_glob_0_19, "./instance/Motor.ts": __vite_glob_0_20, "./instance/Motor6D.ts": __vite_glob_0_21, "./instance/Part.ts": __vite_glob_0_22, "./instance/ParticleEmitter.ts": __vite_glob_0_23, "./instance/Script.ts": __vite_glob_0_24, "./instance/Sound.ts": __vite_glob_0_25, "./instance/Tool.ts": __vite_glob_0_26, "./instance/UnionOperation.ts": __vite_glob_0_27, "./instance/WedgePart.ts": __vite_glob_0_28, "./instance/Weld.ts": __vite_glob_0_29 });
|
|
53296
53382
|
function RegisterWrappers() {
|
|
53297
53383
|
for (const module of Object.values(modules$1)) {
|
|
53298
53384
|
for (const exprt of Object.values(module)) {
|
|
@@ -53740,7 +53826,269 @@ const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.def
|
|
|
53740
53826
|
__proto__: null,
|
|
53741
53827
|
LightDesc
|
|
53742
53828
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
53743
|
-
|
|
53829
|
+
class TrailSegment {
|
|
53830
|
+
cframe;
|
|
53831
|
+
length;
|
|
53832
|
+
time = 0;
|
|
53833
|
+
constructor(cf, length) {
|
|
53834
|
+
this.cframe = cf;
|
|
53835
|
+
this.length = length;
|
|
53836
|
+
}
|
|
53837
|
+
}
|
|
53838
|
+
class TrailDesc extends RenderDesc {
|
|
53839
|
+
static classTypes = ["Trail"];
|
|
53840
|
+
lastTime = Date.now() / 1e3;
|
|
53841
|
+
time = Date.now() / 1e3;
|
|
53842
|
+
segmentTime = 0;
|
|
53843
|
+
enabled = true;
|
|
53844
|
+
lightEmission = 0;
|
|
53845
|
+
//blends between normal -> additive blending, how?? graphics magic
|
|
53846
|
+
lightInfluence = 1;
|
|
53847
|
+
texture;
|
|
53848
|
+
textureLength = 1;
|
|
53849
|
+
textureMode = TextureMode.Stretch;
|
|
53850
|
+
color = ColorSequence.fromColor(new Color3(1, 1, 1));
|
|
53851
|
+
transparency = new NumberSequence([new NumberSequenceKeypoint(0, 0.5), new NumberSequenceKeypoint(1, 0.5)]);
|
|
53852
|
+
widthScale = new NumberSequence([new NumberSequenceKeypoint(0, 1), new NumberSequenceKeypoint(1, 1)]);
|
|
53853
|
+
cframe0 = new CFrame();
|
|
53854
|
+
cframe1 = new CFrame();
|
|
53855
|
+
lifetime = 1;
|
|
53856
|
+
maxLength = 0;
|
|
53857
|
+
minLength = 0.1;
|
|
53858
|
+
faceCamera = false;
|
|
53859
|
+
//results
|
|
53860
|
+
results = [];
|
|
53861
|
+
segments = [];
|
|
53862
|
+
get maxSegments() {
|
|
53863
|
+
const maxLength = this.maxLength === 0 ? 9999 : this.maxLength;
|
|
53864
|
+
return Math.ceil(Math.min(this.lifetime * FLAGS.TRAIL_FPS, maxLength / this.minLength)) + 2;
|
|
53865
|
+
}
|
|
53866
|
+
isSame(newDesc) {
|
|
53867
|
+
return this.time === newDesc.time && this.enabled === newDesc.enabled && this.lightEmission === newDesc.lightEmission && this.lightInfluence === newDesc.lightInfluence && this.texture === newDesc.texture && this.textureLength === newDesc.textureLength && this.textureMode === newDesc.textureMode && this.color.isSame(newDesc.color) && this.transparency.isSame(newDesc.transparency) && this.widthScale.isSame(newDesc.widthScale) && this.cframe0.isSame(newDesc.cframe0) && this.cframe1.isSame(newDesc.cframe1) && this.faceCamera === newDesc.faceCamera && this.lifetime === newDesc.lifetime && this.maxLength === newDesc.maxLength && this.minLength === newDesc.minLength;
|
|
53868
|
+
}
|
|
53869
|
+
needsRegeneration(newDesc) {
|
|
53870
|
+
return this.enabled !== newDesc.enabled || this.texture !== newDesc.texture || this.lifetime !== newDesc.lifetime;
|
|
53871
|
+
}
|
|
53872
|
+
virtualFromRenderDesc(newDesc) {
|
|
53873
|
+
this.time = newDesc.time;
|
|
53874
|
+
this.lightEmission = newDesc.lightEmission;
|
|
53875
|
+
this.lightInfluence = newDesc.lightInfluence;
|
|
53876
|
+
this.textureLength = newDesc.textureLength;
|
|
53877
|
+
this.textureMode = newDesc.textureMode;
|
|
53878
|
+
this.color = newDesc.color.clone();
|
|
53879
|
+
this.transparency = newDesc.transparency.clone();
|
|
53880
|
+
this.widthScale = newDesc.widthScale.clone();
|
|
53881
|
+
this.cframe0 = newDesc.cframe0.clone();
|
|
53882
|
+
this.cframe1 = newDesc.cframe1.clone();
|
|
53883
|
+
this.lifetime = newDesc.lifetime;
|
|
53884
|
+
this.maxLength = newDesc.maxLength;
|
|
53885
|
+
this.minLength = newDesc.minLength;
|
|
53886
|
+
this.faceCamera = newDesc.faceCamera;
|
|
53887
|
+
}
|
|
53888
|
+
virtualTransferFrom(oldDesc) {
|
|
53889
|
+
this.segmentTime = oldDesc.segmentTime;
|
|
53890
|
+
this.segments = oldDesc.segments;
|
|
53891
|
+
}
|
|
53892
|
+
fromInstance(child) {
|
|
53893
|
+
this.enabled = child.PropOrDefault("Enabled", this.enabled);
|
|
53894
|
+
this.lightEmission = child.PropOrDefault("LightEmission", this.lightEmission);
|
|
53895
|
+
this.lightInfluence = child.PropOrDefault("LightInfluence", this.lightInfluence);
|
|
53896
|
+
this.texture = child.PropOrDefault("Texture", this.texture);
|
|
53897
|
+
if (!this.texture) {
|
|
53898
|
+
const textureContent = child.PropOrDefault("TextureContent", void 0);
|
|
53899
|
+
if (textureContent) {
|
|
53900
|
+
this.texture = textureContent.uri;
|
|
53901
|
+
}
|
|
53902
|
+
}
|
|
53903
|
+
this.textureLength = child.PropOrDefault("TextureLength", this.textureLength);
|
|
53904
|
+
this.textureMode = child.PropOrDefault("TextureMode", this.textureMode);
|
|
53905
|
+
this.color = child.PropOrDefault("Color", this.color);
|
|
53906
|
+
this.transparency = child.PropOrDefault("Transparency", this.transparency);
|
|
53907
|
+
this.widthScale = child.PropOrDefault("WidthScale", this.widthScale);
|
|
53908
|
+
const att0 = child.PropOrDefault("Attachment0", void 0);
|
|
53909
|
+
if (att0 && att0.IsA("Attachment")) {
|
|
53910
|
+
const att0W = att0.w;
|
|
53911
|
+
this.cframe0 = att0W.getWorldCFrame();
|
|
53912
|
+
}
|
|
53913
|
+
const att1 = child.PropOrDefault("Attachment1", void 0);
|
|
53914
|
+
if (att1 && att1.IsA("Attachment")) {
|
|
53915
|
+
const att1W = att1.w;
|
|
53916
|
+
this.cframe1 = att1W.getWorldCFrame();
|
|
53917
|
+
}
|
|
53918
|
+
this.lifetime = child.PropOrDefault("Lifetime", this.lifetime);
|
|
53919
|
+
this.maxLength = child.PropOrDefault("MaxLength", this.maxLength);
|
|
53920
|
+
this.minLength = child.PropOrDefault("MinLength", this.minLength);
|
|
53921
|
+
this.faceCamera = child.PropOrDefault("FaceCamera", this.faceCamera);
|
|
53922
|
+
if (!FLAGS.BEAMS_ENABLED) this.enabled = false;
|
|
53923
|
+
}
|
|
53924
|
+
async compileResults(renderer, scene) {
|
|
53925
|
+
const originalResults = this.results;
|
|
53926
|
+
this.results = [];
|
|
53927
|
+
if (this.enabled) {
|
|
53928
|
+
let textureResult = void 0;
|
|
53929
|
+
if (this.texture) {
|
|
53930
|
+
textureResult = await getTexture(this.texture);
|
|
53931
|
+
if (textureResult) {
|
|
53932
|
+
textureResult.wrapT = RepeatWrapping;
|
|
53933
|
+
}
|
|
53934
|
+
}
|
|
53935
|
+
const material = new MeshBasicMaterial({
|
|
53936
|
+
side: DoubleSide,
|
|
53937
|
+
map: textureResult,
|
|
53938
|
+
vertexColors: true,
|
|
53939
|
+
transparent: true,
|
|
53940
|
+
depthWrite: false
|
|
53941
|
+
});
|
|
53942
|
+
const geometry = new PlaneGeometry(1, 1, this.maxSegments, 1);
|
|
53943
|
+
const colorValues = new Float32Array((this.maxSegments + 1) * 2 * 4).fill(1);
|
|
53944
|
+
geometry.setAttribute("color", new BufferAttribute(colorValues, 4));
|
|
53945
|
+
const mesh = new Mesh(geometry, material);
|
|
53946
|
+
mesh.frustumCulled = false;
|
|
53947
|
+
mesh.name = this.instance ? this.instance.PropOrDefault("Name", "Unknown") + "_Trail" : "Unknown_Trail";
|
|
53948
|
+
this.results.push(mesh);
|
|
53949
|
+
}
|
|
53950
|
+
if (originalResults) {
|
|
53951
|
+
this.disposeMeshes(scene, originalResults);
|
|
53952
|
+
this.disposeRenderLists(renderer);
|
|
53953
|
+
}
|
|
53954
|
+
this.updateResults();
|
|
53955
|
+
return this.results;
|
|
53956
|
+
}
|
|
53957
|
+
calculateSegmentCFrame() {
|
|
53958
|
+
let newCF = lerpCFrame(this.cframe0, this.cframe1, 0.5);
|
|
53959
|
+
newCF = CFrame.lookAt(newCF.Position, this.cframe0.Position);
|
|
53960
|
+
return newCF;
|
|
53961
|
+
}
|
|
53962
|
+
addSegment() {
|
|
53963
|
+
const newCF = this.calculateSegmentCFrame();
|
|
53964
|
+
const newLength = distance(this.cframe0.Position, this.cframe1.Position);
|
|
53965
|
+
const lastSegment = this.segments[0];
|
|
53966
|
+
if (lastSegment) {
|
|
53967
|
+
const lastSegmentDistance = distance(lastSegment.cframe.Position, newCF.Position);
|
|
53968
|
+
if (lastSegmentDistance <= this.minLength) {
|
|
53969
|
+
return;
|
|
53970
|
+
}
|
|
53971
|
+
}
|
|
53972
|
+
const newSegment = new TrailSegment(newCF, newLength);
|
|
53973
|
+
newSegment.time = this.segmentTime;
|
|
53974
|
+
this.segments.unshift(newSegment);
|
|
53975
|
+
}
|
|
53976
|
+
getSegmentCFrame(i) {
|
|
53977
|
+
if (i <= 0) {
|
|
53978
|
+
return this.calculateSegmentCFrame();
|
|
53979
|
+
} else {
|
|
53980
|
+
const segment = this.segments[specialClamp(i - 1, 0, this.segments.length - 1)];
|
|
53981
|
+
if (segment) {
|
|
53982
|
+
return segment.cframe;
|
|
53983
|
+
} else {
|
|
53984
|
+
return this.calculateSegmentCFrame();
|
|
53985
|
+
}
|
|
53986
|
+
}
|
|
53987
|
+
}
|
|
53988
|
+
getSegmentLength(i) {
|
|
53989
|
+
if (i <= 0) {
|
|
53990
|
+
return distance(this.cframe0.Position, this.cframe1.Position);
|
|
53991
|
+
} else {
|
|
53992
|
+
const segment = this.segments[specialClamp(i - 1, 0, this.segments.length - 1)];
|
|
53993
|
+
if (segment) {
|
|
53994
|
+
return segment.length;
|
|
53995
|
+
} else {
|
|
53996
|
+
return 0;
|
|
53997
|
+
}
|
|
53998
|
+
}
|
|
53999
|
+
}
|
|
54000
|
+
getSegmentTime(i) {
|
|
54001
|
+
if (i <= 0) {
|
|
54002
|
+
return this.segmentTime;
|
|
54003
|
+
} else {
|
|
54004
|
+
const segment = this.segments[specialClamp(i - 1, 0, this.segments.length - 1)];
|
|
54005
|
+
if (segment) {
|
|
54006
|
+
return segment.time;
|
|
54007
|
+
} else {
|
|
54008
|
+
return this.segmentTime;
|
|
54009
|
+
}
|
|
54010
|
+
}
|
|
54011
|
+
}
|
|
54012
|
+
updateResults() {
|
|
54013
|
+
if (!this.results) return;
|
|
54014
|
+
const deltaTime = this.time - this.lastTime;
|
|
54015
|
+
this.segmentTime += deltaTime;
|
|
54016
|
+
const requiredSegmentTime = 1 / FLAGS.TRAIL_FPS;
|
|
54017
|
+
for (const segment of this.segments) {
|
|
54018
|
+
segment.time += deltaTime;
|
|
54019
|
+
}
|
|
54020
|
+
let lastSegmentCF = void 0;
|
|
54021
|
+
for (let i = 0; i < this.segments.length; i++) {
|
|
54022
|
+
let totalLength = 0;
|
|
54023
|
+
const segment = this.segments[i];
|
|
54024
|
+
if (segment.time >= this.lifetime || totalLength > this.maxLength) {
|
|
54025
|
+
this.segments.splice(i, this.segments.length - i);
|
|
54026
|
+
break;
|
|
54027
|
+
}
|
|
54028
|
+
if (lastSegmentCF) {
|
|
54029
|
+
const diff = distance(lastSegmentCF.Position, segment.cframe.Position);
|
|
54030
|
+
totalLength += diff;
|
|
54031
|
+
}
|
|
54032
|
+
lastSegmentCF = segment.cframe;
|
|
54033
|
+
}
|
|
54034
|
+
if (this.segmentTime >= requiredSegmentTime) {
|
|
54035
|
+
this.addSegment();
|
|
54036
|
+
this.segmentTime = 0;
|
|
54037
|
+
}
|
|
54038
|
+
for (const result of this.results) {
|
|
54039
|
+
const resultMaterial = result.material;
|
|
54040
|
+
const resultGeometry = result.geometry;
|
|
54041
|
+
resultMaterial.blending = this.lightEmission > 0.5 ? AdditiveBlending : NormalBlending;
|
|
54042
|
+
const positions = resultGeometry.getAttribute("position");
|
|
54043
|
+
for (let i = 0; i < positions.count; i++) {
|
|
54044
|
+
const index = Math.floor(i % (positions.count / 2));
|
|
54045
|
+
const segmentLength = this.getSegmentLength(index);
|
|
54046
|
+
const segmentCF = this.getSegmentCFrame(index);
|
|
54047
|
+
const normSide = i < positions.count / 2 ? 0.5 : -0.5;
|
|
54048
|
+
const t = this.getSegmentTime(index) / this.lifetime;
|
|
54049
|
+
const side = normSide * segmentLength * this.widthScale.getValue(t, 0);
|
|
54050
|
+
const sideCF = segmentCF.multiply(new CFrame(0, 0, side));
|
|
54051
|
+
positions.setXYZ(i, ...sideCF.Position);
|
|
54052
|
+
}
|
|
54053
|
+
const colors = resultGeometry.getAttribute("color");
|
|
54054
|
+
for (let i = 0; i < colors.count; i++) {
|
|
54055
|
+
const index = Math.floor(i % (positions.count / 2));
|
|
54056
|
+
const t = this.getSegmentTime(index) / this.lifetime;
|
|
54057
|
+
const colorValue = this.color.getValue(t);
|
|
54058
|
+
const transparencyValue = this.transparency.getValue(t, 0);
|
|
54059
|
+
const mult = 1 + this.lightEmission;
|
|
54060
|
+
colors.setXYZW(i, colorValue.R * mult, colorValue.G * mult, colorValue.B * mult, 1 - transparencyValue);
|
|
54061
|
+
}
|
|
54062
|
+
const uvs = resultGeometry.getAttribute("uv");
|
|
54063
|
+
for (let i = 0; i < uvs.count; i++) {
|
|
54064
|
+
const index = Math.floor(i % (positions.count / 2));
|
|
54065
|
+
const t = index / this.segments.length;
|
|
54066
|
+
const normSide = i < positions.count / 2 ? 1 : 0;
|
|
54067
|
+
uvs.setXY(i, normSide, (1 - t) * this.textureLength);
|
|
54068
|
+
}
|
|
54069
|
+
positions.needsUpdate = true;
|
|
54070
|
+
colors.needsUpdate = true;
|
|
54071
|
+
uvs.needsUpdate = true;
|
|
54072
|
+
}
|
|
54073
|
+
this.lastTime = this.time;
|
|
54074
|
+
}
|
|
54075
|
+
moveLoose(vec) {
|
|
54076
|
+
for (const segment of this.segments) {
|
|
54077
|
+
segment.cframe.Position = add(segment.cframe.Position, vec);
|
|
54078
|
+
}
|
|
54079
|
+
}
|
|
54080
|
+
dispose(_renderer, scene) {
|
|
54081
|
+
if (!this.results) return;
|
|
54082
|
+
for (const result of this.results) {
|
|
54083
|
+
scene.remove(result);
|
|
54084
|
+
}
|
|
54085
|
+
}
|
|
54086
|
+
}
|
|
54087
|
+
const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
54088
|
+
__proto__: null,
|
|
54089
|
+
TrailDesc
|
|
54090
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
54091
|
+
const modules = /* @__PURE__ */ Object.assign({ "./attachmentDesc.ts": __vite_glob_0_0, "./beamDesc.ts": __vite_glob_0_1, "./emitterGroupDesc.ts": __vite_glob_0_2, "./lightDesc.ts": __vite_glob_0_3, "./objectDesc.ts": __vite_glob_0_4$1, "./trailDesc.ts": __vite_glob_0_5 });
|
|
53744
54092
|
function RegisterRenderDescs() {
|
|
53745
54093
|
for (const module of Object.values(modules)) {
|
|
53746
54094
|
for (const exprt of Object.values(module)) {
|
|
@@ -62894,6 +63242,63 @@ function getAvatarCameraCFrame(character, applyEmote, isFallbackEmoteApplied, fi
|
|
|
62894
63242
|
setupCamera(camera, cameraOptions);
|
|
62895
63243
|
return camera;
|
|
62896
63244
|
}
|
|
63245
|
+
function getCloseupCameraCFrame(character, newLighting = true) {
|
|
63246
|
+
const cameraOffsetX = 0;
|
|
63247
|
+
const cameraOffsetY = 0;
|
|
63248
|
+
const baseHatZoom = 30;
|
|
63249
|
+
const maxHatZoom = 100;
|
|
63250
|
+
const headAttachments = [];
|
|
63251
|
+
const head = character.FindFirstChild("Head");
|
|
63252
|
+
let headPos = new Vector3();
|
|
63253
|
+
let headCF = new CFrame();
|
|
63254
|
+
if (head) {
|
|
63255
|
+
headPos = head.Prop("Position");
|
|
63256
|
+
headCF = head.Prop("CFrame");
|
|
63257
|
+
for (const child of head.GetChildren()) {
|
|
63258
|
+
if (child.IsA("Attachment")) {
|
|
63259
|
+
headAttachments.push(child.Prop("Name"));
|
|
63260
|
+
}
|
|
63261
|
+
}
|
|
63262
|
+
}
|
|
63263
|
+
let maxDimension = 0;
|
|
63264
|
+
for (const child of character.GetChildren()) {
|
|
63265
|
+
if (child.IsA("Accessory")) {
|
|
63266
|
+
const handle = child.FindFirstChild("Handle");
|
|
63267
|
+
if (handle) {
|
|
63268
|
+
const handlePos = handle.Prop("Position");
|
|
63269
|
+
let hasHeadAttachment = false;
|
|
63270
|
+
for (const att of handle.GetChildren()) {
|
|
63271
|
+
if (att.IsA("Attachment") && headAttachments.includes(att.Prop("Name"))) {
|
|
63272
|
+
hasHeadAttachment = true;
|
|
63273
|
+
break;
|
|
63274
|
+
}
|
|
63275
|
+
}
|
|
63276
|
+
if (hasHeadAttachment) {
|
|
63277
|
+
const size = handle.Prop("Size").divide(new Vector3(2, 2, 2)).add(handlePos).minus(headPos);
|
|
63278
|
+
size.Z = 0;
|
|
63279
|
+
if (size.magnitude() > maxDimension) {
|
|
63280
|
+
maxDimension = size.magnitude();
|
|
63281
|
+
}
|
|
63282
|
+
}
|
|
63283
|
+
}
|
|
63284
|
+
}
|
|
63285
|
+
}
|
|
63286
|
+
const maxHatOffset = 0.5;
|
|
63287
|
+
maxDimension = Math.min(1, maxDimension / 3);
|
|
63288
|
+
maxDimension *= maxDimension;
|
|
63289
|
+
const viewOffset = headCF.multiply(new CFrame(cameraOffsetX, cameraOffsetY + maxHatOffset * maxDimension, 0.1));
|
|
63290
|
+
let yAngle = -Math.PI / 16;
|
|
63291
|
+
if (newLighting) {
|
|
63292
|
+
yAngle = 0;
|
|
63293
|
+
}
|
|
63294
|
+
const positionOffset = headCF.clone();
|
|
63295
|
+
const toAdd = multiply(normalize(CFrame.Angles(0, yAngle, 0).lookVector()), [3, 3, 3]);
|
|
63296
|
+
positionOffset.Position = add(positionOffset.Position, toAdd);
|
|
63297
|
+
const camera = createThumbnailCamera();
|
|
63298
|
+
camera.setProperty("CFrame", CFrame.lookAt(positionOffset.Position, viewOffset.Position));
|
|
63299
|
+
camera.setProperty("FieldOfView", baseHatZoom + (maxHatZoom - baseHatZoom) * maxDimension);
|
|
63300
|
+
return camera;
|
|
63301
|
+
}
|
|
62897
63302
|
function getCorners(cframe, size) {
|
|
62898
63303
|
const halfX = size.X / 2;
|
|
62899
63304
|
const halfY = size.Y / 2;
|
|
@@ -62959,7 +63364,7 @@ function getExtents(cframe, parts) {
|
|
|
62959
63364
|
function getExtentsWorld(rig) {
|
|
62960
63365
|
const rigParts = [];
|
|
62961
63366
|
for (const child of rig.GetDescendants()) {
|
|
62962
|
-
if (child.createWrapper()?.IsA("BasePart")) {
|
|
63367
|
+
if (child.createWrapper()?.IsA("BasePart") && !(child.Prop("Name") === "HumanoidRootPart")) {
|
|
62963
63368
|
rigParts.push(child);
|
|
62964
63369
|
}
|
|
62965
63370
|
}
|
|
@@ -63021,6 +63426,13 @@ function getCameraCFrameForHeadshotCustomized(rig, fov2, yRot, distance2) {
|
|
|
63021
63426
|
return cameraCF;
|
|
63022
63427
|
}
|
|
63023
63428
|
}
|
|
63429
|
+
function getCameraCFrameForHeadshotNonCustomized(rig, newLighting = true) {
|
|
63430
|
+
const camera = getCloseupCameraCFrame(rig, newLighting);
|
|
63431
|
+
const cameraCF = camera.Prop("CFrame");
|
|
63432
|
+
const cameraFOV = camera.Prop("FieldOfView");
|
|
63433
|
+
camera.Destroy();
|
|
63434
|
+
return { cframe: cameraCF, fov: cameraFOV };
|
|
63435
|
+
}
|
|
63024
63436
|
function getCameraCFrameForAvatarCustomized(rig, fov2, yRot) {
|
|
63025
63437
|
const camera = getAvatarCameraCFrame(rig, void 0, void 0, fov2, {
|
|
63026
63438
|
optCameraYRot: yRot,
|
|
@@ -63334,6 +63746,10 @@ class OutfitRenderer {
|
|
|
63334
63746
|
/**Does camera update every frame */
|
|
63335
63747
|
doAddInstance = true;
|
|
63336
63748
|
/**If outfitRenderer should call RBXRenderer.addInstance(), setting this to false will make OutfitRenderer return success early */
|
|
63749
|
+
doMoveLoose = true;
|
|
63750
|
+
/**If outfitRenderer should call this.moveLoose() when certain animations are playing */
|
|
63751
|
+
affectsLinearVelocity = true;
|
|
63752
|
+
/**If outfitRenderer should set the AssemblyLinearVelocity every animateOnce */
|
|
63337
63753
|
forceAnimationLoop = true;
|
|
63338
63754
|
/**If future loaded animations should be set to loop */
|
|
63339
63755
|
backgroundRenderer;
|
|
@@ -63547,10 +63963,39 @@ class OutfitRenderer {
|
|
|
63547
63963
|
this.animateOnce();
|
|
63548
63964
|
}, 1e3 / this.animationFPS);
|
|
63549
63965
|
}
|
|
63966
|
+
/**Animates moveLoose */
|
|
63967
|
+
animateMoveLoose(deltaTime) {
|
|
63968
|
+
if (!this.currentRig) return;
|
|
63969
|
+
const hrp = this.currentRig.FindFirstChild("HumanoidRootPart");
|
|
63970
|
+
if (hrp && hrp.IsA("BasePart")) {
|
|
63971
|
+
if (this.doMoveLoose) {
|
|
63972
|
+
const mainAnim = this.animatorW?.data.currentAnimation;
|
|
63973
|
+
let facing = hrp.Prop("CFrame").lookVector();
|
|
63974
|
+
facing[1] = 1e-3;
|
|
63975
|
+
facing = normalize(facing);
|
|
63976
|
+
let speed = 0;
|
|
63977
|
+
if (mainAnim === "run") speed = 16;
|
|
63978
|
+
else if (mainAnim === "walk") speed = 10;
|
|
63979
|
+
const diff = multiply(facing, [speed, speed, speed]);
|
|
63980
|
+
const deltaDiff = multiply(diff, [deltaTime, deltaTime, deltaTime]);
|
|
63981
|
+
const negDeltaDiff = minus([0, 0, 0], deltaDiff);
|
|
63982
|
+
this.moveLoose(negDeltaDiff);
|
|
63983
|
+
if (this.affectsLinearVelocity) {
|
|
63984
|
+
const hrpW = hrp.w;
|
|
63985
|
+
hrpW.GetAssembly().linearVelocity = new Vector3().fromVec3(diff);
|
|
63986
|
+
}
|
|
63987
|
+
} else {
|
|
63988
|
+
if (this.affectsLinearVelocity) {
|
|
63989
|
+
const hrpW = hrp.w;
|
|
63990
|
+
hrpW.GetAssembly().linearVelocity = new Vector3();
|
|
63991
|
+
}
|
|
63992
|
+
}
|
|
63993
|
+
}
|
|
63994
|
+
}
|
|
63550
63995
|
/**
|
|
63551
63996
|
* Updates the animation once
|
|
63552
63997
|
*/
|
|
63553
|
-
animateOnce(deltaTimeOverride) {
|
|
63998
|
+
animateOnce(deltaTimeOverride, forceTime, forceKeyframe) {
|
|
63554
63999
|
if (this.currentRig && this.auth) {
|
|
63555
64000
|
const humanoid = this.currentRig.FindFirstChildOfClass("Humanoid");
|
|
63556
64001
|
if (humanoid) {
|
|
@@ -63559,8 +64004,9 @@ class OutfitRenderer {
|
|
|
63559
64004
|
const deltaTime = deltaTimeOverride !== void 0 ? deltaTimeOverride : (Date.now() / 1e3 - this.lastFrameTime) * this.deltaTimeMultiplier;
|
|
63560
64005
|
this.lastFrameTime = Date.now() / 1e3;
|
|
63561
64006
|
const animatorW = new AnimatorWrapper(animator);
|
|
63562
|
-
animatorW.renderAnimation(deltaTime);
|
|
64007
|
+
animatorW.renderAnimation(deltaTime, forceTime, forceKeyframe);
|
|
63563
64008
|
this.currentRig.preRender();
|
|
64009
|
+
this.animateMoveLoose(deltaTime);
|
|
63564
64010
|
if (this.doAddInstance) RBXRenderer.addInstance(this.currentRig, this.auth, this.renderScene);
|
|
63565
64011
|
}
|
|
63566
64012
|
}
|
|
@@ -63610,7 +64056,8 @@ class OutfitRenderer {
|
|
|
63610
64056
|
const animator = humanoid.FindFirstChildOfClass("Animator");
|
|
63611
64057
|
if (animator) {
|
|
63612
64058
|
const animatorW = new AnimatorWrapper(animator);
|
|
63613
|
-
|
|
64059
|
+
let successfullyPlayed = animatorW.playAnimation(name);
|
|
64060
|
+
if (!successfullyPlayed && name === "pose") successfullyPlayed = animatorW.playAnimation("idle:0");
|
|
63614
64061
|
if (!successfullyPlayed && name.startsWith("emote.") && name) {
|
|
63615
64062
|
const emoteId = BigInt(name.split(".")[1]);
|
|
63616
64063
|
animatorW.loadAvatarAnimation(emoteId, true, this.forceAnimationLoop).then(() => {
|
|
@@ -63725,6 +64172,19 @@ class OutfitRenderer {
|
|
|
63725
64172
|
}
|
|
63726
64173
|
}
|
|
63727
64174
|
}
|
|
64175
|
+
/**
|
|
64176
|
+
* Moves "loose" things such as particles and trails by the Vec3 given, used to simulate character movement without actually moving the character
|
|
64177
|
+
*/
|
|
64178
|
+
moveLoose(vec) {
|
|
64179
|
+
if (vec[0] === 0 && vec[1] === 0 && vec[2] === 0) return;
|
|
64180
|
+
if (!this.currentRig) return;
|
|
64181
|
+
for (const instance of this.currentRig.GetDescendants()) {
|
|
64182
|
+
const renderDesc = this.renderScene.renderDescs.get(instance);
|
|
64183
|
+
if (renderDesc) {
|
|
64184
|
+
renderDesc.moveLoose(vec);
|
|
64185
|
+
}
|
|
64186
|
+
}
|
|
64187
|
+
}
|
|
63728
64188
|
/**Calls destroy on the rig, stops animating and disconnects connections. The OutfitRenderer should not be interacted with after this */
|
|
63729
64189
|
destroy() {
|
|
63730
64190
|
this.stopAnimating();
|
|
@@ -64211,7 +64671,9 @@ export {
|
|
|
64211
64671
|
getCameraCFrameForAvatarCustomized,
|
|
64212
64672
|
getCameraCFrameForAvatarNonCustomized,
|
|
64213
64673
|
getCameraCFrameForHeadshotCustomized,
|
|
64674
|
+
getCameraCFrameForHeadshotNonCustomized,
|
|
64214
64675
|
getCharacterTorsoCFrame,
|
|
64676
|
+
getCloseupCameraCFrame,
|
|
64215
64677
|
getDistIndexArray,
|
|
64216
64678
|
getExtents,
|
|
64217
64679
|
getExtentsCenter,
|