Commit 16c4409
authored
fix: networktransform double lerp (MTTB-539) (#3337)
This PR fixes the issue with double lerping by providing two types of
interpolators to select from while also exposing the
`MaximumInterpolationTime` for each respective interpolator type. Smooth
Dampening is added as an alternative to using lerp for each respective
interpolator (position, rotation, and scale).
This PR includes a few new additions:
- Additional updates to the inspector view which allows for interpolator
type selection and if available additional properties associated with
the interpolator.




- A new `NetworkTimeSystem.TickLatency` property that provides the
average latency of a client.
- An new `NetworkTime.FixedDeltaTimeAsDouble` property that returns a
`double` version of the `NetworkTime.FixedDeltaTime`.
This PR also starts the deprecation process for
`BufferedLinearInterpolator<T>.Update(float deltaTime, NetworkTime
serverTime)` as this method is only for internal testing purposes.
[MTTB-539](https://jira.unity3d.com/browse/MTTB-539)
[MTT-11338](https://jira.unity3d.com/browse/MTT-11338) -- Fixing
disabled tests
fix: #3112
close: #3112
## Changelog
- Added: Interpolator types as an inspector view selection for position,
rotation, and scale.
- Added: A new smooth dampening interpolator type that provides a nice
balance between precision and smoothing results.
- Added: `NetworkTimeSystem.TickLatency` property that provides the
average latency of a client.
- Fixed: Issue where the `MaximumInterpolationTime` could not be
modified from within the inspector view or runtime.
- Changed: `BufferedLinearInterpolator<T>.Update(float deltaTime,
NetworkTime serverTime)` as being deprecated since this method is only
used for internal testing purposes.
## Testing and Documentation
- Includes integration test updates:
- `InterpolatorTests` was updated to changes and two disabled tests were
refactored and re-enabled.
- `NetworkTransformGeneral` includes additional TestFixture passes using
Smooth Dampening.
- `NetworktTransformTests` includes additional TestFixture passes using
Smooth Dampening.
- `NestedNetworkTransformTests` includes additional TestFixture passes
using Smooth Dampening.
- Includes updates and additions to public documentation
([PR-1443](Unity-Technologies/com.unity.multiplayer.docs#1443))
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->1 parent e5362a4 commit 16c4409
File tree
26 files changed
+1279
-588
lines changed- com.unity.netcode.gameobjects
- Editor
- Configuration
- Runtime
- Components
- Interpolator
- Timing
- Tests
- Editor
- Runtime/NetworkTransform
- testproject/Assets/Tests
- Manual/NestedNetworkTransforms
- Runtime/NetworkTransform
26 files changed
+1279
-588
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
| |||
19 | 29 | | |
20 | 30 | | |
21 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
22 | 35 | | |
23 | 36 | | |
24 | 37 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
11 | 17 | | |
12 | 18 | | |
13 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
14 | 25 | | |
15 | 26 | | |
16 | 27 | | |
17 | 28 | | |
18 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
19 | 85 | | |
20 | 86 | | |
21 | 87 | | |
22 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
23 | 92 | | |
24 | 93 | | |
25 | 94 | | |
| |||
30 | 99 | | |
31 | 100 | | |
32 | 101 | | |
| 102 | + | |
33 | 103 | | |
34 | 104 | | |
35 | 105 | | |
| 106 | + | |
36 | 107 | | |
37 | 108 | | |
38 | 109 | | |
| |||
Lines changed: 78 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| |||
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
| 46 | + | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
| |||
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
64 | 81 | | |
65 | 82 | | |
66 | 83 | | |
| |||
141 | 158 | | |
142 | 159 | | |
143 | 160 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
147 | 176 | | |
148 | 177 | | |
149 | 178 | | |
| |||
158 | 187 | | |
159 | 188 | | |
160 | 189 | | |
161 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
162 | 235 | | |
163 | | - | |
| 236 | + | |
164 | 237 | | |
165 | 238 | | |
166 | 239 | | |
| |||
190 | 263 | | |
191 | 264 | | |
192 | 265 | | |
193 | | - | |
194 | | - | |
195 | 266 | | |
196 | 267 | | |
197 | 268 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 77 | + | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
64 | 62 | | |
65 | 63 | | |
66 | 64 | | |
| |||
0 commit comments