Skip to content

Commit

Permalink
chore: virtual cam components iteration (#219)
Browse files Browse the repository at this point in the history
* Removed the currently ignored 'fromEntity' / 'toEntity' suggestions in 'CameraTransition'
* Made 'MainCamera.VirtualCameraEntity' releasable with 'undefined' instead of '0' by making the field 'optional'
* Made 'VirtualCamera.DefaultTransition' as 'optional' and not mandatory so that a 'VirtualCamera.Create(entity)' is accepted and can still be used with a default instant/cut transition
  • Loading branch information
pravusjif authored Sep 16, 2024
1 parent a0c6d86 commit 31410eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
syntax = "proto3";
package decentraland.sdk.components.common;

// Defines the transition used towards the camera that contains the CameraTransition.
// This structure may be updated in the future to specify from/to entities and to have easing functions.
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
float time = 1;
float speed = 2; // meters per second; e.g. speed 1 -> 1 meter per second
}
// EasingFunction easing_function = 5; // enable in the future
}
6 changes: 3 additions & 3 deletions proto/decentraland/sdk/components/main_camera.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ 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.
// PBMainCamera.virtualCameraEntity defines which VirtualCamera entity is active at the moment.
// This component may hold 'repeated common.CameraTransition' transitionOverrides in the future
message PBMainCamera {
uint32 virtual_camera_entity = 1; // currently active virtual camera (default: 0)
// repeated common.CameraTransition transitionOverrides = 2; // enable in the future
optional uint32 virtual_camera_entity = 1; // current active virtual camera
}
5 changes: 3 additions & 2 deletions proto/decentraland/sdk/components/virtual_camera.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ 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 defaultTransition represents the transition TOWARDS this camera. If there is none, it's treated as
// an 'instant' transition (like using speed/time = 0)
// * 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 common.CameraTransition default_transition = 1;
optional uint32 look_at_entity = 2;
}

0 comments on commit 31410eb

Please sign in to comment.