11using System . Collections ;
22using NUnit . Framework ;
3+ using Unity . Netcode . Components ;
34using UnityEngine ;
45
56namespace Unity . Netcode . RuntimeTests
@@ -9,29 +10,51 @@ namespace Unity.Netcode.RuntimeTests
910 /// server and host operating modes and will test both authoritative
1011 /// models for each operating mode.
1112 /// </summary>
12- [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full ) ]
13+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
14+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
1315#if ! MULTIPLAYER_TOOLS
14- [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half ) ]
15- [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full ) ]
16- [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half ) ]
17- [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full ) ]
18- [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half ) ]
16+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
17+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
18+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
19+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
20+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
21+
22+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
23+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
24+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
25+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
26+ [ TestFixture ( HostOrServer . DAHost , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
27+
1928#endif
20- [ TestFixture ( HostOrServer . Host , Authority . ServerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full ) ]
29+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
30+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
2131#if ! MULTIPLAYER_TOOLS
22- [ TestFixture ( HostOrServer . Host , Authority . ServerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half ) ]
23- [ TestFixture ( HostOrServer . Host , Authority . ServerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full ) ]
24- [ TestFixture ( HostOrServer . Host , Authority . ServerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half ) ]
25- [ TestFixture ( HostOrServer . Host , Authority . ServerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full ) ]
26- [ TestFixture ( HostOrServer . Host , Authority . ServerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half ) ]
32+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
33+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
34+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
35+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
36+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
37+
38+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
39+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
40+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
41+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
42+ [ TestFixture ( HostOrServer . Server , Authority . ServerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
2743#endif
28- [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full ) ]
44+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
45+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
2946#if ! MULTIPLAYER_TOOLS
30- [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half ) ]
31- [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full ) ]
32- [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half ) ]
33- [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full ) ]
34- [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half ) ]
47+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
48+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
49+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
50+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . Lerp ) ]
51+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . Lerp ) ]
52+
53+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Euler , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
54+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
55+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . None , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
56+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Full , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
57+ [ TestFixture ( HostOrServer . Host , Authority . OwnerAuthority , RotationCompression . QuaternionCompress , Rotation . Quaternion , Precision . Half , NetworkTransform . InterpolationTypes . SmoothDampening ) ]
3558#endif
3659 internal class NetworkTransformTests : NetworkTransformBase
3760 {
@@ -41,9 +64,12 @@ internal class NetworkTransformTests : NetworkTransformBase
4164 /// </summary>
4265 /// <param name="hostOrServer">Determines if we are running as a server or host</param>
4366 /// <param name="authority">Determines if we are using server or owner authority</param>
44- public NetworkTransformTests ( HostOrServer testWithHost , Authority authority , RotationCompression rotationCompression , Rotation rotation , Precision precision ) :
67+ public NetworkTransformTests ( HostOrServer testWithHost , Authority authority , RotationCompression rotationCompression , Rotation rotation , Precision precision , NetworkTransform . InterpolationTypes interpolation ) :
4568 base ( testWithHost , authority , rotationCompression , rotation , precision )
46- { }
69+ {
70+ NetworkTransform . AssignDefaultInterpolationType = true ;
71+ NetworkTransform . DefaultInterpolationType = interpolation ;
72+ }
4773
4874 protected override bool m_EnableTimeTravel => true ;
4975 protected override bool m_SetupIsACoroutine => false ;
@@ -102,7 +128,7 @@ private void AllChildrenLocalTransformValuesMatch(bool useSubChild, ChildrenTran
102128
103129#if ! MULTIPLAYER_TOOLS
104130
105- private void UpdateTransformLocal ( Components . NetworkTransform networkTransformTestComponent )
131+ private void UpdateTransformLocal ( NetworkTransform networkTransformTestComponent )
106132 {
107133 networkTransformTestComponent . transform . localPosition += GetRandomVector3 ( 0.5f , 2.0f ) ;
108134 var rotation = networkTransformTestComponent . transform . localRotation ;
@@ -112,7 +138,7 @@ private void UpdateTransformLocal(Components.NetworkTransform networkTransformTe
112138 networkTransformTestComponent . transform . localRotation = rotation ;
113139 }
114140
115- private void UpdateTransformWorld ( Components . NetworkTransform networkTransformTestComponent )
141+ private void UpdateTransformWorld ( NetworkTransform networkTransformTestComponent )
116142 {
117143 networkTransformTestComponent . transform . position += GetRandomVector3 ( 0.5f , 2.0f ) ;
118144 var rotation = networkTransformTestComponent . transform . rotation ;
0 commit comments