summaryrefslogtreecommitdiffstats
path: root/doc/classes
diff options
context:
space:
mode:
authorRicardo Buring <ricardo.buring@gmail.com>2024-05-26 19:39:28 +0200
committerRicardo Buring <ricardo.buring@gmail.com>2024-07-07 22:15:23 +0200
commit2f8ab4a6540e65fa4097d1f58988eb03cb81ad65 (patch)
tree863471888f7bd0832d9d57931cd3885d4b739504 /doc/classes
parent42e5b3ac2da07d2105c775977b39e6949c723ded (diff)
downloadredot-engine-2f8ab4a6540e65fa4097d1f58988eb03cb81ad65.tar.gz
Fixed Timestep Interpolation (3D)
Adds 3D fixed timestep interpolation to the rendering server. This does not yet include support for multimeshes or particles. Co-authored-by: lawnjelly <lawnjelly@gmail.com>
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Node3D.xml8
-rw-r--r--doc/classes/ProjectSettings.xml7
-rw-r--r--doc/classes/RenderingServer.xml16
-rw-r--r--doc/classes/Viewport.xml1
4 files changed, 31 insertions, 1 deletions
diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml
index 125c7ef3ee..ae13af4b82 100644
--- a/doc/classes/Node3D.xml
+++ b/doc/classes/Node3D.xml
@@ -46,6 +46,14 @@
Returns all the gizmos attached to this [Node3D].
</description>
</method>
+ <method name="get_global_transform_interpolated">
+ <return type="Transform3D" />
+ <description>
+ When using physics interpolation, there will be circumstances in which you want to know the interpolated (displayed) transform of a node rather than the standard transform (which may only be accurate to the most recent physics tick).
+ This is particularly important for frame-based operations that take place in [method Node._process], rather than [method Node._physics_process]. Examples include [Camera3D]s focusing on a node, or finding where to fire lasers from on a frame rather than physics tick.
+ [b]Note:[/b] This function creates an interpolation pump on the [Node3D] the first time it is called, which can respond to physics interpolation resets. If you get problems with "streaking" when initially following a [Node3D], be sure to call [method get_global_transform_interpolated] at least once [i]before[/i] resetting the [Node3D] physics interpolation.
+ </description>
+ </method>
<method name="get_parent_node_3d" qualifiers="const">
<return type="Node3D" />
<description>
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 037f2f3811..c852afd988 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -630,6 +630,10 @@
<member name="debug/settings/gdscript/max_call_stack" type="int" setter="" getter="" default="1024">
Maximum call stack allowed for debugging GDScript.
</member>
+ <member name="debug/settings/physics_interpolation/enable_warnings" type="bool" setter="" getter="" default="true">
+ If [code]true[/code], enables warnings which can help pinpoint where nodes are being incorrectly updated, which will result in incorrect interpolation and visual glitches.
+ When a node is being interpolated, it is essential that the transform is set during [method Node._physics_process] (during a physics tick) rather than [method Node._process] (during a frame).
+ </member>
<member name="debug/settings/profiler/max_functions" type="int" setter="" getter="" default="16384">
Maximum number of functions per frame allowed when profiling.
</member>
@@ -2325,7 +2329,8 @@
</member>
<member name="physics/common/physics_jitter_fix" type="float" setter="" getter="" default="0.5">
Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be good enough for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended.
- [b]Note:[/b] When using a physics interpolation solution (such as enabling [member physics/common/physics_interpolation] or using a custom solution), the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0.0[/code].
+ [b]Note:[/b] Jitter fix is automatically disabled at runtime when [member physics/common/physics_interpolation] is enabled.
+ [b]Note:[/b] When using a custom physics interpolation solution, the physics jitter fix should be disabled by setting [member physics/common/physics_jitter_fix] to [code]0.0[/code].
[b]Note:[/b] This property is only read when the project starts. To change the physics jitter fix at runtime, set [member Engine.physics_jitter_fix] instead.
</member>
<member name="physics/common/physics_ticks_per_second" type="int" setter="" getter="" default="60">
diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml
index 3c9f0fc7af..d86b82b72a 100644
--- a/doc/classes/RenderingServer.xml
+++ b/doc/classes/RenderingServer.xml
@@ -1855,6 +1855,14 @@
Sets the visibility range values for the given geometry instance. Equivalent to [member GeometryInstance3D.visibility_range_begin] and related properties.
</description>
</method>
+ <method name="instance_reset_physics_interpolation">
+ <return type="void" />
+ <param index="0" name="instance" type="RID" />
+ <description>
+ Prevents physics interpolation for the current physics tick.
+ This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location.
+ </description>
+ </method>
<method name="instance_set_base">
<return type="void" />
<param index="0" name="instance" type="RID" />
@@ -1896,6 +1904,14 @@
If [code]true[/code], ignores both frustum and occlusion culling on the specified 3D geometry instance. This is not the same as [member GeometryInstance3D.ignore_occlusion_culling], which only ignores occlusion culling and leaves frustum culling intact.
</description>
</method>
+ <method name="instance_set_interpolated">
+ <return type="void" />
+ <param index="0" name="instance" type="RID" />
+ <param index="1" name="interpolated" type="bool" />
+ <description>
+ Turns on and off physics interpolation for the instance.
+ </description>
+ </method>
<method name="instance_set_layer_mask">
<return type="void" />
<param index="0" name="instance" type="RID" />
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index b288ee7ff6..f57185ae87 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -301,6 +301,7 @@
<member name="own_world_3d" type="bool" setter="set_use_own_world_3d" getter="is_using_own_world_3d" default="false">
If [code]true[/code], the viewport will use a unique copy of the [World3D] defined in [member world_3d].
</member>
+ <member name="physics_interpolation_mode" type="int" setter="set_physics_interpolation_mode" getter="get_physics_interpolation_mode" overrides="Node" enum="Node.PhysicsInterpolationMode" default="1" />
<member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" default="false">
If [code]true[/code], the objects rendered by viewport become subjects of mouse picking process.
[b]Note:[/b] The number of simultaneously pickable objects is limited to 64 and they are selected in a non-deterministic order, which can be different in each picking process.