@dcl/protocol 1.0.0-4468031496.commit-eace17b → 1.0.0-4493564897.commit-c858f8a
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/out-js/decentraland/sdk/components/common/camera_type.gen.d.ts +2 -0
- package/out-js/decentraland/sdk/components/common/camera_type.gen.js +7 -0
- package/out-js/decentraland/sdk/components/common/camera_type.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/common/input_action.gen.d.ts +10 -0
- package/out-js/decentraland/sdk/components/common/input_action.gen.js +47 -1
- package/out-js/decentraland/sdk/components/common/input_action.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/common/raycast_hit.gen.d.ts +173 -0
- package/out-js/decentraland/sdk/components/common/raycast_hit.gen.js +156 -0
- package/out-js/decentraland/sdk/components/common/raycast_hit.gen.js.map +1 -0
- package/out-js/decentraland/sdk/components/mesh_collider.gen.d.ts +16 -1
- package/out-js/decentraland/sdk/components/mesh_collider.gen.js +86 -1
- package/out-js/decentraland/sdk/components/mesh_collider.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/pointer_events.gen.d.ts +1 -11
- package/out-js/decentraland/sdk/components/pointer_events.gen.js +3 -49
- package/out-js/decentraland/sdk/components/pointer_events.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/pointer_events_result.gen.d.ts +10 -11
- package/out-js/decentraland/sdk/components/pointer_events_result.gen.js +10 -11
- package/out-js/decentraland/sdk/components/pointer_events_result.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/raycast.gen.d.ts +239 -38
- package/out-js/decentraland/sdk/components/raycast.gen.js +145 -20
- package/out-js/decentraland/sdk/components/raycast.gen.js.map +1 -1
- package/out-js/decentraland/sdk/components/raycast_result.gen.d.ts +26 -176
- package/out-js/decentraland/sdk/components/raycast_result.gen.js +21 -186
- package/out-js/decentraland/sdk/components/raycast_result.gen.js.map +1 -1
- package/out-ts/decentraland/sdk/components/common/camera_type.gen.ts +7 -0
- package/out-ts/decentraland/sdk/components/common/input_action.gen.ts +46 -0
- package/out-ts/decentraland/sdk/components/common/raycast_hit.gen.ts +204 -0
- package/out-ts/decentraland/sdk/components/mesh_collider.gen.ts +86 -1
- package/out-ts/decentraland/sdk/components/pointer_events.gen.ts +8 -47
- package/out-ts/decentraland/sdk/components/pointer_events_result.gen.ts +11 -5
- package/out-ts/decentraland/sdk/components/raycast.gen.ts +180 -26
- package/out-ts/decentraland/sdk/components/raycast_result.gen.ts +24 -232
- package/package.json +2 -2
- package/proto/decentraland/sdk/components/common/camera_type.proto +1 -0
- package/proto/decentraland/sdk/components/common/input_action.proto +8 -0
- package/proto/decentraland/sdk/components/common/raycast_hit.proto +16 -0
- package/proto/decentraland/sdk/components/mesh_collider.proto +17 -3
- package/proto/decentraland/sdk/components/pointer_events.proto +1 -9
- package/proto/decentraland/sdk/components/pointer_events_result.proto +5 -6
- package/proto/decentraland/sdk/components/raycast.proto +39 -4
- package/proto/decentraland/sdk/components/raycast_result.proto +9 -19
|
@@ -42,7 +42,21 @@ message PBMeshCollider {
|
|
|
42
42
|
|
|
43
43
|
// ColliderLayer determines the kind of collision to detect, in OR-able bit flag form.
|
|
44
44
|
enum ColliderLayer {
|
|
45
|
-
CL_NONE = 0;
|
|
46
|
-
CL_POINTER = 1;
|
|
47
|
-
CL_PHYSICS = 2;
|
|
45
|
+
CL_NONE = 0; // no collisions
|
|
46
|
+
CL_POINTER = 1; // collisions with the player's pointer ray (e.g. mouse cursor hovering)
|
|
47
|
+
CL_PHYSICS = 2; // collision affecting your player's physics i.e. walls, floor, moving platfroms
|
|
48
|
+
CL_VISIBLE_MESHES = 4; // all visible meshes, use with extreme care since the performance penalty is high
|
|
49
|
+
CL_RESERVED2 = 8;
|
|
50
|
+
CL_RESERVED3 = 16;
|
|
51
|
+
CL_RESERVED4 = 32;
|
|
52
|
+
CL_RESERVED5 = 64;
|
|
53
|
+
CL_RESERVED6 = 128;
|
|
54
|
+
CL_CUSTOM1 = 256;
|
|
55
|
+
CL_CUSTOM2 = 512;
|
|
56
|
+
CL_CUSTOM3 = 1024;
|
|
57
|
+
CL_CUSTOM4 = 2048;
|
|
58
|
+
CL_CUSTOM5 = 4096;
|
|
59
|
+
CL_CUSTOM6 = 8192;
|
|
60
|
+
CL_CUSTOM7 = 16384;
|
|
61
|
+
CL_CUSTOM8 = 32768;
|
|
48
62
|
}
|
|
@@ -29,17 +29,9 @@ message PBPointerEvents {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
message Entry {
|
|
32
|
-
PointerEventType event_type = 1; // the kind of interaction to detect
|
|
32
|
+
common.PointerEventType event_type = 1; // the kind of interaction to detect
|
|
33
33
|
Info event_info = 2; // additional configuration for this detection
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
repeated Entry pointer_events = 1; // the list of relevant events to detect
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
// PointerEventType is a kind of interaction that can be detected.
|
|
40
|
-
enum PointerEventType {
|
|
41
|
-
PET_UP = 0;
|
|
42
|
-
PET_DOWN = 1;
|
|
43
|
-
PET_HOVER_ENTER = 2;
|
|
44
|
-
PET_HOVER_LEAVE = 3;
|
|
45
|
-
}
|
|
@@ -4,16 +4,15 @@ package decentraland.sdk.components;
|
|
|
4
4
|
|
|
5
5
|
import "decentraland/sdk/components/common/id.proto";
|
|
6
6
|
import "decentraland/sdk/components/common/input_action.proto";
|
|
7
|
-
import "decentraland/sdk/components/
|
|
8
|
-
import "decentraland/sdk/components/raycast_result.proto";
|
|
7
|
+
import "decentraland/sdk/components/common/raycast_hit.proto";
|
|
9
8
|
|
|
10
9
|
option (common.ecs_component_id) = 1063;
|
|
11
10
|
|
|
12
11
|
// renderer append a new object of this in each command, there can be many commands per frames
|
|
13
12
|
message PBPointerEventsResult {
|
|
14
13
|
common.InputAction button = 1; // identifier of the input
|
|
15
|
-
RaycastHit hit = 2;
|
|
16
|
-
PointerEventType state = 4;
|
|
17
|
-
|
|
18
|
-
optional float analog = 6;
|
|
14
|
+
common.RaycastHit hit = 2;
|
|
15
|
+
common.PointerEventType state = 4;
|
|
16
|
+
uint32 timestamp = 5; // could be a Lamport timestamp
|
|
17
|
+
optional float analog = 6; // if the input is analog then we store it here
|
|
19
18
|
}
|
|
@@ -7,17 +7,52 @@ import "decentraland/sdk/components/common/id.proto";
|
|
|
7
7
|
|
|
8
8
|
option (common.ecs_component_id) = 1067;
|
|
9
9
|
|
|
10
|
+
// The PBRaycast component and PBRaycastResult are defined in https://adr.decentraland.org/adr/ADR-200
|
|
11
|
+
//
|
|
10
12
|
// The Raycast component allows scenes to request raycasting from the game engine. The results will
|
|
11
13
|
// be available in a RaycastResult component set later on the same Entity.
|
|
12
14
|
message PBRaycast {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// Correlation ID, defined by the scene and used internally by the scene
|
|
16
|
+
optional uint32 timestamp = 1;
|
|
17
|
+
|
|
18
|
+
// How much to offset the starting point of the ray, relative to the entity's transform.
|
|
19
|
+
// Defaults to vec3(0,0,0)
|
|
20
|
+
optional decentraland.common.Vector3 origin_offset = 2;
|
|
21
|
+
|
|
22
|
+
oneof direction {
|
|
23
|
+
// The direction of the ray in local coordinates (relative to the origin point)
|
|
24
|
+
decentraland.common.Vector3 local_direction = 6;
|
|
25
|
+
|
|
26
|
+
// The direction of the ray in global coordinates (relative to origin)
|
|
27
|
+
decentraland.common.Vector3 global_direction = 3;
|
|
28
|
+
|
|
29
|
+
// Target coordinates of the raycast, in global coordinates
|
|
30
|
+
decentraland.common.Vector3 global_target = 7;
|
|
31
|
+
|
|
32
|
+
// Will point to the final world position of another entity
|
|
33
|
+
uint32 target_entity = 10;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Maximum length of the ray in virtual meters (global space)
|
|
37
|
+
float max_distance = 4;
|
|
38
|
+
|
|
39
|
+
// the RaycastQueryType behavior
|
|
40
|
+
RaycastQueryType query_type = 5;
|
|
41
|
+
|
|
42
|
+
// Indicates the renderer to perform the raycast on every scene tick (ADR-148),
|
|
43
|
+
// otherwise it will be performed only once, defaults to false
|
|
44
|
+
optional bool continuous = 8;
|
|
45
|
+
|
|
46
|
+
// Collision mask, by default all bits are 1 (0xFFFF_FFFF)
|
|
47
|
+
optional uint32 collision_mask = 9;
|
|
17
48
|
}
|
|
18
49
|
|
|
19
50
|
// RaycastQueryType indicates whether the ray should stop on the first collition, or continue.
|
|
20
51
|
enum RaycastQueryType {
|
|
52
|
+
// Pick the first (not necessarily the closest) hit within the range
|
|
21
53
|
RQT_HIT_FIRST = 0;
|
|
54
|
+
// Pick all hits within the range
|
|
22
55
|
RQT_QUERY_ALL = 1;
|
|
56
|
+
// Do not perform the raycast, only set the raycast result with empty hits
|
|
57
|
+
RQT_NONE = 2;
|
|
23
58
|
}
|
|
@@ -1,30 +1,20 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
package decentraland.sdk.components;
|
|
3
3
|
|
|
4
|
-
import "decentraland/sdk/components/common/id.proto";
|
|
5
4
|
import "decentraland/common/vectors.proto";
|
|
5
|
+
import "decentraland/sdk/components/common/id.proto";
|
|
6
|
+
import "decentraland/sdk/components/common/raycast_hit.proto";
|
|
6
7
|
|
|
7
8
|
option (common.ecs_component_id) = 1068;
|
|
8
9
|
|
|
10
|
+
// The PBRaycast component and PBRaycastResult are defined in https://adr.decentraland.org/adr/ADR-200
|
|
11
|
+
//
|
|
9
12
|
// The RaycastResult component is added to an Entity when the results of a previously attached
|
|
10
|
-
// Raycast component are available. It contains information about the ray and any objects it
|
|
13
|
+
// Raycast component are available. It contains information about the ray and any objects it
|
|
11
14
|
// collided with.
|
|
12
15
|
message PBRaycastResult {
|
|
13
|
-
|
|
14
|
-
decentraland.common.Vector3
|
|
15
|
-
decentraland.common.Vector3 direction = 3;
|
|
16
|
-
repeated RaycastHit hits = 4;
|
|
16
|
+
optional uint32 timestamp = 1; // timestamp is a correlation id, copied from the PBRaycast
|
|
17
|
+
decentraland.common.Vector3 global_origin = 2; // the starting point of the ray in global coordinates
|
|
18
|
+
decentraland.common.Vector3 direction = 3; // the direction vector of the ray in global coordinates
|
|
19
|
+
repeated decentraland.sdk.components.common.RaycastHit hits = 4; // zero or more hits
|
|
17
20
|
}
|
|
18
|
-
|
|
19
|
-
// RaycastHit contains information about the intersection of a ray with a mesh.
|
|
20
|
-
message RaycastHit {
|
|
21
|
-
// Position will be relative to the scene
|
|
22
|
-
decentraland.common.Vector3 position = 1; // the intersection point
|
|
23
|
-
decentraland.common.Vector3 origin = 2; // the starting point of the ray
|
|
24
|
-
decentraland.common.Vector3 direction = 3; // the direction vector of the ray
|
|
25
|
-
decentraland.common.Vector3 normal_hit = 4; // the entry vector of the ray into the collision mesh
|
|
26
|
-
|
|
27
|
-
float length = 5; // the distance between the ray origin and the hit position
|
|
28
|
-
optional string mesh_name = 6; // (unused) mesh ID if collision happened inside a GltfContainer
|
|
29
|
-
optional int64 entity_id = 7; // the ID of the Entity that has the impacted mesh attached
|
|
30
|
-
}
|