Skip to content

Commit

Permalink
feat: MainCamera and VirtualCamera components (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
pravusjif authored Sep 4, 2024
1 parent 227b327 commit a0c6d86
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions proto/decentraland/sdk/components/common/camera_transition.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";
package decentraland.sdk.components.common;

message CameraTransition {
optional uint32 from_entity = 1;
optional uint32 to_entity = 2;
oneof transition_mode {
float time = 3;
float speed = 4; // meters per second; e.g. speed 1 -> 1 meter per second
}
// EasingFunction easing_function = 5; // enable in the future
}
11 changes: 11 additions & 0 deletions proto/decentraland/sdk/components/main_camera.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";
package decentraland.sdk.components;

import "decentraland/sdk/components/common/id.proto";
option (common.ecs_component_id) = 1075;

// PBMainCamera.virtualCameraEntity defines which VirtualCamera entity is active at the moment. 0 means none.
message PBMainCamera {
uint32 virtual_camera_entity = 1; // currently active virtual camera (default: 0)
// repeated common.CameraTransition transitionOverrides = 2; // enable in the future
}
15 changes: 15 additions & 0 deletions proto/decentraland/sdk/components/virtual_camera.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";
package decentraland.sdk.components;

import "decentraland/sdk/components/common/camera_transition.proto";
import "decentraland/sdk/components/common/id.proto";
option (common.ecs_component_id) = 1076;

// PBVirtualCamera represents a camera to be used at some point in time during the scene execution
// * The defaultTransition represents the transition TOWARDS this camera.
// * The lookAtEntity defines to which entity the Camera has to look at constantly (independent from
// the holding entity transform).
message PBVirtualCamera {
common.CameraTransition default_transition = 1;
optional uint32 look_at_entity = 2;
}

0 comments on commit a0c6d86

Please sign in to comment.