Input of "Get Distance" is Object, but input of "Distance" is Vector.
This commit is contained in:
Sandy 2020-03-14 21:03:07 +09:00 committed by GitHub
parent d1a0fc69c8
commit 3f77ff397d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,19 @@
package armory.logicnode;
import iron.math.Vec4;
class DistanceNode extends LogicNode {
public function new(tree: LogicTree) {
super(tree);
}
override function get(from: Int): Dynamic {
var vector1: Vec4 = inputs[0].get();
var vector2: Vec4 = inputs[1].get();
if (vector1 == null || vector2 == null) return 0;
return iron.math.Vec4.distance(vector1, vector2);
}
}