@dcl/playground-assets 7.0.6-4006744889.commit-c6aff5f → 7.0.6-4009020955.commit-08722f5
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.js +60 -134
- package/dist/index.js.map +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/playground/sdk/dcl-sdk.package.json +14 -3
- 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/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/sdk",
|
|
3
|
-
"version": "7.0.6-
|
|
3
|
+
"version": "7.0.6-4009020955.commit-08722f5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
@@ -25,16 +25,27 @@
|
|
|
25
25
|
"@dcl/ecs-math": "2.0.1-20221129185242.commit-40495c1",
|
|
26
26
|
"@dcl/js-runtime": "file:../js-runtime",
|
|
27
27
|
"@dcl/kernel": "2.0.0-3766760530.commit-239d2a9",
|
|
28
|
+
"@dcl/mini-comms": "1.0.0",
|
|
28
29
|
"@dcl/react-ecs": "file:../react-ecs",
|
|
30
|
+
"@dcl/schemas": "5.14.0",
|
|
29
31
|
"@dcl/unity-renderer": "1.0.68557-20221221195847.commit-f743b85",
|
|
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": "08722f5fb9539e46f90cc94b5f9634ef0ef314ea"
|
|
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}'`)
|
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-4009020955.commit-08722f5",
|
|
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-4009020955.commit-08722f5"
|
|
21
21
|
},
|
|
22
22
|
"minCliVersion": "3.12.3",
|
|
23
23
|
"files": [
|
|
24
24
|
"dist",
|
|
25
25
|
"etc"
|
|
26
26
|
],
|
|
27
|
-
"commit": "
|
|
27
|
+
"commit": "08722f5fb9539e46f90cc94b5f9634ef0ef314ea"
|
|
28
28
|
}
|