Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proto/decentraland/sdk/components/mesh_collider.proto
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ enum ColliderLayer {
CL_CUSTOM6 = 8192;
CL_CUSTOM7 = 16384;
CL_CUSTOM8 = 32768;
CL_PLAYER = 65536;
}
23 changes: 23 additions & 0 deletions proto/decentraland/sdk/components/trigger_area.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
syntax = "proto3";

package decentraland.sdk.components;

import "decentraland/sdk/components/common/id.proto";

option (common.ecs_component_id) = 1060;

// The PBTriggerArea component is used to raise collision triggering events (through the TriggerAreaResult component)
// when entities enter this component's defined area.
//
// ADR: https://github.com/decentraland/adr/blob/2b30a5e2b4f359a7c22a68fb827db282f6e5f887/content/ADR-258-trigger-areas.md
//
// The area size and rotation is defined by the Entity's Transform.
message PBTriggerArea {
optional TriggerAreaMeshType mesh = 1; // default: MT_BOX
optional uint32 collision_mask = 2; // default: CL_PLAYER
}

enum TriggerAreaMeshType {
TAMT_BOX = 0;
TAMT_SPHERE = 1;
}
34 changes: 34 additions & 0 deletions proto/decentraland/sdk/components/trigger_area_result.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
syntax = "proto3";

package decentraland.sdk.components;

import "decentraland/common/vectors.proto";
import "decentraland/sdk/components/common/id.proto";

option (common.ecs_component_id) = 1061;

// The PBTriggerAreaResult component is used to transport the trigger collision event data for the PBTriggerArea component.
// ADR: https://github.com/decentraland/adr/blob/2b30a5e2b4f359a7c22a68fb827db282f6e5f887/content/ADR-258-trigger-areas.md
message PBTriggerAreaResult {
// Trigger data object
message Trigger {
uint32 entity = 1; // The entity that triggered the Trigger Area
uint32 layer = 2; // The collision layer of the entity that triggered the Trigger Area
decentraland.common.Vector3 position = 3; // The position of the entity that triggered the trigger
decentraland.common.Quaternion rotation = 4; // The rotation of the entity that triggered the trigger
decentraland.common.Vector3 scale = 5; // The scale of the entity that triggered the trigger
}

uint32 triggered_entity = 1; // The entity that was triggered (this is the entity that owns the trigger area)
decentraland.common.Vector3 triggered_entity_position = 2; // The position of the triggered entity at the time of the trigger
decentraland.common.Quaternion triggered_entity_rotation = 3; // The rotation of the triggered entity at the time of the trigger
TriggerAreaEventType event_type = 4; // The state of the trigger event (ENTER, STAY, EXIT)
uint32 timestamp = 5; // The timestamp of the trigger event
Trigger trigger = 6;
}

enum TriggerAreaEventType {
TAET_ENTER = 0;
TAET_STAY = 1;
TAET_EXIT = 2;
}
Loading