Files
armorpaint/Sources/arm/brushnode/VectorNode.hx
T

35 lines
730 B
Haxe
Raw Normal View History

2018-10-11 17:55:05 +02:00
package arm.brushnode;
2017-12-14 11:12:51 +01:00
import armory.logicnode.LogicNode;
import armory.logicnode.LogicTree;
2018-09-11 10:13:38 +02:00
import iron.math.Vec4;
2017-12-14 11:12:51 +01:00
2018-06-20 19:23:49 +02:00
@:keep
2017-12-14 11:12:51 +01:00
class VectorNode extends LogicNode {
var value = new Vec4();
public function new(tree:LogicTree, x:Null<Float> = null, y:Null<Float> = null, z:Null<Float> = null) {
super(tree);
if (x != null) {
addInput(new FloatNode(tree, x), 0);
addInput(new FloatNode(tree, y), 0);
addInput(new FloatNode(tree, z), 0);
}
}
override function get(from:Int):Dynamic {
value.x = inputs[0].get();
value.y = inputs[1].get();
value.z = inputs[2].get();
return value;
}
override function set(value:Dynamic) {
inputs[0].set(value.x);
inputs[1].set(value.y);
inputs[2].set(value.z);
}
}