@dcl/ecs 1.0.0-20220601102612.commit-8b31ac4 → 1.0.0-2448628808.commit-1a55b7a
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 +1676 -3
- package/dist/index.js +5815 -3
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/package.json +8 -5
- package/dist/Math.d.ts +0 -2
- package/dist/Math.js +0 -2
- package/dist/built-in-types/ArrayType.d.ts +0 -5
- package/dist/built-in-types/ArrayType.js +0 -21
- package/dist/built-in-types/EcsType.d.ts +0 -8
- package/dist/built-in-types/EcsType.js +0 -1
- package/dist/built-in-types/MapType.d.ts +0 -18
- package/dist/built-in-types/MapType.js +0 -22
- package/dist/built-in-types/Optional.d.ts +0 -5
- package/dist/built-in-types/Optional.js +0 -22
- package/dist/built-in-types/basic/Boolean.d.ts +0 -5
- package/dist/built-in-types/basic/Boolean.js +0 -11
- package/dist/built-in-types/basic/Enum.d.ts +0 -5
- package/dist/built-in-types/basic/Enum.js +0 -13
- package/dist/built-in-types/basic/Float.d.ts +0 -9
- package/dist/built-in-types/basic/Float.js +0 -22
- package/dist/built-in-types/basic/Integer.d.ts +0 -17
- package/dist/built-in-types/basic/Integer.js +0 -44
- package/dist/built-in-types/basic/String.d.ts +0 -9
- package/dist/built-in-types/basic/String.js +0 -15
- package/dist/built-in-types/index.d.ts +0 -9
- package/dist/built-in-types/index.js +0 -9
- package/dist/built-in-types/typing.d.ts +0 -16
- package/dist/built-in-types/typing.js +0 -1
- package/dist/components/generated/AudioSource.d.ts +0 -1
- package/dist/components/generated/AudioSource.js +0 -19
- package/dist/components/generated/AudioStream.d.ts +0 -1
- package/dist/components/generated/AudioStream.js +0 -19
- package/dist/components/generated/BoxShape.d.ts +0 -1
- package/dist/components/generated/BoxShape.js +0 -19
- package/dist/components/generated/CylinderShape.d.ts +0 -1
- package/dist/components/generated/CylinderShape.js +0 -19
- package/dist/components/generated/PlaneShape.d.ts +0 -1
- package/dist/components/generated/PlaneShape.js +0 -19
- package/dist/components/generated/SphereShape.d.ts +0 -1
- package/dist/components/generated/SphereShape.js +0 -19
- package/dist/components/generated/index.d.ts +0 -9
- package/dist/components/generated/index.js +0 -16
- package/dist/components/generated/pb/AudioSource.d.ts +0 -8
- package/dist/components/generated/pb/AudioSource.js +0 -74
- package/dist/components/generated/pb/AudioStream.d.ts +0 -5
- package/dist/components/generated/pb/AudioStream.js +0 -49
- package/dist/components/generated/pb/BoxShape.d.ts +0 -6
- package/dist/components/generated/pb/BoxShape.js +0 -70
- package/dist/components/generated/pb/CylinderShape.d.ts +0 -7
- package/dist/components/generated/pb/CylinderShape.js +0 -67
- package/dist/components/generated/pb/PlaneShape.d.ts +0 -6
- package/dist/components/generated/pb/PlaneShape.js +0 -70
- package/dist/components/generated/pb/SphereShape.d.ts +0 -5
- package/dist/components/generated/pb/SphereShape.js +0 -49
- package/dist/components/index.d.ts +0 -15
- package/dist/components/index.js +0 -7
- package/dist/components/legacy/Transform.d.ts +0 -14
- package/dist/components/legacy/Transform.js +0 -28
- package/dist/components/legacy/index.d.ts +0 -11
- package/dist/components/legacy/index.js +0 -9
- package/dist/components/legacy/types.d.ts +0 -51
- package/dist/components/legacy/types.js +0 -53
- package/dist/components/types.d.ts +0 -3
- package/dist/components/types.js +0 -4
- package/dist/engine/component.d.ts +0 -34
- package/dist/engine/component.js +0 -98
- package/dist/engine/entity-utils.d.ts +0 -7
- package/dist/engine/entity-utils.js +0 -18
- package/dist/engine/entity.d.ts +0 -20
- package/dist/engine/entity.js +0 -75
- package/dist/engine/index.d.ts +0 -11
- package/dist/engine/index.js +0 -132
- package/dist/engine/types.d.ts +0 -34
- package/dist/engine/types.js +0 -1
- package/dist/engine/utils.d.ts +0 -4
- package/dist/engine/utils.js +0 -11
- package/dist/proto-definitions/AudioSource.proto +0 -16
- package/dist/proto-definitions/AudioStream.proto +0 -13
- package/dist/proto-definitions/BoxShape.proto +0 -14
- package/dist/proto-definitions/CylinderShape.proto +0 -15
- package/dist/proto-definitions/PlaneShape.proto +0 -14
- package/dist/proto-definitions/README.md +0 -0
- package/dist/proto-definitions/SphereShape.proto +0 -13
- package/dist/proto-definitions/Transform.md +0 -23
- package/dist/serialization/ByteBuffer/index.d.ts +0 -130
- package/dist/serialization/ByteBuffer/index.js +0 -281
- package/dist/serialization/crdt/componentOperation.d.ts +0 -25
- package/dist/serialization/crdt/componentOperation.js +0 -39
- package/dist/serialization/wireMessage.d.ts +0 -39
- package/dist/serialization/wireMessage.js +0 -53
- package/dist/systems/crdt/index.d.ts +0 -6
- package/dist/systems/crdt/index.js +0 -147
- package/dist/systems/crdt/transport.d.ts +0 -8
- package/dist/systems/crdt/transport.js +0 -21
- package/dist/systems/crdt/types.d.ts +0 -10
- package/dist/systems/crdt/types.js +0 -1
- package/dist/systems/crdt/utils.d.ts +0 -11
- package/dist/systems/crdt/utils.js +0 -51
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import * as _m0 from "protobufjs/minimal";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export const protobufPackage = "decentraland.ecs";
|
|
7
|
-
function createBasePBAudioStream() {
|
|
8
|
-
return { playing: false, volume: 0, url: "" };
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export const PBAudioStream = {
|
|
14
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
15
|
-
if (message.playing === true) {
|
|
16
|
-
writer.uint32(8).bool(message.playing);
|
|
17
|
-
}
|
|
18
|
-
if (message.volume !== 0) {
|
|
19
|
-
writer.uint32(21).float(message.volume);
|
|
20
|
-
}
|
|
21
|
-
if (message.url !== "") {
|
|
22
|
-
writer.uint32(26).string(message.url);
|
|
23
|
-
}
|
|
24
|
-
return writer;
|
|
25
|
-
},
|
|
26
|
-
decode(input, length) {
|
|
27
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
28
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
|
-
const message = createBasePBAudioStream();
|
|
30
|
-
while (reader.pos < end) {
|
|
31
|
-
const tag = reader.uint32();
|
|
32
|
-
switch (tag >>> 3) {
|
|
33
|
-
case 1:
|
|
34
|
-
message.playing = reader.bool();
|
|
35
|
-
break;
|
|
36
|
-
case 2:
|
|
37
|
-
message.volume = reader.float();
|
|
38
|
-
break;
|
|
39
|
-
case 3:
|
|
40
|
-
message.url = reader.string();
|
|
41
|
-
break;
|
|
42
|
-
default:
|
|
43
|
-
reader.skipType(tag & 7);
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return message;
|
|
48
|
-
},
|
|
49
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import * as _m0 from "protobufjs/minimal";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export const protobufPackage = "decentraland.ecs";
|
|
7
|
-
function createBasePBBoxShape() {
|
|
8
|
-
return {
|
|
9
|
-
withCollisions: false,
|
|
10
|
-
isPointerBlocker: false,
|
|
11
|
-
visible: false,
|
|
12
|
-
uvs: [],
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export const PBBoxShape = {
|
|
19
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
20
|
-
if (message.withCollisions === true) {
|
|
21
|
-
writer.uint32(8).bool(message.withCollisions);
|
|
22
|
-
}
|
|
23
|
-
if (message.isPointerBlocker === true) {
|
|
24
|
-
writer.uint32(16).bool(message.isPointerBlocker);
|
|
25
|
-
}
|
|
26
|
-
if (message.visible === true) {
|
|
27
|
-
writer.uint32(24).bool(message.visible);
|
|
28
|
-
}
|
|
29
|
-
writer.uint32(34).fork();
|
|
30
|
-
for (const v of message.uvs) {
|
|
31
|
-
writer.float(v);
|
|
32
|
-
}
|
|
33
|
-
writer.ldelim();
|
|
34
|
-
return writer;
|
|
35
|
-
},
|
|
36
|
-
decode(input, length) {
|
|
37
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
38
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
39
|
-
const message = createBasePBBoxShape();
|
|
40
|
-
while (reader.pos < end) {
|
|
41
|
-
const tag = reader.uint32();
|
|
42
|
-
switch (tag >>> 3) {
|
|
43
|
-
case 1:
|
|
44
|
-
message.withCollisions = reader.bool();
|
|
45
|
-
break;
|
|
46
|
-
case 2:
|
|
47
|
-
message.isPointerBlocker = reader.bool();
|
|
48
|
-
break;
|
|
49
|
-
case 3:
|
|
50
|
-
message.visible = reader.bool();
|
|
51
|
-
break;
|
|
52
|
-
case 4:
|
|
53
|
-
if ((tag & 7) === 2) {
|
|
54
|
-
const end2 = reader.uint32() + reader.pos;
|
|
55
|
-
while (reader.pos < end2) {
|
|
56
|
-
message.uvs.push(reader.float());
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
message.uvs.push(reader.float());
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
default:
|
|
64
|
-
reader.skipType(tag & 7);
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return message;
|
|
69
|
-
},
|
|
70
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import * as _m0 from "protobufjs/minimal";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export const protobufPackage = "decentraland.ecs";
|
|
7
|
-
function createBasePBCylinderShape() {
|
|
8
|
-
return {
|
|
9
|
-
withCollisions: false,
|
|
10
|
-
isPointerBlocker: false,
|
|
11
|
-
visible: false,
|
|
12
|
-
radiusTop: 0,
|
|
13
|
-
radiusBottom: 0,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export const PBCylinderShape = {
|
|
20
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
21
|
-
if (message.withCollisions === true) {
|
|
22
|
-
writer.uint32(8).bool(message.withCollisions);
|
|
23
|
-
}
|
|
24
|
-
if (message.isPointerBlocker === true) {
|
|
25
|
-
writer.uint32(16).bool(message.isPointerBlocker);
|
|
26
|
-
}
|
|
27
|
-
if (message.visible === true) {
|
|
28
|
-
writer.uint32(24).bool(message.visible);
|
|
29
|
-
}
|
|
30
|
-
if (message.radiusTop !== 0) {
|
|
31
|
-
writer.uint32(37).float(message.radiusTop);
|
|
32
|
-
}
|
|
33
|
-
if (message.radiusBottom !== 0) {
|
|
34
|
-
writer.uint32(45).float(message.radiusBottom);
|
|
35
|
-
}
|
|
36
|
-
return writer;
|
|
37
|
-
},
|
|
38
|
-
decode(input, length) {
|
|
39
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
40
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
41
|
-
const message = createBasePBCylinderShape();
|
|
42
|
-
while (reader.pos < end) {
|
|
43
|
-
const tag = reader.uint32();
|
|
44
|
-
switch (tag >>> 3) {
|
|
45
|
-
case 1:
|
|
46
|
-
message.withCollisions = reader.bool();
|
|
47
|
-
break;
|
|
48
|
-
case 2:
|
|
49
|
-
message.isPointerBlocker = reader.bool();
|
|
50
|
-
break;
|
|
51
|
-
case 3:
|
|
52
|
-
message.visible = reader.bool();
|
|
53
|
-
break;
|
|
54
|
-
case 4:
|
|
55
|
-
message.radiusTop = reader.float();
|
|
56
|
-
break;
|
|
57
|
-
case 5:
|
|
58
|
-
message.radiusBottom = reader.float();
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
reader.skipType(tag & 7);
|
|
62
|
-
break;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return message;
|
|
66
|
-
},
|
|
67
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import * as _m0 from "protobufjs/minimal";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export const protobufPackage = "decentraland.ecs";
|
|
7
|
-
function createBasePBPlaneShape() {
|
|
8
|
-
return {
|
|
9
|
-
withCollisions: false,
|
|
10
|
-
isPointerBlocker: false,
|
|
11
|
-
visible: false,
|
|
12
|
-
uvs: [],
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export const PBPlaneShape = {
|
|
19
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
20
|
-
if (message.withCollisions === true) {
|
|
21
|
-
writer.uint32(8).bool(message.withCollisions);
|
|
22
|
-
}
|
|
23
|
-
if (message.isPointerBlocker === true) {
|
|
24
|
-
writer.uint32(16).bool(message.isPointerBlocker);
|
|
25
|
-
}
|
|
26
|
-
if (message.visible === true) {
|
|
27
|
-
writer.uint32(24).bool(message.visible);
|
|
28
|
-
}
|
|
29
|
-
writer.uint32(34).fork();
|
|
30
|
-
for (const v of message.uvs) {
|
|
31
|
-
writer.float(v);
|
|
32
|
-
}
|
|
33
|
-
writer.ldelim();
|
|
34
|
-
return writer;
|
|
35
|
-
},
|
|
36
|
-
decode(input, length) {
|
|
37
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
38
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
39
|
-
const message = createBasePBPlaneShape();
|
|
40
|
-
while (reader.pos < end) {
|
|
41
|
-
const tag = reader.uint32();
|
|
42
|
-
switch (tag >>> 3) {
|
|
43
|
-
case 1:
|
|
44
|
-
message.withCollisions = reader.bool();
|
|
45
|
-
break;
|
|
46
|
-
case 2:
|
|
47
|
-
message.isPointerBlocker = reader.bool();
|
|
48
|
-
break;
|
|
49
|
-
case 3:
|
|
50
|
-
message.visible = reader.bool();
|
|
51
|
-
break;
|
|
52
|
-
case 4:
|
|
53
|
-
if ((tag & 7) === 2) {
|
|
54
|
-
const end2 = reader.uint32() + reader.pos;
|
|
55
|
-
while (reader.pos < end2) {
|
|
56
|
-
message.uvs.push(reader.float());
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
message.uvs.push(reader.float());
|
|
61
|
-
}
|
|
62
|
-
break;
|
|
63
|
-
default:
|
|
64
|
-
reader.skipType(tag & 7);
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return message;
|
|
69
|
-
},
|
|
70
|
-
};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import * as _m0 from "protobufjs/minimal";
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export const protobufPackage = "decentraland.ecs";
|
|
7
|
-
function createBasePBSphereShape() {
|
|
8
|
-
return { withCollisions: false, isPointerBlocker: false, visible: false };
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export const PBSphereShape = {
|
|
14
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
15
|
-
if (message.withCollisions === true) {
|
|
16
|
-
writer.uint32(8).bool(message.withCollisions);
|
|
17
|
-
}
|
|
18
|
-
if (message.isPointerBlocker === true) {
|
|
19
|
-
writer.uint32(16).bool(message.isPointerBlocker);
|
|
20
|
-
}
|
|
21
|
-
if (message.visible === true) {
|
|
22
|
-
writer.uint32(24).bool(message.visible);
|
|
23
|
-
}
|
|
24
|
-
return writer;
|
|
25
|
-
},
|
|
26
|
-
decode(input, length) {
|
|
27
|
-
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
|
28
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
29
|
-
const message = createBasePBSphereShape();
|
|
30
|
-
while (reader.pos < end) {
|
|
31
|
-
const tag = reader.uint32();
|
|
32
|
-
switch (tag >>> 3) {
|
|
33
|
-
case 1:
|
|
34
|
-
message.withCollisions = reader.bool();
|
|
35
|
-
break;
|
|
36
|
-
case 2:
|
|
37
|
-
message.isPointerBlocker = reader.bool();
|
|
38
|
-
break;
|
|
39
|
-
case 3:
|
|
40
|
-
message.visible = reader.bool();
|
|
41
|
-
break;
|
|
42
|
-
default:
|
|
43
|
-
reader.skipType(tag & 7);
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return message;
|
|
48
|
-
},
|
|
49
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { IEngine } from '../engine/types';
|
|
2
|
-
export * from './types';
|
|
3
|
-
export declare function defineSdkComponents(engine: Pick<IEngine, 'defineComponent'>): {
|
|
4
|
-
AudioSource: import("..").ComponentDefinition<import("..").EcsType<import("./generated/pb/AudioSource").PBAudioSource>>;
|
|
5
|
-
AudioStream: import("..").ComponentDefinition<import("..").EcsType<import("./generated/pb/AudioStream").PBAudioStream>>;
|
|
6
|
-
BoxShape: import("..").ComponentDefinition<import("..").EcsType<import("./generated/pb/BoxShape").PBBoxShape>>;
|
|
7
|
-
CylinderShape: import("..").ComponentDefinition<import("..").EcsType<import("./generated/pb/CylinderShape").PBCylinderShape>>;
|
|
8
|
-
PlaneShape: import("..").ComponentDefinition<import("..").EcsType<import("./generated/pb/PlaneShape").PBPlaneShape>>;
|
|
9
|
-
SphereShape: import("..").ComponentDefinition<import("..").EcsType<import("./generated/pb/SphereShape").PBSphereShape>>;
|
|
10
|
-
Transform: import("..").ComponentDefinition<import("..").EcsType<import("./legacy/Transform").Transform>>;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
*/
|
|
15
|
-
export declare type SdkComponetns = ReturnType<typeof defineSdkComponents>;
|
package/dist/components/index.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Quaternion, Vector3 } from '../../Math';
|
|
2
|
-
import type { EcsType } from '../../built-in-types/EcsType';
|
|
3
|
-
import { Entity } from '../../engine/entity';
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export declare type Transform = {
|
|
8
|
-
position: Vector3.MutableVector3;
|
|
9
|
-
rotation: Quaternion.MutableQuaternion;
|
|
10
|
-
scale: Vector3.MutableVector3;
|
|
11
|
-
parent?: Entity;
|
|
12
|
-
};
|
|
13
|
-
export declare const TRANSFORM_LENGTH = 44;
|
|
14
|
-
export declare const Transform: EcsType<Transform>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Quaternion, Vector3 } from '../../Math';
|
|
2
|
-
export const TRANSFORM_LENGTH = 44;
|
|
3
|
-
// This transform can be optimized with Float32Array for example
|
|
4
|
-
export const Transform = {
|
|
5
|
-
serialize(value, builder) {
|
|
6
|
-
const ptr = builder.incrementWriteOffset(TRANSFORM_LENGTH);
|
|
7
|
-
builder.setFloat32(ptr, value.position.x);
|
|
8
|
-
builder.setFloat32(ptr + 4, value.position.y);
|
|
9
|
-
builder.setFloat32(ptr + 8, value.position.z);
|
|
10
|
-
builder.setFloat32(ptr + 12, value.rotation.x);
|
|
11
|
-
builder.setFloat32(ptr + 16, value.rotation.y);
|
|
12
|
-
builder.setFloat32(ptr + 20, value.rotation.z);
|
|
13
|
-
builder.setFloat32(ptr + 24, value.rotation.w);
|
|
14
|
-
builder.setFloat32(ptr + 28, value.scale.x);
|
|
15
|
-
builder.setFloat32(ptr + 32, value.scale.y);
|
|
16
|
-
builder.setFloat32(ptr + 36, value.scale.z);
|
|
17
|
-
builder.setUint32(ptr + 40, value.parent || 0);
|
|
18
|
-
},
|
|
19
|
-
deserialize(reader) {
|
|
20
|
-
const ptr = reader.incrementReadOffset(TRANSFORM_LENGTH);
|
|
21
|
-
return {
|
|
22
|
-
position: Vector3.create(reader.getFloat32(ptr), reader.getFloat32(ptr + 4), reader.getFloat32(ptr + 8)),
|
|
23
|
-
rotation: Quaternion.create(reader.getFloat32(ptr + 12), reader.getFloat32(ptr + 16), reader.getFloat32(ptr + 20), reader.getFloat32(ptr + 24)),
|
|
24
|
-
scale: Vector3.create(reader.getFloat32(ptr + 28), reader.getFloat32(ptr + 32), reader.getFloat32(ptr + 36)),
|
|
25
|
-
parent: reader.getUint32(ptr + 40)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { IEngine } from '../../engine/types';
|
|
2
|
-
import { Transform as LegacyTransform } from './Transform';
|
|
3
|
-
export declare function defineLegacyComponents({ defineComponent }: Pick<IEngine, 'defineComponent'>): {
|
|
4
|
-
AudioSource: import("../..").ComponentDefinition<import("../..").EcsType<import("../generated/pb/AudioSource").PBAudioSource>>;
|
|
5
|
-
AudioStream: import("../..").ComponentDefinition<import("../..").EcsType<import("../generated/pb/AudioStream").PBAudioStream>>;
|
|
6
|
-
BoxShape: import("../..").ComponentDefinition<import("../..").EcsType<import("../generated/pb/BoxShape").PBBoxShape>>;
|
|
7
|
-
CylinderShape: import("../..").ComponentDefinition<import("../..").EcsType<import("../generated/pb/CylinderShape").PBCylinderShape>>;
|
|
8
|
-
PlaneShape: import("../..").ComponentDefinition<import("../..").EcsType<import("../generated/pb/PlaneShape").PBPlaneShape>>;
|
|
9
|
-
SphereShape: import("../..").ComponentDefinition<import("../..").EcsType<import("../generated/pb/SphereShape").PBSphereShape>>;
|
|
10
|
-
Transform: import("../..").ComponentDefinition<import("../..").EcsType<LegacyTransform>>;
|
|
11
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineProtocolBufferComponents } from '../generated/index';
|
|
2
|
-
import { Transform as LegacyTransform } from './Transform';
|
|
3
|
-
import { LEGACY_COMPONENT_ID as ID } from './types';
|
|
4
|
-
export function defineLegacyComponents({ defineComponent }) {
|
|
5
|
-
return {
|
|
6
|
-
Transform: defineComponent(ID.TRANSFORM, LegacyTransform),
|
|
7
|
-
...defineProtocolBufferComponents({ defineComponent })
|
|
8
|
-
};
|
|
9
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export declare enum LEGACY_COMPONENT_ID {
|
|
5
|
-
TRANSFORM = 1,
|
|
6
|
-
UUID_CALLBACK = 8,
|
|
7
|
-
BOX_SHAPE = 16,
|
|
8
|
-
SPHERE_SHAPE = 17,
|
|
9
|
-
PLANE_SHAPE = 18,
|
|
10
|
-
CONE_SHAPE = 19,
|
|
11
|
-
CYLINDER_SHAPE = 20,
|
|
12
|
-
TEXT_SHAPE = 21,
|
|
13
|
-
NFT_SHAPE = 22,
|
|
14
|
-
UI_WORLD_SPACE_SHAPE = 23,
|
|
15
|
-
UI_SCREEN_SPACE_SHAPE = 24,
|
|
16
|
-
UI_CONTAINER_RECT = 25,
|
|
17
|
-
UI_CONTAINER_STACK = 26,
|
|
18
|
-
UI_TEXT_SHAPE = 27,
|
|
19
|
-
UI_INPUT_TEXT_SHAPE = 28,
|
|
20
|
-
UI_IMAGE_SHAPE = 29,
|
|
21
|
-
UI_SLIDER_SHAPE = 30,
|
|
22
|
-
CIRCLE_SHAPE = 31,
|
|
23
|
-
BILLBOARD = 32,
|
|
24
|
-
ANIMATION = 33,
|
|
25
|
-
FONT = 34,
|
|
26
|
-
UI_FULLSCREEN_SHAPE = 40,
|
|
27
|
-
UI_BUTTON_SHAPE = 41,
|
|
28
|
-
GLTF_SHAPE = 54,
|
|
29
|
-
OBJ_SHAPE = 55,
|
|
30
|
-
AVATAR_SHAPE = 56,
|
|
31
|
-
BASIC_MATERIAL = 64,
|
|
32
|
-
PBR_MATERIAL = 65,
|
|
33
|
-
HIGHLIGHT_ENTITY = 66,
|
|
34
|
-
/** @deprecated Sound has been deprecataed */
|
|
35
|
-
SOUND = 67,
|
|
36
|
-
TEXTURE = 68,
|
|
37
|
-
VIDEO_CLIP = 70,
|
|
38
|
-
VIDEO_TEXTURE = 71,
|
|
39
|
-
AVATAR_TEXTURE = 72,
|
|
40
|
-
AUDIO_CLIP = 200,
|
|
41
|
-
AUDIO_SOURCE = 201,
|
|
42
|
-
AUDIO_STREAM = 202,
|
|
43
|
-
GIZMOS = 203,
|
|
44
|
-
SMART_ITEM = 204,
|
|
45
|
-
AVATAR_MODIFIER_AREA = 205,
|
|
46
|
-
AVATAR_ATTACH = 206,
|
|
47
|
-
CAMERA_MODE_AREA = 207,
|
|
48
|
-
NAME = 300,
|
|
49
|
-
LOCKED_ON_EDIT = 301,
|
|
50
|
-
VISIBLE_ON_EDIT = 302
|
|
51
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @public
|
|
3
|
-
*/
|
|
4
|
-
export var LEGACY_COMPONENT_ID;
|
|
5
|
-
(function (LEGACY_COMPONENT_ID) {
|
|
6
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["TRANSFORM"] = 1] = "TRANSFORM";
|
|
7
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UUID_CALLBACK"] = 8] = "UUID_CALLBACK";
|
|
8
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["BOX_SHAPE"] = 16] = "BOX_SHAPE";
|
|
9
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["SPHERE_SHAPE"] = 17] = "SPHERE_SHAPE";
|
|
10
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["PLANE_SHAPE"] = 18] = "PLANE_SHAPE";
|
|
11
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CONE_SHAPE"] = 19] = "CONE_SHAPE";
|
|
12
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CYLINDER_SHAPE"] = 20] = "CYLINDER_SHAPE";
|
|
13
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["TEXT_SHAPE"] = 21] = "TEXT_SHAPE";
|
|
14
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["NFT_SHAPE"] = 22] = "NFT_SHAPE";
|
|
15
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_WORLD_SPACE_SHAPE"] = 23] = "UI_WORLD_SPACE_SHAPE";
|
|
16
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_SCREEN_SPACE_SHAPE"] = 24] = "UI_SCREEN_SPACE_SHAPE";
|
|
17
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_CONTAINER_RECT"] = 25] = "UI_CONTAINER_RECT";
|
|
18
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_CONTAINER_STACK"] = 26] = "UI_CONTAINER_STACK";
|
|
19
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_TEXT_SHAPE"] = 27] = "UI_TEXT_SHAPE";
|
|
20
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_INPUT_TEXT_SHAPE"] = 28] = "UI_INPUT_TEXT_SHAPE";
|
|
21
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_IMAGE_SHAPE"] = 29] = "UI_IMAGE_SHAPE";
|
|
22
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_SLIDER_SHAPE"] = 30] = "UI_SLIDER_SHAPE";
|
|
23
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CIRCLE_SHAPE"] = 31] = "CIRCLE_SHAPE";
|
|
24
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["BILLBOARD"] = 32] = "BILLBOARD";
|
|
25
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["ANIMATION"] = 33] = "ANIMATION";
|
|
26
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["FONT"] = 34] = "FONT";
|
|
27
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_FULLSCREEN_SHAPE"] = 40] = "UI_FULLSCREEN_SHAPE";
|
|
28
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["UI_BUTTON_SHAPE"] = 41] = "UI_BUTTON_SHAPE";
|
|
29
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["GLTF_SHAPE"] = 54] = "GLTF_SHAPE";
|
|
30
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["OBJ_SHAPE"] = 55] = "OBJ_SHAPE";
|
|
31
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_SHAPE"] = 56] = "AVATAR_SHAPE";
|
|
32
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["BASIC_MATERIAL"] = 64] = "BASIC_MATERIAL";
|
|
33
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["PBR_MATERIAL"] = 65] = "PBR_MATERIAL";
|
|
34
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["HIGHLIGHT_ENTITY"] = 66] = "HIGHLIGHT_ENTITY";
|
|
35
|
-
/** @deprecated Sound has been deprecataed */
|
|
36
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["SOUND"] = 67] = "SOUND";
|
|
37
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["TEXTURE"] = 68] = "TEXTURE";
|
|
38
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["VIDEO_CLIP"] = 70] = "VIDEO_CLIP";
|
|
39
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["VIDEO_TEXTURE"] = 71] = "VIDEO_TEXTURE";
|
|
40
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_TEXTURE"] = 72] = "AVATAR_TEXTURE";
|
|
41
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AUDIO_CLIP"] = 200] = "AUDIO_CLIP";
|
|
42
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AUDIO_SOURCE"] = 201] = "AUDIO_SOURCE";
|
|
43
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AUDIO_STREAM"] = 202] = "AUDIO_STREAM";
|
|
44
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["GIZMOS"] = 203] = "GIZMOS";
|
|
45
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["SMART_ITEM"] = 204] = "SMART_ITEM";
|
|
46
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_MODIFIER_AREA"] = 205] = "AVATAR_MODIFIER_AREA";
|
|
47
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["AVATAR_ATTACH"] = 206] = "AVATAR_ATTACH";
|
|
48
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["CAMERA_MODE_AREA"] = 207] = "CAMERA_MODE_AREA";
|
|
49
|
-
// For state sync only
|
|
50
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["NAME"] = 300] = "NAME";
|
|
51
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["LOCKED_ON_EDIT"] = 301] = "LOCKED_ON_EDIT";
|
|
52
|
-
LEGACY_COMPONENT_ID[LEGACY_COMPONENT_ID["VISIBLE_ON_EDIT"] = 302] = "VISIBLE_ON_EDIT";
|
|
53
|
-
})(LEGACY_COMPONENT_ID || (LEGACY_COMPONENT_ID = {}));
|
package/dist/components/types.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { EcsType } from '../built-in-types/EcsType';
|
|
2
|
-
import { ByteBuffer } from '../serialization/ByteBuffer';
|
|
3
|
-
import { Entity } from './entity';
|
|
4
|
-
import { DeepReadonly } from './utils';
|
|
5
|
-
/**
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export declare type EcsResult<T extends EcsType> = T extends EcsType ? ReturnType<T['deserialize']> : never;
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export declare type ComponentType<T extends EcsType> = EcsResult<T>;
|
|
13
|
-
/**
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export declare type ComponentDefinition<T extends EcsType = EcsType<any>> = {
|
|
17
|
-
_id: number;
|
|
18
|
-
has(entity: Entity): boolean;
|
|
19
|
-
getFrom(entity: Entity): DeepReadonly<ComponentType<T>>;
|
|
20
|
-
getOrNull(entity: Entity): DeepReadonly<ComponentType<T>> | null;
|
|
21
|
-
create(entity: Entity, val: ComponentType<T>): ComponentType<T>;
|
|
22
|
-
mutable(entity: Entity): ComponentType<T>;
|
|
23
|
-
createOrReplace(entity: Entity, val: ComponentType<T>): ComponentType<T>;
|
|
24
|
-
deleteFrom(entity: Entity): ComponentType<T> | null;
|
|
25
|
-
upsertFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
|
|
26
|
-
updateFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
|
|
27
|
-
toBinary(entity: Entity): ByteBuffer;
|
|
28
|
-
writeToByteBuffer(entity: Entity, buffer: ByteBuffer): void;
|
|
29
|
-
iterator(): Iterable<[Entity, ComponentType<T>]>;
|
|
30
|
-
dirtyIterator(): Iterable<Entity>;
|
|
31
|
-
clearDirty(): void;
|
|
32
|
-
isDirty(entity: Entity): boolean;
|
|
33
|
-
};
|
|
34
|
-
export declare function defineComponent<T extends EcsType>(componentId: number, spec: T): ComponentDefinition<T>;
|