mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
fix vector subtract
This commit is contained in:
parent
badddced3e
commit
6f19a0b335
1 changed files with 10 additions and 7 deletions
|
@ -25,21 +25,24 @@ func _init() -> void:
|
||||||
|
|
||||||
func _receive(port : int, data : Variant) -> void:
|
func _receive(port : int, data : Variant) -> void:
|
||||||
|
|
||||||
var va = data
|
var va
|
||||||
if !DeckType.is_valid_vector(data):
|
|
||||||
|
|
||||||
DeckHolder.logger.log_node("Vector Sub: Port %d: Supplied data was not a valid Vector. Please ensure it is a Dictionary with keys 'x' and 'y'" % port)
|
|
||||||
return
|
|
||||||
|
|
||||||
var vb
|
var vb
|
||||||
|
|
||||||
if port == 0:
|
if port == 0:
|
||||||
|
va = data
|
||||||
|
|
||||||
vb = await request_value_async(1)
|
vb = await request_value_async(1)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
vb = await request_value_async(0)
|
va = await request_value_async(0)
|
||||||
|
|
||||||
|
vb = data
|
||||||
|
|
||||||
|
if (not DeckType.is_valid_vector(va)) or (not DeckType.is_valid_vector(vb)):
|
||||||
|
DeckHolder.logger.log_node("Vector Sub: Port %d: one of the inputs is not a valid Vector. Please ensure it is a Dictionary with keys 'x' and 'y'." % port)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
var calc = subtract_vectors(va, vb)
|
var calc = subtract_vectors(va, vb)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue