@dcl/sdk 7.0.0-3394589321.commit-cf8ebf5 → 7.0.0-3445306719.commit-c9822af
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/ecs7/index.d.ts +52 -12
- package/dist/ecs7/index.js +83 -8
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/package.json +5 -5
- package/types/ecs7/index.d.ts +52 -12
package/dist/ecs7/index.d.ts
CHANGED
@@ -1,7 +1,50 @@
|
|
1
1
|
/// <reference types="@dcl/posix" />
|
2
2
|
|
3
3
|
/** @public */
|
4
|
-
export declare const Animator:
|
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:
|
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 */
|
@@ -3243,7 +3282,7 @@ export declare namespace Quaternion {
|
|
3243
3282
|
* @param y - the rotation on the y axis in euler degrees
|
3244
3283
|
* @param z - the rotation on the z axis in euler degrees
|
3245
3284
|
*/
|
3246
|
-
export function
|
3285
|
+
export function fromEulerDegrees(x: number, y: number, z: number): MutableQuaternion;
|
3247
3286
|
/**
|
3248
3287
|
* Gets length of current quaternion
|
3249
3288
|
* @returns the quaternion length (float)
|
@@ -3265,7 +3304,7 @@ export declare namespace Quaternion {
|
|
3265
3304
|
* Returns the angle in degrees between two rotations a and b.
|
3266
3305
|
* @param quat1 - defines the first quaternion
|
3267
3306
|
* @param quat2 - defines the second quaternion
|
3268
|
-
* @returns the
|
3307
|
+
* @returns the degrees angle
|
3269
3308
|
*/
|
3270
3309
|
export function angle(quat1: ReadonlyQuaternion, quat2: ReadonlyQuaternion): number;
|
3271
3310
|
/**
|
@@ -3301,7 +3340,7 @@ export declare namespace Quaternion {
|
|
3301
3340
|
* Gets or sets the euler angle representation of the rotation.
|
3302
3341
|
* Implemented unity-based calculations from: https://stackoverflow.com/a/56055813
|
3303
3342
|
* @public
|
3304
|
-
* @returns a new Vector3 with euler angles
|
3343
|
+
* @returns a new Vector3 with euler angles degrees
|
3305
3344
|
*/
|
3306
3345
|
export function toEulerAngles(q: MutableQuaternion): Vector3.Mutable;
|
3307
3346
|
/**
|
@@ -3351,11 +3390,11 @@ export declare namespace Quaternion {
|
|
3351
3390
|
export function multiplyToRef(self: ReadonlyQuaternion, q1: ReadonlyQuaternion, result: MutableQuaternion): void;
|
3352
3391
|
/**
|
3353
3392
|
*
|
3354
|
-
* @param
|
3393
|
+
* @param degrees - the angle degrees
|
3355
3394
|
* @param axis - vector3
|
3356
3395
|
* @returns a new Quaternion
|
3357
3396
|
*/
|
3358
|
-
export function fromAngleAxis(
|
3397
|
+
export function fromAngleAxis(degrees: number, axis: Vector3.ReadonlyVector3): MutableQuaternion;
|
3359
3398
|
/**
|
3360
3399
|
* Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)
|
3361
3400
|
* @param axis1 - defines the first axis
|
@@ -3665,6 +3704,7 @@ export declare namespace Schemas {
|
|
3665
3704
|
const Quaternion: ISchema<QuaternionType>;
|
3666
3705
|
const Color3: ISchema<Color3Type>;
|
3667
3706
|
const Color4: ISchema<Color4Type>;
|
3707
|
+
const Entity: ISchema<Entity>;
|
3668
3708
|
const Enum: typeof IEnum;
|
3669
3709
|
const Array: typeof IArray;
|
3670
3710
|
const Map: typeof IMap;
|