Skip to content

Commit ae594f0

Browse files
authored
Merge pull request #11866 from ChudeRonczki/patch-1
Remove outdated info about differences in 2D and 3D physics interpolation
2 parents fb00328 + f623cbc commit ae594f0

File tree

2 files changed

+12
-44
lines changed

2 files changed

+12
-44
lines changed

tutorials/physics/interpolation/2d_and_3d_physics_interpolation.rst

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,6 @@
66
Generally 2D and 3D physics interpolation work in very similar ways. However, there
77
are a few differences, which will be described here.
88

9-
Global versus local interpolation
10-
---------------------------------
11-
12-
- In 3D, physics interpolation is performed *independently* on the **global
13-
transform** of each 3D instance.
14-
- In 2D by contrast, physics interpolation is performed on the **local transform**
15-
of each 2D instance.
16-
17-
This has some implications:
18-
19-
- In 3D, it is easy to turn interpolation on and off at the level of each ``Node``,
20-
via the :ref:`physics_interpolation_mode<class_Node_property_physics_interpolation_mode>`
21-
property in the Inspector, which can be set to ``On``, ``Off``, or ``Inherited``.
22-
23-
.. figure:: img/physics_interpolation_mode.webp
24-
:align: center
25-
26-
- However this means that in 3D, pivots that occur in the ``SceneTree`` (due to
27-
parent child relationships) can only be interpolated **approximately** over the
28-
physics tick. In most cases this will not matter, but in some situations the
29-
interpolation can look slightly wrong.
30-
- In 2D, interpolated local transforms are passed down to children during
31-
rendering. This means that if a parent has ``physics_interpolation_mode`` set to
32-
``On``, but the child is set to ``Off``, the child will still be interpolated if
33-
the parent is moving. *Only the child's local transform is uninterpolated.*
34-
Controlling the on / off behavior of 2D nodes therefore requires a little more
35-
thought and planning.
36-
- On the positive side, pivot behavior in the scene tree is perfectly preserved
37-
during interpolation in 2D, which gives super smooth behavior.
38-
39-
Resetting physics interpolation
40-
-------------------------------
41-
42-
Whenever objects are moved to a completely new position, and interpolation is not
43-
desired (so as to prevent a "streaking" artefact), it is the responsibility of the
44-
user to call ``reset_physics_interpolation()``.
45-
46-
The good news is that in 2D, this is automatically done for you when nodes first
47-
enter the tree. This reduces boiler plate, and reduces the effort required to get
48-
an existing project working.
49-
50-
.. note:: If you move objects *after* adding to the scene tree, you will still need
51-
to call ``reset_physics_interpolation()`` as with 3D.
52-
539
2D Particles
5410
------------
5511

tutorials/physics/interpolation/advanced_physics_interpolation.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ for a Node, the children will recursively also be affected (as they default to
2121
inheriting the parent setting). This means you can easily disable interpolation for
2222
an entire subscene.
2323

24+
.. figure:: img/physics_interpolation_mode.webp
25+
26+
It is worth noting that, both in 2D and 3D, physics interpolation is performed
27+
on the **local transform** of each instance. During rendering, interpolated local
28+
transforms are passed down to children.
29+
30+
This means that if a parent has ``physics_interpolation_mode`` set to ``On``,
31+
but the child is set to ``Off``, the child will still be interpolated if the parent
32+
is moving. *Only the child's local transform is uninterpolated.*
33+
Controlling the on / off behavior of nodes therefore requires some
34+
thought and planning.
35+
2436
The most common situation where you may want to perform your own interpolation is
2537
Cameras.
2638

0 commit comments

Comments
 (0)