@dcl/sdk 7.0.0-3445274368.commit-063bc43 → 7.0.0-3469489430.commit-9c7979a

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.
@@ -1,7 +1,50 @@
1
1
  /// <reference types="@dcl/posix" />
2
2
 
3
3
  /** @public */
4
- export declare const Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
4
+ export declare const Animator: AnimatorComponentDefinition;
5
+
6
+ /**
7
+ * @public
8
+ */
9
+ export declare interface AnimatorComponentDefinition extends ComponentDefinition {
10
+ /**
11
+ * @public
12
+ *
13
+ * Get a `mutable` version of animator clip
14
+ * @param entity - entity with Animator component
15
+ * @param name - the field `name` of the component
16
+ * @returns the clip or fails if it isn't found
17
+ */
18
+ getClip(entity: Entity, name: string): PBAnimationState;
19
+ /**
20
+ * @public
21
+ *
22
+ * Get a `mutable` version of animator clip
23
+ * @param entity - entity with Animator component
24
+ * @param name - the field `name` of the component
25
+ * @returns the clip or null if it isn't found
26
+ */
27
+ getClipOrNull(entity: Entity, name: string): PBAnimationState | null;
28
+ /**
29
+ * @public
30
+ *
31
+ * Set playing=true the animation `$name`
32
+ * @param entity - entity with Animator component
33
+ * @param name - animation name
34
+ * @param resetCursor - the animation starts at 0 or continues from the current cursor position
35
+ * @returns true in successful playing, false if it doesn't find the Animator or clip
36
+ */
37
+ playSingleAnimation(entity: Entity, name: string, resetCursor?: boolean): boolean;
38
+ /**
39
+ * @public
40
+ *
41
+ * Set playing=false all animations
42
+ * @param entity - entity with Animator component
43
+ * @param resetCursor - the animation stops at 0 or at the current cursor position
44
+ * @returns true in successful playing, false if it doesn't find the Animator
45
+ */
46
+ stopAllAnimations(entity: Entity, resetCursor?: boolean): boolean;
47
+ }
5
48
 
6
49
  /** @public */
7
50
  export declare const AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
@@ -917,7 +960,7 @@ export declare namespace Components {
917
960
  /** @public */
918
961
  const Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
919
962
  /** @public */
920
- const Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
963
+ const Animator: AnimatorComponentDefinition;
921
964
  /** @public */
922
965
  const AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
923
966
  /** @public */
@@ -1156,8 +1199,8 @@ export declare type DeepReadonlyObject<T> = {
1156
1199
  export declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
1157
1200
 
1158
1201
  declare function defineSdkComponents(engine: PreEngine): {
1202
+ Animator: AnimatorComponentDefinition;
1159
1203
  Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
1160
- Animator: ComponentDefinition<ISchema<PBAnimator>, PBAnimator>;
1161
1204
  AudioSource: ComponentDefinition<ISchema<PBAudioSource>, PBAudioSource>;
1162
1205
  AudioStream: ComponentDefinition<ISchema<PBAudioStream>, PBAudioStream>;
1163
1206
  AvatarAttach: ComponentDefinition<ISchema<PBAvatarAttach>, PBAvatarAttach>;
@@ -2616,10 +2659,6 @@ declare interface PBAnimationState {
2616
2659
  shouldReset?: boolean | undefined;
2617
2660
  }
2618
2661
 
2619
- declare interface PBAnimator {
2620
- states: PBAnimationState[];
2621
- }
2622
-
2623
2662
  declare interface PBAudioSource {
2624
2663
  playing?: boolean | undefined;
2625
2664
  /** default=1.0f */
@@ -2700,6 +2739,16 @@ declare interface PBGltfContainer {
2700
2739
  }
2701
2740
 
2702
2741
  declare interface PBMaterial {
2742
+ material?: {
2743
+ $case: 'unlit';
2744
+ unlit: PBMaterial_UnlitMaterial;
2745
+ } | {
2746
+ $case: 'pbr';
2747
+ pbr: PBMaterial_PbrMaterial;
2748
+ };
2749
+ }
2750
+
2751
+ declare interface PBMaterial_PbrMaterial {
2703
2752
  /** default = null */
2704
2753
  texture?: TextureUnion | undefined;
2705
2754
  /** default = 0.5. range value: from 0 to 1 */
@@ -2734,6 +2783,15 @@ declare interface PBMaterial {
2734
2783
  directIntensity?: number | undefined;
2735
2784
  }
2736
2785
 
2786
+ declare interface PBMaterial_UnlitMaterial {
2787
+ /** default = null */
2788
+ texture?: TextureUnion | undefined;
2789
+ /** default = 0.5. range value: from 0 to 1 */
2790
+ alphaTest?: number | undefined;
2791
+ /** default = true */
2792
+ castShadows?: boolean | undefined;
2793
+ }
2794
+
2737
2795
  declare interface PBMeshCollider {
2738
2796
  /** default = ColliderLayer.Physics | ColliderLayer.Pointer */
2739
2797
  collisionMask?: number | undefined;
@@ -3665,6 +3723,7 @@ export declare namespace Schemas {
3665
3723
  const Quaternion: ISchema<QuaternionType>;
3666
3724
  const Color3: ISchema<Color3Type>;
3667
3725
  const Color4: ISchema<Color4Type>;
3726
+ const Entity: ISchema<Entity>;
3668
3727
  const Enum: typeof IEnum;
3669
3728
  const Array: typeof IArray;
3670
3729
  const Map: typeof IMap;