Explorar o código

Fix C# example about interpolating with quaternions

The `GetQuaternion` method was unexposed in 4.0. The example now uses the `Quaternion(Basis)` constructor which matches the GDScript example.
Raul Santos hai 4 meses
pai
achega
f044c7c1d1
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      tutorials/3d/using_transforms.rst

+ 2 - 2
tutorials/3d/using_transforms.rst

@@ -383,8 +383,8 @@ Converting a rotation to quaternion is straightforward.
  .. code-tab:: csharp
 
     // Convert basis to quaternion, keep in mind scale is lost
-    var a = transform.Basis.GetQuaternion();
-    var b = transform2.Basis.GetQuaternion();
+    var a = new Quaternion(transform.Basis);
+    var b = new Quaternion(transform2.Basis);
     // Interpolate using spherical-linear interpolation (SLERP).
     var c = a.Slerp(b, 0.5f); // find halfway point between a and b
     // Apply back