@dcl/playground-assets 7.0.6-4006744889.commit-c6aff5f → 7.0.6-4009803567.commit-112733c
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/alpha.d.ts +0 -2
- package/dist/beta.d.ts +0 -2
- package/dist/index.bundled.d.ts +0 -2
- package/dist/index.js +70 -135
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/playground/sdk/apis.d.ts +1 -1
- package/dist/playground/sdk/dcl-sdk.package.json +16 -5
- package/dist/playground/snippets/billboard.ts +2 -7
- package/dist/playground/snippets/cube-spawner.ts +2 -13
- package/dist/playground/snippets/material.ts +1 -8
- package/dist/playground/snippets/mesh.ts +2 -9
- package/dist/playground/snippets/pointer-events.ts +1 -6
- package/dist/playground/snippets/raycast-hit-many.ts +4 -17
- package/dist/playground/snippets/raycast-hit.ts +3 -14
- package/dist/playground-assets.d.ts +0 -2
- package/etc/playground-assets.api.json +0 -33
- package/etc/playground-assets.api.md +0 -5
- package/package.json +3 -3
|
@@ -196,7 +196,7 @@ declare module "~system/EngineApi" {
|
|
|
196
196
|
export function subscribe(body: SubscribeRequest): Promise<SubscribeResponse>;
|
|
197
197
|
export function unsubscribe(body: UnsubscribeRequest): Promise<UnsubscribeResponse>;
|
|
198
198
|
export function crdtSendToRenderer(body: CrdtSendToRendererRequest): Promise<CrdtSendToResponse>;
|
|
199
|
-
export function crdtGetState(body: CrdtSendToRendererRequest): Promise<
|
|
199
|
+
export function crdtGetState(body: CrdtSendToRendererRequest): Promise<CrdtGetStateResponse>;
|
|
200
200
|
export function crdtGetMessageFromRenderer(body: CrdtMessageFromRendererRequest): Promise<CrdtMessageFromRendererResponse>;
|
|
201
201
|
|
|
202
202
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/sdk",
|
|
3
|
-
"version": "7.0.6-
|
|
3
|
+
"version": "7.0.6-4009803567.commit-112733c",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
@@ -24,17 +24,28 @@
|
|
|
24
24
|
"@dcl/ecs": "file:../ecs",
|
|
25
25
|
"@dcl/ecs-math": "2.0.1-20221129185242.commit-40495c1",
|
|
26
26
|
"@dcl/js-runtime": "file:../js-runtime",
|
|
27
|
-
"@dcl/kernel": "2.0.0-
|
|
27
|
+
"@dcl/kernel": "2.0.0-4009627050.commit-c973e59",
|
|
28
|
+
"@dcl/mini-comms": "1.0.0",
|
|
28
29
|
"@dcl/react-ecs": "file:../react-ecs",
|
|
29
|
-
"@dcl/
|
|
30
|
+
"@dcl/schemas": "5.14.0",
|
|
31
|
+
"@dcl/unity-renderer": "1.0.73994-20230125161151.commit-2e4047d",
|
|
32
|
+
"@types/inquirer": "^8.2.5",
|
|
33
|
+
"@well-known-components/env-config-provider": "^1.1.2-20220801195549.commit-101c273",
|
|
34
|
+
"@well-known-components/http-server": "^1.1.6-20220927190058.commit-2dfb235",
|
|
35
|
+
"@well-known-components/logger": "^3.0.0",
|
|
36
|
+
"@well-known-components/metrics": "^2.0.1-20220909150423.commit-8f7e5bc",
|
|
30
37
|
"arg": "5.0.2",
|
|
31
38
|
"extract-zip": "2.0.1",
|
|
32
39
|
"inquirer": "^8.2.5",
|
|
40
|
+
"node-fetch": "^2.6.8",
|
|
41
|
+
"open": "^8.4.0",
|
|
33
42
|
"ora": "6.1.2",
|
|
43
|
+
"portfinder": "^1.0.32",
|
|
34
44
|
"undici": "^5.14.0"
|
|
35
45
|
},
|
|
36
46
|
"devDependencies": {
|
|
37
|
-
"@types/
|
|
47
|
+
"@types/node-fetch": "^2.6.1",
|
|
48
|
+
"@types/ws": "^8.5.4"
|
|
38
49
|
},
|
|
39
50
|
"minCliVersion": "3.14.1",
|
|
40
51
|
"typedoc": {
|
|
@@ -43,5 +54,5 @@
|
|
|
43
54
|
"displayName": "SDK",
|
|
44
55
|
"tsconfig": "./tsconfig.json"
|
|
45
56
|
},
|
|
46
|
-
"commit": "
|
|
57
|
+
"commit": "112733c7745c97e809910baa08e09e73a09fb8e3"
|
|
47
58
|
}
|
|
@@ -79,11 +79,7 @@ function createTextShapes() {
|
|
|
79
79
|
const regularColor = Color4.create(1, 0.2, 0.8, 0.8)
|
|
80
80
|
const oppositeColor = Color4.create(0.8, 0.2, 1, 0.8)
|
|
81
81
|
|
|
82
|
-
createTextShape(
|
|
83
|
-
'Regular, only Y-rotation',
|
|
84
|
-
Vector3.create(8, 1, 1),
|
|
85
|
-
regularColor
|
|
86
|
-
)
|
|
82
|
+
createTextShape('Regular, only Y-rotation', Vector3.create(8, 1, 1), regularColor)
|
|
87
83
|
createTextShape('Regular', Vector3.create(12, 1, 1), regularColor)
|
|
88
84
|
createTextShape('Without billboard', Vector3.create(4, 1, 1), regularColor)
|
|
89
85
|
createTextShape('Opposite, only Y', Vector3.create(8, 1, 8), oppositeColor)
|
|
@@ -110,7 +106,6 @@ engine.addSystem((dt: number) => {
|
|
|
110
106
|
const bounce = BouncingBillboard.getMutable(entity)
|
|
111
107
|
bounce.t += dt
|
|
112
108
|
|
|
113
|
-
Transform.getMutable(entity).position.y =
|
|
114
|
-
bounce.originalPosition.y + 0.05 * Math.sin(10 * bounce.t)
|
|
109
|
+
Transform.getMutable(entity).position.y = bounce.originalPosition.y + 0.05 * Math.sin(10 * bounce.t)
|
|
115
110
|
}
|
|
116
111
|
})
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
engine,
|
|
4
|
-
pointerEventsSystem,
|
|
5
|
-
Transform,
|
|
6
|
-
MeshRenderer,
|
|
7
|
-
MeshCollider,
|
|
8
|
-
InputAction
|
|
9
|
-
} from '@dcl/sdk/ecs'
|
|
1
|
+
import { Entity, engine, pointerEventsSystem, Transform, MeshRenderer, MeshCollider, InputAction } from '@dcl/sdk/ecs'
|
|
10
2
|
import { Quaternion, Vector3 } from '@dcl/sdk/math'
|
|
11
3
|
|
|
12
4
|
// Cube factory
|
|
@@ -21,10 +13,7 @@ function createCube(x: number, y: number, z: number): Entity {
|
|
|
21
13
|
|
|
22
14
|
// Systems
|
|
23
15
|
function circularSystem(dt: number) {
|
|
24
|
-
const entitiesWithMeshRenderer = engine.getEntitiesWith(
|
|
25
|
-
MeshRenderer,
|
|
26
|
-
Transform
|
|
27
|
-
)
|
|
16
|
+
const entitiesWithMeshRenderer = engine.getEntitiesWith(MeshRenderer, Transform)
|
|
28
17
|
for (const [entity, _meshRenderer, _transform] of entitiesWithMeshRenderer) {
|
|
29
18
|
const mutableTransform = Transform.getMutable(entity)
|
|
30
19
|
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Entity,
|
|
3
|
-
engine,
|
|
4
|
-
Transform,
|
|
5
|
-
MeshRenderer,
|
|
6
|
-
Material,
|
|
7
|
-
MaterialTransparencyMode
|
|
8
|
-
} from '@dcl/sdk/ecs'
|
|
1
|
+
import { Entity, engine, Transform, MeshRenderer, Material, MaterialTransparencyMode } from '@dcl/sdk/ecs'
|
|
9
2
|
|
|
10
3
|
function createSphere(x: number, y: number, z: number): Entity {
|
|
11
4
|
const meshEntity = engine.addEntity()
|
|
@@ -7,13 +7,7 @@ enum Mesh {
|
|
|
7
7
|
CONE
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
function createMesh(
|
|
11
|
-
x: number,
|
|
12
|
-
y: number,
|
|
13
|
-
z: number,
|
|
14
|
-
mesh: Mesh,
|
|
15
|
-
withCollider: boolean = false
|
|
16
|
-
) {
|
|
10
|
+
function createMesh(x: number, y: number, z: number, mesh: Mesh, withCollider: boolean = false) {
|
|
17
11
|
const meshEntity = engine.addEntity()
|
|
18
12
|
Transform.create(meshEntity, { position: { x, y, z } })
|
|
19
13
|
|
|
@@ -22,8 +16,7 @@ function createMesh(
|
|
|
22
16
|
MeshRenderer.create(meshEntity, {
|
|
23
17
|
mesh: { $case: 'box', box: { uvs: [] } }
|
|
24
18
|
})
|
|
25
|
-
if (withCollider)
|
|
26
|
-
MeshCollider.create(meshEntity, { mesh: { $case: 'box', box: {} } })
|
|
19
|
+
if (withCollider) MeshCollider.create(meshEntity, { mesh: { $case: 'box', box: {} } })
|
|
27
20
|
break
|
|
28
21
|
case Mesh.SPHERE:
|
|
29
22
|
MeshRenderer.create(meshEntity, { mesh: { $case: 'sphere', sphere: {} } })
|
|
@@ -11,12 +11,7 @@ import {
|
|
|
11
11
|
} from '@dcl/sdk/ecs'
|
|
12
12
|
|
|
13
13
|
// Cube factory
|
|
14
|
-
function createCube(
|
|
15
|
-
x: number,
|
|
16
|
-
y: number,
|
|
17
|
-
z: number,
|
|
18
|
-
pointerEvents: PBPointerEvents_Entry[]
|
|
19
|
-
): Entity {
|
|
14
|
+
function createCube(x: number, y: number, z: number, pointerEvents: PBPointerEvents_Entry[]): Entity {
|
|
20
15
|
const meshEntity = engine.addEntity()
|
|
21
16
|
Transform.create(meshEntity, { position: { x, y, z } })
|
|
22
17
|
MeshRenderer.create(meshEntity, { mesh: { $case: 'box', box: { uvs: [] } } })
|
|
@@ -11,12 +11,7 @@ import {
|
|
|
11
11
|
} from '@dcl/sdk/ecs'
|
|
12
12
|
import { Vector3 } from '@dcl/sdk/math'
|
|
13
13
|
|
|
14
|
-
function createCube(
|
|
15
|
-
x: number,
|
|
16
|
-
y: number,
|
|
17
|
-
z: number,
|
|
18
|
-
scaleMultiplier: number = 1
|
|
19
|
-
) {
|
|
14
|
+
function createCube(x: number, y: number, z: number, scaleMultiplier: number = 1) {
|
|
20
15
|
const cubeEntity = engine.addEntity()
|
|
21
16
|
|
|
22
17
|
Transform.create(cubeEntity, {
|
|
@@ -56,22 +51,14 @@ pointerEventsSystem.onPointerDown(
|
|
|
56
51
|
let lastRaycastTimestamp = -1
|
|
57
52
|
engine.addSystem(() => {
|
|
58
53
|
for (const [_entity, result] of engine.getEntitiesWith(RaycastResult)) {
|
|
59
|
-
if (result.hits?.length === 0 || result.timestamp <= lastRaycastTimestamp)
|
|
60
|
-
continue
|
|
54
|
+
if (result.hits?.length === 0 || result.timestamp <= lastRaycastTimestamp) continue
|
|
61
55
|
lastRaycastTimestamp = result.timestamp
|
|
62
56
|
|
|
63
57
|
if (result.hits[0] && result.hits[0].position) {
|
|
64
|
-
createCube(
|
|
65
|
-
result.hits[0].position.x,
|
|
66
|
-
result.hits[0].position.y,
|
|
67
|
-
result.hits[0].position.z,
|
|
68
|
-
0.3
|
|
69
|
-
)
|
|
58
|
+
createCube(result.hits[0].position.x, result.hits[0].position.y, result.hits[0].position.z, 0.3)
|
|
70
59
|
}
|
|
71
60
|
|
|
72
|
-
console.log(
|
|
73
|
-
`Hits (this should be '2' the first time): '${result.hits.length}'`
|
|
74
|
-
)
|
|
61
|
+
console.log(`Hits (this should be '2' the first time): '${result.hits.length}'`)
|
|
75
62
|
}
|
|
76
63
|
})
|
|
77
64
|
|
|
@@ -11,12 +11,7 @@ import {
|
|
|
11
11
|
} from '@dcl/sdk/ecs'
|
|
12
12
|
import { Vector3 } from '@dcl/sdk/math'
|
|
13
13
|
|
|
14
|
-
function createCube(
|
|
15
|
-
x: number,
|
|
16
|
-
y: number,
|
|
17
|
-
z: number,
|
|
18
|
-
scaleMultiplier: number = 1
|
|
19
|
-
) {
|
|
14
|
+
function createCube(x: number, y: number, z: number, scaleMultiplier: number = 1) {
|
|
20
15
|
const cubeEntity = engine.addEntity()
|
|
21
16
|
|
|
22
17
|
Transform.create(cubeEntity, {
|
|
@@ -55,17 +50,11 @@ pointerEventsSystem.onPointerDown(
|
|
|
55
50
|
let lastRaycastTimestamp = -1
|
|
56
51
|
engine.addSystem(() => {
|
|
57
52
|
for (const [_entity, result] of engine.getEntitiesWith(RaycastResult)) {
|
|
58
|
-
if (result.hits?.length === 0 || result.timestamp <= lastRaycastTimestamp)
|
|
59
|
-
continue
|
|
53
|
+
if (result.hits?.length === 0 || result.timestamp <= lastRaycastTimestamp) continue
|
|
60
54
|
lastRaycastTimestamp = result.timestamp
|
|
61
55
|
|
|
62
56
|
if (result.hits[0] && result.hits[0].position) {
|
|
63
|
-
createCube(
|
|
64
|
-
result.hits[0].position.x,
|
|
65
|
-
result.hits[0].position.y,
|
|
66
|
-
result.hits[0].position.z,
|
|
67
|
-
0.3
|
|
68
|
-
)
|
|
57
|
+
createCube(result.hits[0].position.x, result.hits[0].position.y, result.hits[0].position.z, 0.3)
|
|
69
58
|
}
|
|
70
59
|
|
|
71
60
|
console.log(`Hits (this should be '1'): '${result.hits.length}'`)
|
|
@@ -2878,8 +2878,6 @@ export declare const onRealmChangedObservable: Observable<{
|
|
|
2878
2878
|
|
|
2879
2879
|
export declare const onSceneReadyObservable: Observable<unknown>;
|
|
2880
2880
|
|
|
2881
|
-
export declare function onStart(): Promise<void>;
|
|
2882
|
-
|
|
2883
2881
|
export declare function onUpdate(deltaTime: number): Promise<void>;
|
|
2884
2882
|
|
|
2885
2883
|
export declare const onVideoEvent: Observable<{
|
|
@@ -24809,39 +24809,6 @@
|
|
|
24809
24809
|
"endIndex": 3
|
|
24810
24810
|
}
|
|
24811
24811
|
},
|
|
24812
|
-
{
|
|
24813
|
-
"kind": "Function",
|
|
24814
|
-
"canonicalReference": "@dcl/playground-assets!onStart:function(1)",
|
|
24815
|
-
"docComment": "",
|
|
24816
|
-
"excerptTokens": [
|
|
24817
|
-
{
|
|
24818
|
-
"kind": "Content",
|
|
24819
|
-
"text": "export declare function onStart(): "
|
|
24820
|
-
},
|
|
24821
|
-
{
|
|
24822
|
-
"kind": "Reference",
|
|
24823
|
-
"text": "Promise",
|
|
24824
|
-
"canonicalReference": "!Promise:interface"
|
|
24825
|
-
},
|
|
24826
|
-
{
|
|
24827
|
-
"kind": "Content",
|
|
24828
|
-
"text": "<void>"
|
|
24829
|
-
},
|
|
24830
|
-
{
|
|
24831
|
-
"kind": "Content",
|
|
24832
|
-
"text": ";"
|
|
24833
|
-
}
|
|
24834
|
-
],
|
|
24835
|
-
"fileUrlPath": "../sdk/index.d.ts",
|
|
24836
|
-
"returnTypeTokenRange": {
|
|
24837
|
-
"startIndex": 1,
|
|
24838
|
-
"endIndex": 3
|
|
24839
|
-
},
|
|
24840
|
-
"releaseTag": "Public",
|
|
24841
|
-
"overloadIndex": 1,
|
|
24842
|
-
"parameters": [],
|
|
24843
|
-
"name": "onStart"
|
|
24844
|
-
},
|
|
24845
24812
|
{
|
|
24846
24813
|
"kind": "Function",
|
|
24847
24814
|
"canonicalReference": "@dcl/playground-assets!onUpdate:function(1)",
|
|
@@ -1573,11 +1573,6 @@ export const onRealmChangedObservable: Observable<{
|
|
|
1573
1573
|
// @public (undocumented)
|
|
1574
1574
|
export const onSceneReadyObservable: Observable<unknown>;
|
|
1575
1575
|
|
|
1576
|
-
// Warning: (ae-missing-release-tag) "onStart" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
|
1577
|
-
//
|
|
1578
|
-
// @public (undocumented)
|
|
1579
|
-
export function onStart(): Promise<void>;
|
|
1580
|
-
|
|
1581
1576
|
// Warning: (ae-missing-release-tag) "onUpdate" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
|
1582
1577
|
//
|
|
1583
1578
|
// @public (undocumented)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/playground-assets",
|
|
3
|
-
"version": "7.0.6-
|
|
3
|
+
"version": "7.0.6-4009803567.commit-112733c",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"author": "Decentraland",
|
|
18
18
|
"license": "Apache-2.0",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@dcl/sdk": "7.0.6-
|
|
20
|
+
"@dcl/sdk": "7.0.6-4009803567.commit-112733c"
|
|
21
21
|
},
|
|
22
22
|
"minCliVersion": "3.12.3",
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
25
|
"etc"
|
|
26
26
|
],
|
|
27
|
-
"commit": "
|
|
27
|
+
"commit": "112733c7745c97e809910baa08e09e73a09fb8e3"
|
|
28
28
|
}
|