|
@@ -84,24 +84,26 @@
|
|
<return type="void" />
|
|
<return type="void" />
|
|
<param index="0" name="delta" type="float" />
|
|
<param index="0" name="delta" type="float" />
|
|
<description>
|
|
<description>
|
|
- Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the [param delta] parameter will [i]generally[/i] be constant (see exceptions below). [param delta] is in seconds.
|
|
|
|
- It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process].
|
|
|
|
|
|
+ Called once on each physics tick, and allows Nodes to synchronize their logic with physics ticks. [param delta] is the logical time between physics ticks in seconds and is equal to [member Engine.time_scale] / [member Engine.physics_ticks_per_second].
|
|
|
|
+ It is only called if physics processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with [method set_physics_process].
|
|
Processing happens in order of [member process_physics_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
|
|
Processing happens in order of [member process_physics_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
|
|
Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification].
|
|
Corresponds to the [constant NOTIFICATION_PHYSICS_PROCESS] notification in [method Object._notification].
|
|
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
|
|
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
|
|
- [b]Note:[/b] [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec].
|
|
|
|
|
|
+ [b]Note:[/b] Accumulated [param delta] may diverge from real world seconds.
|
|
</description>
|
|
</description>
|
|
</method>
|
|
</method>
|
|
<method name="_process" qualifiers="virtual">
|
|
<method name="_process" qualifiers="virtual">
|
|
<return type="void" />
|
|
<return type="void" />
|
|
<param index="0" name="delta" type="float" />
|
|
<param index="0" name="delta" type="float" />
|
|
<description>
|
|
<description>
|
|
- Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the [param delta] time since the previous frame is not constant. [param delta] is in seconds.
|
|
|
|
- It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with [method set_process].
|
|
|
|
|
|
+ Called on each idle frame, prior to rendering, and after physics ticks have been processed. [param delta] is the time between frames in seconds.
|
|
|
|
+ It is only called if processing is enabled for this Node, which is done automatically if this method is overridden, and can be toggled with [method set_process].
|
|
Processing happens in order of [member process_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
|
|
Processing happens in order of [member process_priority], lower priority values are called first. Nodes with the same priority are processed in tree order, or top to bottom as seen in the editor (also known as pre-order traversal).
|
|
Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification].
|
|
Corresponds to the [constant NOTIFICATION_PROCESS] notification in [method Object._notification].
|
|
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
|
|
[b]Note:[/b] This method is only called if the node is present in the scene tree (i.e. if it's not an orphan).
|
|
- [b]Note:[/b] [param delta] will be larger than expected if running at a framerate lower than [member Engine.physics_ticks_per_second] / [member Engine.max_physics_steps_per_frame] FPS. This is done to avoid "spiral of death" scenarios where performance would plummet due to an ever-increasing number of physics steps per frame. This behavior affects both [method _process] and [method _physics_process]. As a result, avoid using [param delta] for time measurements in real-world seconds. Use the [Time] singleton's methods for this purpose instead, such as [method Time.get_ticks_usec].
|
|
|
|
|
|
+ [b]Note:[/b] When the engine is struggling and the frame rate is lowered, [param delta] will increase. When [param delta] is increased, it's capped at a maximum of [member Engine.time_scale] * [member Engine.max_physics_steps_per_frame] / [member Engine.physics_ticks_per_second]. As a result, accumulated [param delta] may not represent real world time.
|
|
|
|
+ [b]Note:[/b] When [code]--fixed-fps[/code] is enabled or the engine is running in Movie Maker mode (see [MovieWriter]), process [param delta] will always be the same for every frame, regardless of how much time the frame took to render.
|
|
|
|
+ [b]Note:[/b] Frame delta may be post-processed by [member OS.delta_smoothing] if this is enabled for the project.
|
|
</description>
|
|
</description>
|
|
</method>
|
|
</method>
|
|
<method name="_ready" qualifiers="virtual">
|
|
<method name="_ready" qualifiers="virtual">
|