roavatar-renderer 1.5.19 → 1.6.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 +91 -12
- package/dist/index.js +13958 -8779
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EffectComposer } from '
|
|
1
|
+
import { EffectComposer } from 'postprocessing';
|
|
2
2
|
import { OrbitControls } from 'three/examples/jsm/Addons.js';
|
|
3
3
|
import * as THREE from 'three';
|
|
4
4
|
|
|
@@ -683,6 +683,71 @@ export declare function awaitTimeout<T>(promise: Promise<T>, time?: number): Pro
|
|
|
683
683
|
*/
|
|
684
684
|
export declare function awaitTimeoutThrows<T>(promise: Promise<T>, time?: number): Promise<T>;
|
|
685
685
|
|
|
686
|
+
declare class BackgroundRenderer {
|
|
687
|
+
auth: Authentication;
|
|
688
|
+
avatarCyclorama?: Instance;
|
|
689
|
+
backgroundData?: Instance;
|
|
690
|
+
backgroundId?: number;
|
|
691
|
+
lastLoadedBackgroundId?: number;
|
|
692
|
+
currentlyUpdating: boolean;
|
|
693
|
+
hasNewUpdate: boolean;
|
|
694
|
+
affectSceneAppearance: boolean;
|
|
695
|
+
cameraAffectsTransparency: boolean;
|
|
696
|
+
lastFrameTime: number;
|
|
697
|
+
animationInterval?: NodeJS.Timeout;
|
|
698
|
+
animationFPS: number;
|
|
699
|
+
renderScene: RBXRendererScene;
|
|
700
|
+
private _renderSceneCompiledConnection?;
|
|
701
|
+
private _renderSceneFailedConnection?;
|
|
702
|
+
hasFiredFullyRendered: boolean;
|
|
703
|
+
/**Event is fired if a new outfit failed to load (specifically the Instance tree, not the rendering part)
|
|
704
|
+
*
|
|
705
|
+
* Simple: Fired when, Instance tree = fail
|
|
706
|
+
* @returns BackgroundRendererErrorType
|
|
707
|
+
*/
|
|
708
|
+
onError: Event_2;
|
|
709
|
+
/**Event is fired if a new outfit successfully loaded (specifically the Instance tree, not the rendering part)
|
|
710
|
+
*
|
|
711
|
+
* Simple: Fired when, Instance tree = done
|
|
712
|
+
* @returns void
|
|
713
|
+
*/
|
|
714
|
+
onSuccess: Event_2;
|
|
715
|
+
/**Event is fired when all the renderDescs have been compiled, if any renderDescs fail to render this wil never be fired (can only be fired after Instance tree is done)
|
|
716
|
+
*
|
|
717
|
+
* Simple: Fired when, Instance tree = done & Rendering = done (AKA everything)
|
|
718
|
+
* @returns void
|
|
719
|
+
*/
|
|
720
|
+
onRenderSuccess: Event_2;
|
|
721
|
+
/**Event is fired if a renderDesc fails to compile, it can be fired multiple times
|
|
722
|
+
*
|
|
723
|
+
* Simple: Fired when, Rendering = fail
|
|
724
|
+
* @returns void
|
|
725
|
+
*/
|
|
726
|
+
onRenderError: Event_2;
|
|
727
|
+
constructor(auth: Authentication, backgroundId?: number, renderScene?: RBXRendererScene);
|
|
728
|
+
/**Updates background to match the set id */
|
|
729
|
+
setBackground(id?: number): void;
|
|
730
|
+
_updateBackground(): Promise<void>;
|
|
731
|
+
_loadBackgroundData(): Promise<void>;
|
|
732
|
+
_loadAvatarCyclorama(): Promise<void>;
|
|
733
|
+
_applyBackgroundData(): void;
|
|
734
|
+
/**
|
|
735
|
+
* Starts updating the animation of the background per frame
|
|
736
|
+
*/
|
|
737
|
+
startAnimating(): void;
|
|
738
|
+
/**
|
|
739
|
+
* Updates the animation once
|
|
740
|
+
*/
|
|
741
|
+
animateOnce(): void;
|
|
742
|
+
/**
|
|
743
|
+
* Stops updating the animation of the background per frame
|
|
744
|
+
*/
|
|
745
|
+
stopAnimating(): void;
|
|
746
|
+
fireFullyRenderedIfNeeded(): void;
|
|
747
|
+
/**Calls destroy on the background, stops animating and disconnects connections. The OutfitRenderer should not be interacted with after this */
|
|
748
|
+
destroy(): void;
|
|
749
|
+
}
|
|
750
|
+
|
|
686
751
|
/**
|
|
687
752
|
* @category Mesh
|
|
688
753
|
*/
|
|
@@ -1010,6 +1075,7 @@ export declare class Color3 {
|
|
|
1010
1075
|
clone(): Color3;
|
|
1011
1076
|
isSame(other: Color3): boolean;
|
|
1012
1077
|
toColor3uint8(): Color3uint8;
|
|
1078
|
+
toArray(): Vec3;
|
|
1013
1079
|
multiply(vec3: Color3): Color3;
|
|
1014
1080
|
divide(vec3: Color3): Color3;
|
|
1015
1081
|
add(vec3: Color3): Color3;
|
|
@@ -1026,6 +1092,7 @@ export declare class Color3uint8 {
|
|
|
1026
1092
|
constructor(R?: number, G?: number, B?: number);
|
|
1027
1093
|
clone(): Color3uint8;
|
|
1028
1094
|
toColor3(): Color3;
|
|
1095
|
+
toArray(): Vec3;
|
|
1029
1096
|
}
|
|
1030
1097
|
|
|
1031
1098
|
/**
|
|
@@ -2041,6 +2108,7 @@ export declare class Instance {
|
|
|
2041
2108
|
FindFirstChildOfClass(className: string): Instance | undefined;
|
|
2042
2109
|
FindLastChildOfClass(className: string): Instance | undefined;
|
|
2043
2110
|
IsA(className: string): boolean;
|
|
2111
|
+
IsDescendantOf(instance: Instance): boolean;
|
|
2044
2112
|
preRender(): void;
|
|
2045
2113
|
}
|
|
2046
2114
|
|
|
@@ -2894,6 +2962,7 @@ export declare const OutfitOrigin: {
|
|
|
2894
2962
|
*/
|
|
2895
2963
|
export declare class OutfitRenderer {
|
|
2896
2964
|
auth: Authentication;
|
|
2965
|
+
outfitModel?: OutfitModel;
|
|
2897
2966
|
outfit: Outfit;
|
|
2898
2967
|
currentRig?: Instance; /**Instance for the Model of the current outfit */
|
|
2899
2968
|
currentRigType: AvatarType;
|
|
@@ -2901,6 +2970,7 @@ export declare class OutfitRenderer {
|
|
|
2901
2970
|
doCameraUpdate: boolean; /**Does camera update every frame */
|
|
2902
2971
|
doAddInstance: boolean; /**If outfitRenderer should call RBXRenderer.addInstance() */
|
|
2903
2972
|
forceAnimationLoop: boolean; /**If future loaded animations should be set to loop */
|
|
2973
|
+
backgroundRenderer: BackgroundRenderer;
|
|
2904
2974
|
currentlyChangingRig: boolean;
|
|
2905
2975
|
currentlyUpdating: boolean;
|
|
2906
2976
|
hasNewUpdate: boolean;
|
|
@@ -2912,6 +2982,7 @@ export declare class OutfitRenderer {
|
|
|
2912
2982
|
renderScene: RBXRendererScene;
|
|
2913
2983
|
private _renderSceneCompiledConnection?;
|
|
2914
2984
|
private _renderSceneFailedConnection?;
|
|
2985
|
+
hasFiredFullyRendered: boolean;
|
|
2915
2986
|
/**Event is fired if a new outfit failed to load (specifically the Instance tree, not the rendering part)
|
|
2916
2987
|
*
|
|
2917
2988
|
* Simple: Fired when, Instance tree = fail
|
|
@@ -2944,7 +3015,7 @@ export declare class OutfitRenderer {
|
|
|
2944
3015
|
* @param outfit The outfit you want to render, it can be updated later by calling setOutfit()
|
|
2945
3016
|
* @param renderScene The scene the outfit should be rendered in
|
|
2946
3017
|
*/
|
|
2947
|
-
constructor(auth: Authentication, outfit: Outfit, renderScene?: RBXRendererScene);
|
|
3018
|
+
constructor(auth: Authentication, outfit: Outfit | OutfitModel, renderScene?: RBXRendererScene);
|
|
2948
3019
|
/**
|
|
2949
3020
|
* Updates the current rig, called internally by _updateOutfit()
|
|
2950
3021
|
*/
|
|
@@ -2957,6 +3028,10 @@ export declare class OutfitRenderer {
|
|
|
2957
3028
|
* Updates the current outfit being rendered
|
|
2958
3029
|
*/
|
|
2959
3030
|
setOutfit(outfit: Outfit): void;
|
|
3031
|
+
/**
|
|
3032
|
+
* Updates the current outfitModel being rendered
|
|
3033
|
+
*/
|
|
3034
|
+
setOutfitModel(outfitModel: OutfitModel): void;
|
|
2960
3035
|
/**
|
|
2961
3036
|
* Centers camera on avatar
|
|
2962
3037
|
*/
|
|
@@ -3261,23 +3336,27 @@ export declare class RBXRenderer {
|
|
|
3261
3336
|
static scenes: RBXRendererScene[];
|
|
3262
3337
|
static get firstScene(): RBXRendererScene;
|
|
3263
3338
|
/**@deprecated This can only get the first renderScene's scene */
|
|
3264
|
-
static get scene(): THREE.Scene
|
|
3339
|
+
static get scene(): THREE.Scene<THREE.Object3DEventMap>;
|
|
3265
3340
|
/**@deprecated This can only get the first renderScene's camera */
|
|
3266
3341
|
static get camera(): THREE.PerspectiveCamera;
|
|
3267
3342
|
/**@deprecated This can only get the first renderScene's controls */
|
|
3268
|
-
static get controls(): OrbitControls | undefined;
|
|
3343
|
+
static get controls(): OrbitControls<THREE.Camera> | undefined;
|
|
3269
3344
|
static renderer?: THREE.WebGLRenderer;
|
|
3270
3345
|
static resolution: [number, number];
|
|
3271
|
-
static
|
|
3346
|
+
static backgroundColor: THREE.ColorRepresentation;
|
|
3347
|
+
/**@deprecated Use backgroundColor instead */
|
|
3348
|
+
static get backgroundColorHex(): number;
|
|
3349
|
+
/**@deprecated Use backgroundColor instead */
|
|
3350
|
+
static set backgroundColorHex(val: number);
|
|
3272
3351
|
static backgroundTransparent: boolean;
|
|
3273
3352
|
static createLoadingIcon: boolean;
|
|
3274
3353
|
static canvasContainer: HTMLDivElement;
|
|
3275
3354
|
static loadingIcon?: HTMLSpanElement;
|
|
3276
3355
|
static loadingIconStyle?: HTMLStyleElement;
|
|
3277
3356
|
/**@deprecated This can only get the first renderScene's plane */
|
|
3278
|
-
static get plane(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> | undefined;
|
|
3357
|
+
static get plane(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap> | undefined;
|
|
3279
3358
|
/**@deprecated This can only get the first renderScene's shadowPlane */
|
|
3280
|
-
static get shadowPlane(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> | undefined;
|
|
3359
|
+
static get shadowPlane(): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.Material<THREE.MaterialEventMap> | THREE.Material<THREE.MaterialEventMap>[], THREE.Object3DEventMap> | undefined;
|
|
3281
3360
|
/**@deprecated This can only get the first renderScene's ambientLight */
|
|
3282
3361
|
static get ambientLight(): THREE.AmbientLight | undefined;
|
|
3283
3362
|
/**@deprecated This can only get the first renderScene's directionalLight */
|
|
@@ -3305,15 +3384,15 @@ export declare class RBXRenderer {
|
|
|
3305
3384
|
static setupLostContextHandler(): void;
|
|
3306
3385
|
/**Sets up a basic scene with lighting
|
|
3307
3386
|
* @param lightingType "WellLit" is the default lighting for RoAvatar, "Thumbnail" tries to match the Roblox thumbnail lighting
|
|
3308
|
-
* @param
|
|
3387
|
+
* @param backgroundColor is the color code for the background color, for example 0x2b2d33
|
|
3309
3388
|
*/
|
|
3310
|
-
static setupScene(lightingType?: "WellLit" | "Thumbnail",
|
|
3389
|
+
static setupScene(lightingType?: "WellLit" | "Thumbnail", backgroundColorVal?: THREE.ColorRepresentation, renderScene?: RBXRendererScene): void;
|
|
3311
3390
|
/**Sets up orbit controls */
|
|
3312
3391
|
static setupControls(renderScene?: RBXRendererScene): void;
|
|
3313
3392
|
/**
|
|
3314
|
-
* @param
|
|
3393
|
+
* @param color example: 0x2b2d33 which is the default
|
|
3315
3394
|
*/
|
|
3316
|
-
static setBackgroundColor(
|
|
3395
|
+
static setBackgroundColor(color: THREE.ColorRepresentation): void;
|
|
3317
3396
|
/**
|
|
3318
3397
|
* Sets the background and ground's visibility, but not the shadowPlane
|
|
3319
3398
|
* @param transparent If the background and ground should be transparent
|
|
@@ -3352,7 +3431,7 @@ export declare class RBXRenderer {
|
|
|
3352
3431
|
*/
|
|
3353
3432
|
static getRenderer(): THREE.WebGLRenderer | undefined;
|
|
3354
3433
|
/**@deprecated This can only get the first renderScene's scene */
|
|
3355
|
-
static getScene(): THREE.Scene
|
|
3434
|
+
static getScene(): THREE.Scene<THREE.Object3DEventMap>;
|
|
3356
3435
|
/**
|
|
3357
3436
|
* @deprecated Superseded by RBXRendererScene.exportGLTF()
|
|
3358
3437
|
* This function is unstable and can throw errors, but might work
|