@dcl/ecs 7.3.20 → 7.3.21-6483018672.commit-3538b47
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/components/extended/Tween.d.ts +29 -0
- package/dist/components/extended/Tween.js +28 -0
- package/dist/components/generated/Tween.gen.d.ts +1 -0
- package/dist/components/generated/Tween.gen.js +25 -0
- package/dist/components/generated/TweenSequence.gen.d.ts +1 -0
- package/dist/components/generated/TweenSequence.gen.js +25 -0
- package/dist/components/generated/TweenState.gen.d.ts +1 -0
- package/dist/components/generated/TweenState.gen.js +25 -0
- package/dist/components/generated/component-names.gen.js +3 -0
- package/dist/components/generated/global.gen.d.ts +4 -0
- package/dist/components/generated/global.gen.js +2 -0
- package/dist/components/generated/index.gen.d.ts +12 -0
- package/dist/components/generated/index.gen.js +15 -0
- package/dist/components/generated/pb/decentraland/sdk/components/tween.gen.d.ts +115 -0
- package/dist/components/generated/pb/decentraland/sdk/components/tween.gen.js +290 -0
- package/dist/components/generated/pb/decentraland/sdk/components/tween_sequence.gen.d.ts +23 -0
- package/dist/components/generated/pb/decentraland/sdk/components/tween_sequence.gen.js +59 -0
- package/dist/components/generated/pb/decentraland/sdk/components/tween_state.gen.d.ts +24 -0
- package/dist/components/generated/pb/decentraland/sdk/components/tween_state.gen.js +59 -0
- package/dist/components/generated/types.gen.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +3 -0
- package/dist/components/types.d.ts +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/runtime/initialization/index.d.ts +7 -1
- package/dist/runtime/initialization/index.js +6 -1
- package/dist/systems/tween.d.ts +4 -0
- package/dist/systems/tween.js +116 -0
- package/dist-cjs/components/extended/Tween.d.ts +29 -0
- package/dist-cjs/components/extended/Tween.js +32 -0
- package/dist-cjs/components/generated/Tween.gen.d.ts +1 -0
- package/dist-cjs/components/generated/Tween.gen.js +28 -0
- package/dist-cjs/components/generated/TweenSequence.gen.d.ts +1 -0
- package/dist-cjs/components/generated/TweenSequence.gen.js +28 -0
- package/dist-cjs/components/generated/TweenState.gen.d.ts +1 -0
- package/dist-cjs/components/generated/TweenState.gen.js +28 -0
- package/dist-cjs/components/generated/component-names.gen.js +3 -0
- package/dist-cjs/components/generated/global.gen.d.ts +4 -0
- package/dist-cjs/components/generated/global.gen.js +3 -1
- package/dist-cjs/components/generated/index.gen.d.ts +12 -0
- package/dist-cjs/components/generated/index.gen.js +19 -1
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween.gen.d.ts +115 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween.gen.js +296 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween_sequence.gen.d.ts +23 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween_sequence.gen.js +65 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween_state.gen.d.ts +24 -0
- package/dist-cjs/components/generated/pb/decentraland/sdk/components/tween_state.gen.js +65 -0
- package/dist-cjs/components/generated/types.gen.d.ts +1 -1
- package/dist-cjs/components/index.d.ts +2 -0
- package/dist-cjs/components/index.js +5 -1
- package/dist-cjs/components/types.d.ts +1 -0
- package/dist-cjs/index.d.ts +2 -1
- package/dist-cjs/index.js +2 -1
- package/dist-cjs/runtime/initialization/index.d.ts +7 -1
- package/dist-cjs/runtime/initialization/index.js +7 -2
- package/dist-cjs/systems/tween.d.ts +4 -0
- package/dist-cjs/systems/tween.js +143 -0
- package/package.json +2 -2
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IEngine, LastWriteWinElementSetComponentDefinition } from '../../engine';
|
|
2
|
+
import { PBTween, Move, Rotate, Scale } from '../generated/index.gen';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface TweenHelper {
|
|
7
|
+
/**
|
|
8
|
+
* @returns a move mode tween
|
|
9
|
+
*/
|
|
10
|
+
Move: (move: Move) => PBTween['mode'];
|
|
11
|
+
/**
|
|
12
|
+
* @returns a move mode tween
|
|
13
|
+
*/
|
|
14
|
+
Rotate: (rotate: Rotate) => PBTween['mode'];
|
|
15
|
+
/**
|
|
16
|
+
* @returns a move mode tween
|
|
17
|
+
*/
|
|
18
|
+
Scale: (scale: Scale) => PBTween['mode'];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export interface TweenComponentDefinitionExtended extends LastWriteWinElementSetComponentDefinition<PBTween> {
|
|
24
|
+
/**
|
|
25
|
+
* Texture helpers with constructor
|
|
26
|
+
*/
|
|
27
|
+
Mode: TweenHelper;
|
|
28
|
+
}
|
|
29
|
+
export declare function defineTweenComponent(engine: Pick<IEngine, 'defineComponentFromSchema'>): TweenComponentDefinitionExtended;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Tween } from '../generated/index.gen';
|
|
2
|
+
const TweenHelper = {
|
|
3
|
+
Move(move) {
|
|
4
|
+
return {
|
|
5
|
+
$case: 'move',
|
|
6
|
+
move
|
|
7
|
+
};
|
|
8
|
+
},
|
|
9
|
+
Rotate(rotate) {
|
|
10
|
+
return {
|
|
11
|
+
$case: 'rotate',
|
|
12
|
+
rotate
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
Scale(scale) {
|
|
16
|
+
return {
|
|
17
|
+
$case: 'scale',
|
|
18
|
+
scale
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export function defineTweenComponent(engine) {
|
|
23
|
+
const theComponent = Tween(engine);
|
|
24
|
+
return {
|
|
25
|
+
...theComponent,
|
|
26
|
+
Mode: TweenHelper
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PBTween } from './pb/decentraland/sdk/components/tween.gen';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export const TweenSchema = {
|
|
6
|
+
COMPONENT_ID: 1102,
|
|
7
|
+
serialize(value, builder) {
|
|
8
|
+
const writer = PBTween.encode(value);
|
|
9
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
10
|
+
builder.writeBuffer(buffer, false);
|
|
11
|
+
},
|
|
12
|
+
deserialize(reader) {
|
|
13
|
+
return PBTween.decode(reader.buffer(), reader.remainingBytes());
|
|
14
|
+
},
|
|
15
|
+
create() {
|
|
16
|
+
// TODO: this is a hack.
|
|
17
|
+
return PBTween.decode(new Uint8Array());
|
|
18
|
+
},
|
|
19
|
+
jsonSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {},
|
|
22
|
+
serializationType: "protocol-buffer",
|
|
23
|
+
protocolBuffer: "PBTween"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PBTweenSequence } from './pb/decentraland/sdk/components/tween_sequence.gen';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export const TweenSequenceSchema = {
|
|
6
|
+
COMPONENT_ID: 1104,
|
|
7
|
+
serialize(value, builder) {
|
|
8
|
+
const writer = PBTweenSequence.encode(value);
|
|
9
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
10
|
+
builder.writeBuffer(buffer, false);
|
|
11
|
+
},
|
|
12
|
+
deserialize(reader) {
|
|
13
|
+
return PBTweenSequence.decode(reader.buffer(), reader.remainingBytes());
|
|
14
|
+
},
|
|
15
|
+
create() {
|
|
16
|
+
// TODO: this is a hack.
|
|
17
|
+
return PBTweenSequence.decode(new Uint8Array());
|
|
18
|
+
},
|
|
19
|
+
jsonSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {},
|
|
22
|
+
serializationType: "protocol-buffer",
|
|
23
|
+
protocolBuffer: "PBTweenSequence"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PBTweenState } from './pb/decentraland/sdk/components/tween_state.gen';
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export const TweenStateSchema = {
|
|
6
|
+
COMPONENT_ID: 1103,
|
|
7
|
+
serialize(value, builder) {
|
|
8
|
+
const writer = PBTweenState.encode(value);
|
|
9
|
+
const buffer = new Uint8Array(writer.finish(), 0, writer.len);
|
|
10
|
+
builder.writeBuffer(buffer, false);
|
|
11
|
+
},
|
|
12
|
+
deserialize(reader) {
|
|
13
|
+
return PBTweenState.decode(reader.buffer(), reader.remainingBytes());
|
|
14
|
+
},
|
|
15
|
+
create() {
|
|
16
|
+
// TODO: this is a hack.
|
|
17
|
+
return PBTweenState.decode(new Uint8Array());
|
|
18
|
+
},
|
|
19
|
+
jsonSchema: {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {},
|
|
22
|
+
serializationType: "protocol-buffer",
|
|
23
|
+
protocolBuffer: "PBTweenState"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -29,6 +29,9 @@ export const coreComponentMappings = {
|
|
|
29
29
|
"core::Raycast": 1067,
|
|
30
30
|
"core::RaycastResult": 1068,
|
|
31
31
|
"core::TextShape": 1030,
|
|
32
|
+
"core::Tween": 1102,
|
|
33
|
+
"core::TweenSequence": 1104,
|
|
34
|
+
"core::TweenState": 1103,
|
|
32
35
|
"core::UiBackground": 1053,
|
|
33
36
|
"core::UiCanvasInformation": 1054,
|
|
34
37
|
"core::UiDropdown": 1094,
|
|
@@ -18,6 +18,8 @@ import { PBPointerLock } from './pb/decentraland/sdk/components/pointer_lock.gen
|
|
|
18
18
|
import { PBRaycast } from './pb/decentraland/sdk/components/raycast.gen';
|
|
19
19
|
import { PBRaycastResult } from './pb/decentraland/sdk/components/raycast_result.gen';
|
|
20
20
|
import { PBTextShape } from './pb/decentraland/sdk/components/text_shape.gen';
|
|
21
|
+
import { PBTweenSequence } from './pb/decentraland/sdk/components/tween_sequence.gen';
|
|
22
|
+
import { PBTweenState } from './pb/decentraland/sdk/components/tween_state.gen';
|
|
21
23
|
import { PBUiBackground } from './pb/decentraland/sdk/components/ui_background.gen';
|
|
22
24
|
import { PBUiCanvasInformation } from './pb/decentraland/sdk/components/ui_canvas_information.gen';
|
|
23
25
|
import { PBUiDropdown } from './pb/decentraland/sdk/components/ui_dropdown.gen';
|
|
@@ -47,6 +49,8 @@ import { PBVisibilityComponent } from './pb/decentraland/sdk/components/visibili
|
|
|
47
49
|
/** @public */ export declare const Raycast: LastWriteWinElementSetComponentDefinition<PBRaycast>;
|
|
48
50
|
/** @public */ export declare const RaycastResult: LastWriteWinElementSetComponentDefinition<PBRaycastResult>;
|
|
49
51
|
/** @public */ export declare const TextShape: LastWriteWinElementSetComponentDefinition<PBTextShape>;
|
|
52
|
+
/** @public */ export declare const TweenSequence: LastWriteWinElementSetComponentDefinition<PBTweenSequence>;
|
|
53
|
+
/** @public */ export declare const TweenState: LastWriteWinElementSetComponentDefinition<PBTweenState>;
|
|
50
54
|
/** @public */ export declare const UiBackground: LastWriteWinElementSetComponentDefinition<PBUiBackground>;
|
|
51
55
|
/** @public */ export declare const UiCanvasInformation: LastWriteWinElementSetComponentDefinition<PBUiCanvasInformation>;
|
|
52
56
|
/** @public */ export declare const UiDropdown: LastWriteWinElementSetComponentDefinition<PBUiDropdown>;
|
|
@@ -19,6 +19,8 @@ export * from './index.gen';
|
|
|
19
19
|
/** @public */ export const Raycast = /* @__PURE__ */ components.Raycast(engine);
|
|
20
20
|
/** @public */ export const RaycastResult = /* @__PURE__ */ components.RaycastResult(engine);
|
|
21
21
|
/** @public */ export const TextShape = /* @__PURE__ */ components.TextShape(engine);
|
|
22
|
+
/** @public */ export const TweenSequence = /* @__PURE__ */ components.TweenSequence(engine);
|
|
23
|
+
/** @public */ export const TweenState = /* @__PURE__ */ components.TweenState(engine);
|
|
22
24
|
/** @public */ export const UiBackground = /* @__PURE__ */ components.UiBackground(engine);
|
|
23
25
|
/** @public */ export const UiCanvasInformation = /* @__PURE__ */ components.UiCanvasInformation(engine);
|
|
24
26
|
/** @public */ export const UiDropdown = /* @__PURE__ */ components.UiDropdown(engine);
|
|
@@ -22,6 +22,9 @@ import { PBPointerLock } from './pb/decentraland/sdk/components/pointer_lock.gen
|
|
|
22
22
|
import { PBRaycast } from './pb/decentraland/sdk/components/raycast.gen';
|
|
23
23
|
import { PBRaycastResult } from './pb/decentraland/sdk/components/raycast_result.gen';
|
|
24
24
|
import { PBTextShape } from './pb/decentraland/sdk/components/text_shape.gen';
|
|
25
|
+
import { PBTween } from './pb/decentraland/sdk/components/tween.gen';
|
|
26
|
+
import { PBTweenSequence } from './pb/decentraland/sdk/components/tween_sequence.gen';
|
|
27
|
+
import { PBTweenState } from './pb/decentraland/sdk/components/tween_state.gen';
|
|
25
28
|
import { PBUiBackground } from './pb/decentraland/sdk/components/ui_background.gen';
|
|
26
29
|
import { PBUiCanvasInformation } from './pb/decentraland/sdk/components/ui_canvas_information.gen';
|
|
27
30
|
import { PBUiDropdown } from './pb/decentraland/sdk/components/ui_dropdown.gen';
|
|
@@ -55,6 +58,9 @@ export * from './pb/decentraland/sdk/components/pointer_lock.gen';
|
|
|
55
58
|
export * from './pb/decentraland/sdk/components/raycast.gen';
|
|
56
59
|
export * from './pb/decentraland/sdk/components/raycast_result.gen';
|
|
57
60
|
export * from './pb/decentraland/sdk/components/text_shape.gen';
|
|
61
|
+
export * from './pb/decentraland/sdk/components/tween.gen';
|
|
62
|
+
export * from './pb/decentraland/sdk/components/tween_sequence.gen';
|
|
63
|
+
export * from './pb/decentraland/sdk/components/tween_state.gen';
|
|
58
64
|
export * from './pb/decentraland/sdk/components/ui_background.gen';
|
|
59
65
|
export * from './pb/decentraland/sdk/components/ui_canvas_information.gen';
|
|
60
66
|
export * from './pb/decentraland/sdk/components/ui_dropdown.gen';
|
|
@@ -90,6 +96,9 @@ export type GSetComponentGetter<T extends GrowOnlyValueSetComponentDefinition<an
|
|
|
90
96
|
/** @public */ export declare const Raycast: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBRaycast>>;
|
|
91
97
|
/** @public */ export declare const RaycastResult: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBRaycastResult>>;
|
|
92
98
|
/** @public */ export declare const TextShape: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTextShape>>;
|
|
99
|
+
/** @public */ export declare const Tween: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTween>>;
|
|
100
|
+
/** @public */ export declare const TweenSequence: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTweenSequence>>;
|
|
101
|
+
/** @public */ export declare const TweenState: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTweenState>>;
|
|
93
102
|
/** @public */ export declare const UiBackground: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBUiBackground>>;
|
|
94
103
|
/** @public */ export declare const UiCanvasInformation: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBUiCanvasInformation>>;
|
|
95
104
|
/** @public */ export declare const UiDropdown: LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBUiDropdown>>;
|
|
@@ -125,6 +134,9 @@ export declare const componentDefinitionByName: {
|
|
|
125
134
|
"core::Raycast": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBRaycast>>;
|
|
126
135
|
"core::RaycastResult": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBRaycastResult>>;
|
|
127
136
|
"core::TextShape": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTextShape>>;
|
|
137
|
+
"core::Tween": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTween>>;
|
|
138
|
+
"core::TweenSequence": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTweenSequence>>;
|
|
139
|
+
"core::TweenState": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBTweenState>>;
|
|
128
140
|
"core::UiBackground": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBUiBackground>>;
|
|
129
141
|
"core::UiCanvasInformation": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBUiCanvasInformation>>;
|
|
130
142
|
"core::UiDropdown": LwwComponentGetter<LastWriteWinElementSetComponentDefinition<PBUiDropdown>>;
|
|
@@ -20,6 +20,9 @@ import { PointerLockSchema } from './PointerLock.gen';
|
|
|
20
20
|
import { RaycastSchema } from './Raycast.gen';
|
|
21
21
|
import { RaycastResultSchema } from './RaycastResult.gen';
|
|
22
22
|
import { TextShapeSchema } from './TextShape.gen';
|
|
23
|
+
import { TweenSchema } from './Tween.gen';
|
|
24
|
+
import { TweenSequenceSchema } from './TweenSequence.gen';
|
|
25
|
+
import { TweenStateSchema } from './TweenState.gen';
|
|
23
26
|
import { UiBackgroundSchema } from './UiBackground.gen';
|
|
24
27
|
import { UiCanvasInformationSchema } from './UiCanvasInformation.gen';
|
|
25
28
|
import { UiDropdownSchema } from './UiDropdown.gen';
|
|
@@ -53,6 +56,9 @@ export * from './pb/decentraland/sdk/components/pointer_lock.gen';
|
|
|
53
56
|
export * from './pb/decentraland/sdk/components/raycast.gen';
|
|
54
57
|
export * from './pb/decentraland/sdk/components/raycast_result.gen';
|
|
55
58
|
export * from './pb/decentraland/sdk/components/text_shape.gen';
|
|
59
|
+
export * from './pb/decentraland/sdk/components/tween.gen';
|
|
60
|
+
export * from './pb/decentraland/sdk/components/tween_sequence.gen';
|
|
61
|
+
export * from './pb/decentraland/sdk/components/tween_state.gen';
|
|
56
62
|
export * from './pb/decentraland/sdk/components/ui_background.gen';
|
|
57
63
|
export * from './pb/decentraland/sdk/components/ui_canvas_information.gen';
|
|
58
64
|
export * from './pb/decentraland/sdk/components/ui_dropdown.gen';
|
|
@@ -110,6 +116,12 @@ export * from './pb/decentraland/sdk/components/visibility_component.gen';
|
|
|
110
116
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::RaycastResult", RaycastResultSchema);
|
|
111
117
|
/** @public */ export const TextShape = engine =>
|
|
112
118
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::TextShape", TextShapeSchema);
|
|
119
|
+
/** @public */ export const Tween = engine =>
|
|
120
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::Tween", TweenSchema);
|
|
121
|
+
/** @public */ export const TweenSequence = engine =>
|
|
122
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::TweenSequence", TweenSequenceSchema);
|
|
123
|
+
/** @public */ export const TweenState = engine =>
|
|
124
|
+
/* @__PURE__ */ engine.defineComponentFromSchema("core::TweenState", TweenStateSchema);
|
|
113
125
|
/** @public */ export const UiBackground = engine =>
|
|
114
126
|
/* @__PURE__ */ engine.defineComponentFromSchema("core::UiBackground", UiBackgroundSchema);
|
|
115
127
|
/** @public */ export const UiCanvasInformation = engine =>
|
|
@@ -158,6 +170,9 @@ export const componentDefinitionByName = /* @__PURE__ */ {
|
|
|
158
170
|
"core::Raycast": Raycast,
|
|
159
171
|
"core::RaycastResult": RaycastResult,
|
|
160
172
|
"core::TextShape": TextShape,
|
|
173
|
+
"core::Tween": Tween,
|
|
174
|
+
"core::TweenSequence": TweenSequence,
|
|
175
|
+
"core::TweenState": TweenState,
|
|
161
176
|
"core::UiBackground": UiBackground,
|
|
162
177
|
"core::UiCanvasInformation": UiCanvasInformation,
|
|
163
178
|
"core::UiDropdown": UiDropdown,
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
import { Quaternion, Vector3 } from "../../common/vectors.gen";
|
|
3
|
+
/**
|
|
4
|
+
* Implementation guidelines for these easing functions can be found
|
|
5
|
+
* at https://github.com/ai/easings.net/blob/6fcd5f852a470bf1a7890e8178afa0f471d5f2ec/src/easings/easingsFunctions.ts
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export declare const enum EasingFunction {
|
|
11
|
+
/** EF_LINEAR - default */
|
|
12
|
+
EF_LINEAR = 0,
|
|
13
|
+
EF_EASEINQUAD = 1,
|
|
14
|
+
EF_EASEOUTQUAD = 2,
|
|
15
|
+
EF_EASEQUAD = 3,
|
|
16
|
+
EF_EASEINSINE = 4,
|
|
17
|
+
EF_EASEOUTSINE = 5,
|
|
18
|
+
EF_EASESINE = 6,
|
|
19
|
+
EF_EASEINEXPO = 7,
|
|
20
|
+
EF_EASEOUTEXPO = 8,
|
|
21
|
+
EF_EASEEXPO = 9,
|
|
22
|
+
EF_EASEINELASTIC = 10,
|
|
23
|
+
EF_EASEOUTELASTIC = 11,
|
|
24
|
+
EF_EASEELASTIC = 12,
|
|
25
|
+
EF_EASEINBOUNCE = 13,
|
|
26
|
+
EF_EASEOUTBOUNCE = 14,
|
|
27
|
+
EF_EASEBOUNCE = 15,
|
|
28
|
+
EF_EASEINCUBIC = 16,
|
|
29
|
+
EF_EASEOUTCUBIC = 17,
|
|
30
|
+
EF_EASECUBIC = 18,
|
|
31
|
+
EF_EASEINQUART = 19,
|
|
32
|
+
EF_EASEOUTQUART = 20,
|
|
33
|
+
EF_EASEQUART = 21,
|
|
34
|
+
EF_EASEINQUINT = 22,
|
|
35
|
+
EF_EASEOUTQUINT = 23,
|
|
36
|
+
EF_EASEQUINT = 24,
|
|
37
|
+
EF_EASEINCIRC = 25,
|
|
38
|
+
EF_EASEOUTCIRC = 26,
|
|
39
|
+
EF_EASECIRC = 27,
|
|
40
|
+
EF_EASEINBACK = 28,
|
|
41
|
+
EF_EASEOUTBACK = 29,
|
|
42
|
+
EF_EASEBACK = 30
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @public
|
|
46
|
+
*/
|
|
47
|
+
export interface PBTween {
|
|
48
|
+
/** in milliseconds */
|
|
49
|
+
duration: number;
|
|
50
|
+
easingFunction: EasingFunction;
|
|
51
|
+
mode?: {
|
|
52
|
+
$case: "move";
|
|
53
|
+
move: Move;
|
|
54
|
+
} | {
|
|
55
|
+
$case: "rotate";
|
|
56
|
+
rotate: Rotate;
|
|
57
|
+
} | {
|
|
58
|
+
$case: "scale";
|
|
59
|
+
scale: Scale;
|
|
60
|
+
} | undefined;
|
|
61
|
+
/** default true (pause or running) */
|
|
62
|
+
playing?: boolean | undefined;
|
|
63
|
+
/** between 0 and 1 */
|
|
64
|
+
currentTime?: number | undefined;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export interface Move {
|
|
70
|
+
start: Vector3 | undefined;
|
|
71
|
+
end: Vector3 | undefined;
|
|
72
|
+
faceDirection?: boolean | undefined;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
export interface Rotate {
|
|
78
|
+
start: Quaternion | undefined;
|
|
79
|
+
end: Quaternion | undefined;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
84
|
+
export interface Scale {
|
|
85
|
+
start: Vector3 | undefined;
|
|
86
|
+
end: Vector3 | undefined;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export declare namespace PBTween {
|
|
92
|
+
function encode(message: PBTween, writer?: _m0.Writer): _m0.Writer;
|
|
93
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBTween;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export declare namespace Move {
|
|
99
|
+
function encode(message: Move, writer?: _m0.Writer): _m0.Writer;
|
|
100
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): Move;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
export declare namespace Rotate {
|
|
106
|
+
function encode(message: Rotate, writer?: _m0.Writer): _m0.Writer;
|
|
107
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): Rotate;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
export declare namespace Scale {
|
|
113
|
+
function encode(message: Scale, writer?: _m0.Writer): _m0.Writer;
|
|
114
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): Scale;
|
|
115
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { Quaternion, Vector3 } from "../../common/vectors.gen";
|
|
4
|
+
const protobufPackageSarasa = "decentraland.sdk.components";
|
|
5
|
+
/**
|
|
6
|
+
* Implementation guidelines for these easing functions can be found
|
|
7
|
+
* at https://github.com/ai/easings.net/blob/6fcd5f852a470bf1a7890e8178afa0f471d5f2ec/src/easings/easingsFunctions.ts
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export var EasingFunction;
|
|
13
|
+
(function (EasingFunction) {
|
|
14
|
+
/** EF_LINEAR - default */
|
|
15
|
+
EasingFunction[EasingFunction["EF_LINEAR"] = 0] = "EF_LINEAR";
|
|
16
|
+
EasingFunction[EasingFunction["EF_EASEINQUAD"] = 1] = "EF_EASEINQUAD";
|
|
17
|
+
EasingFunction[EasingFunction["EF_EASEOUTQUAD"] = 2] = "EF_EASEOUTQUAD";
|
|
18
|
+
EasingFunction[EasingFunction["EF_EASEQUAD"] = 3] = "EF_EASEQUAD";
|
|
19
|
+
EasingFunction[EasingFunction["EF_EASEINSINE"] = 4] = "EF_EASEINSINE";
|
|
20
|
+
EasingFunction[EasingFunction["EF_EASEOUTSINE"] = 5] = "EF_EASEOUTSINE";
|
|
21
|
+
EasingFunction[EasingFunction["EF_EASESINE"] = 6] = "EF_EASESINE";
|
|
22
|
+
EasingFunction[EasingFunction["EF_EASEINEXPO"] = 7] = "EF_EASEINEXPO";
|
|
23
|
+
EasingFunction[EasingFunction["EF_EASEOUTEXPO"] = 8] = "EF_EASEOUTEXPO";
|
|
24
|
+
EasingFunction[EasingFunction["EF_EASEEXPO"] = 9] = "EF_EASEEXPO";
|
|
25
|
+
EasingFunction[EasingFunction["EF_EASEINELASTIC"] = 10] = "EF_EASEINELASTIC";
|
|
26
|
+
EasingFunction[EasingFunction["EF_EASEOUTELASTIC"] = 11] = "EF_EASEOUTELASTIC";
|
|
27
|
+
EasingFunction[EasingFunction["EF_EASEELASTIC"] = 12] = "EF_EASEELASTIC";
|
|
28
|
+
EasingFunction[EasingFunction["EF_EASEINBOUNCE"] = 13] = "EF_EASEINBOUNCE";
|
|
29
|
+
EasingFunction[EasingFunction["EF_EASEOUTBOUNCE"] = 14] = "EF_EASEOUTBOUNCE";
|
|
30
|
+
EasingFunction[EasingFunction["EF_EASEBOUNCE"] = 15] = "EF_EASEBOUNCE";
|
|
31
|
+
EasingFunction[EasingFunction["EF_EASEINCUBIC"] = 16] = "EF_EASEINCUBIC";
|
|
32
|
+
EasingFunction[EasingFunction["EF_EASEOUTCUBIC"] = 17] = "EF_EASEOUTCUBIC";
|
|
33
|
+
EasingFunction[EasingFunction["EF_EASECUBIC"] = 18] = "EF_EASECUBIC";
|
|
34
|
+
EasingFunction[EasingFunction["EF_EASEINQUART"] = 19] = "EF_EASEINQUART";
|
|
35
|
+
EasingFunction[EasingFunction["EF_EASEOUTQUART"] = 20] = "EF_EASEOUTQUART";
|
|
36
|
+
EasingFunction[EasingFunction["EF_EASEQUART"] = 21] = "EF_EASEQUART";
|
|
37
|
+
EasingFunction[EasingFunction["EF_EASEINQUINT"] = 22] = "EF_EASEINQUINT";
|
|
38
|
+
EasingFunction[EasingFunction["EF_EASEOUTQUINT"] = 23] = "EF_EASEOUTQUINT";
|
|
39
|
+
EasingFunction[EasingFunction["EF_EASEQUINT"] = 24] = "EF_EASEQUINT";
|
|
40
|
+
EasingFunction[EasingFunction["EF_EASEINCIRC"] = 25] = "EF_EASEINCIRC";
|
|
41
|
+
EasingFunction[EasingFunction["EF_EASEOUTCIRC"] = 26] = "EF_EASEOUTCIRC";
|
|
42
|
+
EasingFunction[EasingFunction["EF_EASECIRC"] = 27] = "EF_EASECIRC";
|
|
43
|
+
EasingFunction[EasingFunction["EF_EASEINBACK"] = 28] = "EF_EASEINBACK";
|
|
44
|
+
EasingFunction[EasingFunction["EF_EASEOUTBACK"] = 29] = "EF_EASEOUTBACK";
|
|
45
|
+
EasingFunction[EasingFunction["EF_EASEBACK"] = 30] = "EF_EASEBACK";
|
|
46
|
+
})(EasingFunction || (EasingFunction = {}));
|
|
47
|
+
function createBasePBTween() {
|
|
48
|
+
return { duration: 0, easingFunction: 0, mode: undefined, playing: undefined, currentTime: undefined };
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export var PBTween;
|
|
54
|
+
(function (PBTween) {
|
|
55
|
+
function encode(message, writer = _m0.Writer.create()) {
|
|
56
|
+
if (message.duration !== 0) {
|
|
57
|
+
writer.uint32(13).float(message.duration);
|
|
58
|
+
}
|
|
59
|
+
if (message.easingFunction !== 0) {
|
|
60
|
+
writer.uint32(16).int32(message.easingFunction);
|
|
61
|
+
}
|
|
62
|
+
switch (message.mode?.$case) {
|
|
63
|
+
case "move":
|
|
64
|
+
Move.encode(message.mode.move, writer.uint32(26).fork()).ldelim();
|
|
65
|
+
break;
|
|
66
|
+
case "rotate":
|
|
67
|
+
Rotate.encode(message.mode.rotate, writer.uint32(34).fork()).ldelim();
|
|
68
|
+
break;
|
|
69
|
+
case "scale":
|
|
70
|
+
Scale.encode(message.mode.scale, writer.uint32(42).fork()).ldelim();
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
if (message.playing !== undefined) {
|
|
74
|
+
writer.uint32(48).bool(message.playing);
|
|
75
|
+
}
|
|
76
|
+
if (message.currentTime !== undefined) {
|
|
77
|
+
writer.uint32(61).float(message.currentTime);
|
|
78
|
+
}
|
|
79
|
+
return writer;
|
|
80
|
+
}
|
|
81
|
+
PBTween.encode = encode;
|
|
82
|
+
function decode(input, length) {
|
|
83
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
84
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
85
|
+
const message = createBasePBTween();
|
|
86
|
+
while (reader.pos < end) {
|
|
87
|
+
const tag = reader.uint32();
|
|
88
|
+
switch (tag >>> 3) {
|
|
89
|
+
case 1:
|
|
90
|
+
if (tag !== 13) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
message.duration = reader.float();
|
|
94
|
+
continue;
|
|
95
|
+
case 2:
|
|
96
|
+
if (tag !== 16) {
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
message.easingFunction = reader.int32();
|
|
100
|
+
continue;
|
|
101
|
+
case 3:
|
|
102
|
+
if (tag !== 26) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
message.mode = { $case: "move", move: Move.decode(reader, reader.uint32()) };
|
|
106
|
+
continue;
|
|
107
|
+
case 4:
|
|
108
|
+
if (tag !== 34) {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
message.mode = { $case: "rotate", rotate: Rotate.decode(reader, reader.uint32()) };
|
|
112
|
+
continue;
|
|
113
|
+
case 5:
|
|
114
|
+
if (tag !== 42) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
message.mode = { $case: "scale", scale: Scale.decode(reader, reader.uint32()) };
|
|
118
|
+
continue;
|
|
119
|
+
case 6:
|
|
120
|
+
if (tag !== 48) {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
message.playing = reader.bool();
|
|
124
|
+
continue;
|
|
125
|
+
case 7:
|
|
126
|
+
if (tag !== 61) {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
message.currentTime = reader.float();
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
reader.skipType(tag & 7);
|
|
136
|
+
}
|
|
137
|
+
return message;
|
|
138
|
+
}
|
|
139
|
+
PBTween.decode = decode;
|
|
140
|
+
})(PBTween || (PBTween = {}));
|
|
141
|
+
function createBaseMove() {
|
|
142
|
+
return { start: undefined, end: undefined, faceDirection: undefined };
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* @public
|
|
146
|
+
*/
|
|
147
|
+
export var Move;
|
|
148
|
+
(function (Move) {
|
|
149
|
+
function encode(message, writer = _m0.Writer.create()) {
|
|
150
|
+
if (message.start !== undefined) {
|
|
151
|
+
Vector3.encode(message.start, writer.uint32(10).fork()).ldelim();
|
|
152
|
+
}
|
|
153
|
+
if (message.end !== undefined) {
|
|
154
|
+
Vector3.encode(message.end, writer.uint32(18).fork()).ldelim();
|
|
155
|
+
}
|
|
156
|
+
if (message.faceDirection !== undefined) {
|
|
157
|
+
writer.uint32(24).bool(message.faceDirection);
|
|
158
|
+
}
|
|
159
|
+
return writer;
|
|
160
|
+
}
|
|
161
|
+
Move.encode = encode;
|
|
162
|
+
function decode(input, length) {
|
|
163
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
164
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
165
|
+
const message = createBaseMove();
|
|
166
|
+
while (reader.pos < end) {
|
|
167
|
+
const tag = reader.uint32();
|
|
168
|
+
switch (tag >>> 3) {
|
|
169
|
+
case 1:
|
|
170
|
+
if (tag !== 10) {
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
message.start = Vector3.decode(reader, reader.uint32());
|
|
174
|
+
continue;
|
|
175
|
+
case 2:
|
|
176
|
+
if (tag !== 18) {
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
message.end = Vector3.decode(reader, reader.uint32());
|
|
180
|
+
continue;
|
|
181
|
+
case 3:
|
|
182
|
+
if (tag !== 24) {
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
message.faceDirection = reader.bool();
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
reader.skipType(tag & 7);
|
|
192
|
+
}
|
|
193
|
+
return message;
|
|
194
|
+
}
|
|
195
|
+
Move.decode = decode;
|
|
196
|
+
})(Move || (Move = {}));
|
|
197
|
+
function createBaseRotate() {
|
|
198
|
+
return { start: undefined, end: undefined };
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @public
|
|
202
|
+
*/
|
|
203
|
+
export var Rotate;
|
|
204
|
+
(function (Rotate) {
|
|
205
|
+
function encode(message, writer = _m0.Writer.create()) {
|
|
206
|
+
if (message.start !== undefined) {
|
|
207
|
+
Quaternion.encode(message.start, writer.uint32(10).fork()).ldelim();
|
|
208
|
+
}
|
|
209
|
+
if (message.end !== undefined) {
|
|
210
|
+
Quaternion.encode(message.end, writer.uint32(18).fork()).ldelim();
|
|
211
|
+
}
|
|
212
|
+
return writer;
|
|
213
|
+
}
|
|
214
|
+
Rotate.encode = encode;
|
|
215
|
+
function decode(input, length) {
|
|
216
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
217
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
218
|
+
const message = createBaseRotate();
|
|
219
|
+
while (reader.pos < end) {
|
|
220
|
+
const tag = reader.uint32();
|
|
221
|
+
switch (tag >>> 3) {
|
|
222
|
+
case 1:
|
|
223
|
+
if (tag !== 10) {
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
message.start = Quaternion.decode(reader, reader.uint32());
|
|
227
|
+
continue;
|
|
228
|
+
case 2:
|
|
229
|
+
if (tag !== 18) {
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
message.end = Quaternion.decode(reader, reader.uint32());
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
reader.skipType(tag & 7);
|
|
239
|
+
}
|
|
240
|
+
return message;
|
|
241
|
+
}
|
|
242
|
+
Rotate.decode = decode;
|
|
243
|
+
})(Rotate || (Rotate = {}));
|
|
244
|
+
function createBaseScale() {
|
|
245
|
+
return { start: undefined, end: undefined };
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @public
|
|
249
|
+
*/
|
|
250
|
+
export var Scale;
|
|
251
|
+
(function (Scale) {
|
|
252
|
+
function encode(message, writer = _m0.Writer.create()) {
|
|
253
|
+
if (message.start !== undefined) {
|
|
254
|
+
Vector3.encode(message.start, writer.uint32(10).fork()).ldelim();
|
|
255
|
+
}
|
|
256
|
+
if (message.end !== undefined) {
|
|
257
|
+
Vector3.encode(message.end, writer.uint32(18).fork()).ldelim();
|
|
258
|
+
}
|
|
259
|
+
return writer;
|
|
260
|
+
}
|
|
261
|
+
Scale.encode = encode;
|
|
262
|
+
function decode(input, length) {
|
|
263
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
264
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
265
|
+
const message = createBaseScale();
|
|
266
|
+
while (reader.pos < end) {
|
|
267
|
+
const tag = reader.uint32();
|
|
268
|
+
switch (tag >>> 3) {
|
|
269
|
+
case 1:
|
|
270
|
+
if (tag !== 10) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
message.start = Vector3.decode(reader, reader.uint32());
|
|
274
|
+
continue;
|
|
275
|
+
case 2:
|
|
276
|
+
if (tag !== 18) {
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
message.end = Vector3.decode(reader, reader.uint32());
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
reader.skipType(tag & 7);
|
|
286
|
+
}
|
|
287
|
+
return message;
|
|
288
|
+
}
|
|
289
|
+
Scale.decode = decode;
|
|
290
|
+
})(Scale || (Scale = {}));
|