ProtoFlux:Delta: Difference between revisions

From Resonite Wiki
m This needs info on what delta even means
Use update rate instead of frame rate
 
(4 intermediate revisions by 2 users not shown)
Line 8: Line 8:
|Outputs=
|Outputs=
[
[
{"Name": "*", "Type":"Dummy"}
{"Name": "*", "Type": "Dummy"}
]
]
|}}
|}}


Returns a change in [[Value Type|value]].
Returns a change in [[Value Type|value]]. The [https://en.wikipedia.org/wiki/Delta_(letter) Greek letter Delta (Δ)] is commonly being used as a variable or symbol related to change.


This node is dependent on your framerate.
This node is dependent on your local update rate and its output may differ between users as it is not being synchronized.


This is best used in conjunction with the [[DivDeltaTime (ProtoFlux)|DivDeltaTime]] node.
This is best used in conjunction with the [[ProtoFlux:DivDeltaTime|DivDeltaTime]] node such that changes are proportional to time instead of the local update rate.
 
== Inputs ==
 
=== Value (Pseudo-Generic) ===
 
The value for which a delta should be kept track of.
 
== Outputs ==
 
=== * (Pseudo-Generic) ===
 
This is the delta-value, which is the change compared to the last [[ProtoFlux:Local_Update|Local Update]].
 
== Examples ==
 
[[File:ProtoFlux_Delta_Example_Direction.png|none]]
 
The delta global position can be used to get the direction and speed an object is moving by. In this example, a sphere can be grabbed and moved around. The direction vector, whose magnitude is its movement speed, is displayed as a debug vector.
 
[[ProtoFlux:DivDeltaTime|DivDeltaTime]] is being used to normalize the length of the vector over time such that the magnitude corresponds to "distance per second" instead of "distance per update".
 
== Implementation Details ==
 
This node can be implemented using other ProtoFlux nodes:
 
[[File:ProtoFlux_Delta_Implementation.png|none]]
 
In this case, the leftmost Input Node represents the node's input and the Display its output. This implementation of an int Delta Node is equivalent to the implementation in the game's code. How exactly the difference to the previous value is calculated depends on the value type.


{{Stub}}


[[Category:ProtoFlux:Math]]
[[Category:ProtoFlux:Math]]

Latest revision as of 01:21, 10 February 2024

Delta
Value
*
Math

Returns a change in value. The Greek letter Delta (Δ) is commonly being used as a variable or symbol related to change.

This node is dependent on your local update rate and its output may differ between users as it is not being synchronized.

This is best used in conjunction with the DivDeltaTime node such that changes are proportional to time instead of the local update rate.

Inputs

Value (Pseudo-Generic)

The value for which a delta should be kept track of.

Outputs

* (Pseudo-Generic)

This is the delta-value, which is the change compared to the last Local Update.

Examples

The delta global position can be used to get the direction and speed an object is moving by. In this example, a sphere can be grabbed and moved around. The direction vector, whose magnitude is its movement speed, is displayed as a debug vector.

DivDeltaTime is being used to normalize the length of the vector over time such that the magnitude corresponds to "distance per second" instead of "distance per update".

Implementation Details

This node can be implemented using other ProtoFlux nodes:

In this case, the leftmost Input Node represents the node's input and the Display its output. This implementation of an int Delta Node is equivalent to the implementation in the game's code. How exactly the difference to the previous value is calculated depends on the value type.