From 06754ec58413d21710d5a68a9b52c19cc2eb6af5 Mon Sep 17 00:00:00 2001 From: gon boedo Date: Sat, 12 Jul 2025 00:38:32 -0300 Subject: [PATCH] wip menduz --- .../components/delayed_interpolation.proto | 32 +++++++++++++++++++ public/sdk-components.proto | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 proto/decentraland/sdk/components/delayed_interpolation.proto diff --git a/proto/decentraland/sdk/components/delayed_interpolation.proto b/proto/decentraland/sdk/components/delayed_interpolation.proto new file mode 100644 index 00000000..5d8ee9c3 --- /dev/null +++ b/proto/decentraland/sdk/components/delayed_interpolation.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package decentraland.sdk.components; + +import "decentraland/sdk/components/common/id.proto"; + +option (common.ecs_component_id) = 1101; + +// https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking#Entity_interpolation +// https://gamedev.stackexchange.com/questions/142427/delayed-linear-interpolation-for-networking +// https://github.com/menduz/Semi-Fixed-Time-Step-Interpolation +// +// The DelayedInterpolation component allows to animate the final transform of an entity. +// The animation is performed time-traveling back in time .duration amount of milliseconds +// and linearly interpolating the values of the transform from the past. +// +// The parameters used for this time-travel are set by the transform component and its +// modifiers like billboard, avatar attachment point, etc. +// +// When an entity changes its parent entity, the tween's time-travel registry will +// automatically reset. Meaning NO tweening will be performed upon reparenting. +// +// Tweens will be calculated AFTER the final position of the entity is calculated, +// and BEFORE the position of the child entities is computed. Effectively applying +// the animation to all its children. +// +// It is important to mention that tweens only apply to the local entity, if a parent entity P +// has a linear tween, and it has a child entity C with another tween, by moving P, only P's tween will apply, +// moving C's frame of reference but NOT animating it. +message PBDelayedInterpolation { + float time_travel_duration = 1; // in milliseconds +} \ No newline at end of file diff --git a/public/sdk-components.proto b/public/sdk-components.proto index 64d7c6f2..8725e6b1 100644 --- a/public/sdk-components.proto +++ b/public/sdk-components.proto @@ -40,3 +40,5 @@ import public "decentraland/sdk/components/ui_text.proto"; import public "decentraland/sdk/components/ui_transform.proto"; import public "decentraland/sdk/components/video_player.proto"; import public "decentraland/sdk/components/visibility_component.proto"; +import public "decentraland/sdk/components/delayed_interpolation.proto"; +