Apply checkstyle
This commit is contained in:
parent
fe3fa62a97
commit
db4f0cc107
|
@ -2,22 +2,22 @@ package armory.data;
|
||||||
|
|
||||||
class Config {
|
class Config {
|
||||||
|
|
||||||
public static var raw:TConfig = null;
|
public static var raw: TConfig = null;
|
||||||
public static var configLoaded = false;
|
public static var configLoaded = false;
|
||||||
|
|
||||||
public static function load(done:Void->Void) {
|
public static function load(done: Void->Void) {
|
||||||
try {
|
try {
|
||||||
iron.data.Data.getBlob('config.arm', function(blob:kha.Blob) {
|
iron.data.Data.getBlob("config.arm", function(blob: kha.Blob) {
|
||||||
configLoaded = true;
|
configLoaded = true;
|
||||||
raw = haxe.Json.parse(blob.toString());
|
raw = haxe.Json.parse(blob.toString());
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(e:Dynamic) { done(); }
|
catch (e: Dynamic) { done(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function save() {
|
public static function save() {
|
||||||
var path = iron.data.Data.dataPath + 'config.arm';
|
var path = iron.data.Data.dataPath + "config.arm";
|
||||||
var bytes = haxe.io.Bytes.ofString(haxe.Json.stringify(raw));
|
var bytes = haxe.io.Bytes.ofString(haxe.Json.stringify(raw));
|
||||||
#if kha_krom
|
#if kha_krom
|
||||||
Krom.fileSaveBytes(path, bytes.getData());
|
Krom.fileSaveBytes(path, bytes.getData());
|
||||||
|
@ -30,23 +30,23 @@ class Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef TConfig = {
|
typedef TConfig = {
|
||||||
@:optional var debug_console:Null<Bool>;
|
@:optional var debug_console: Null<Bool>;
|
||||||
@:optional var window_mode:Null<Int>; // window, fullscreen
|
@:optional var window_mode: Null<Int>; // window, fullscreen
|
||||||
@:optional var window_w:Null<Int>;
|
@:optional var window_w: Null<Int>;
|
||||||
@:optional var window_h:Null<Int>;
|
@:optional var window_h: Null<Int>;
|
||||||
@:optional var window_resizable:Null<Bool>;
|
@:optional var window_resizable: Null<Bool>;
|
||||||
@:optional var window_maximizable:Null<Bool>;
|
@:optional var window_maximizable: Null<Bool>;
|
||||||
@:optional var window_minimizable:Null<Bool>;
|
@:optional var window_minimizable: Null<Bool>;
|
||||||
@:optional var window_vsync:Null<Bool>;
|
@:optional var window_vsync: Null<Bool>;
|
||||||
@:optional var window_msaa:Null<Int>;
|
@:optional var window_msaa: Null<Int>;
|
||||||
@:optional var window_scale:Null<Float>;
|
@:optional var window_scale: Null<Float>;
|
||||||
@:optional var rp_supersample:Null<Float>;
|
@:optional var rp_supersample: Null<Float>;
|
||||||
@:optional var rp_shadowmap_cube:Null<Int>; // size
|
@:optional var rp_shadowmap_cube: Null<Int>; // size
|
||||||
@:optional var rp_shadowmap_cascade:Null<Int>; // size for single cascade
|
@:optional var rp_shadowmap_cascade: Null<Int>; // size for single cascade
|
||||||
@:optional var rp_ssgi:Null<Bool>;
|
@:optional var rp_ssgi: Null<Bool>;
|
||||||
@:optional var rp_ssr:Null<Bool>;
|
@:optional var rp_ssr: Null<Bool>;
|
||||||
@:optional var rp_bloom:Null<Bool>;
|
@:optional var rp_bloom: Null<Bool>;
|
||||||
@:optional var rp_motionblur:Null<Bool>;
|
@:optional var rp_motionblur: Null<Bool>;
|
||||||
@:optional var rp_gi:Null<Bool>; // voxelao
|
@:optional var rp_gi: Null<Bool>; // voxelao
|
||||||
@:optional var rp_dynres:Null<Bool>; // dynamic resolution scaling
|
@:optional var rp_dynres: Null<Bool>; // dynamic resolution scaling
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,9 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ActiveCameraNode extends LogicNode {
|
class ActiveCameraNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic { return iron.Scene.active.camera; }
|
override function get(from: Int): Dynamic { return iron.Scene.active.camera; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,9 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ActiveSceneNode extends LogicNode {
|
class ActiveSceneNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic { return iron.Scene.active.raw.name; }
|
override function get(from: Int): Dynamic { return iron.Scene.active.raw.name; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
||||||
|
|
||||||
class AddGroupNode extends LogicNode {
|
class AddGroupNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var groupName:String = inputs[1].get();
|
var groupName: String = inputs[1].get();
|
||||||
var raw = iron.Scene.active.raw;
|
var raw = iron.Scene.active.raw;
|
||||||
|
|
||||||
// Already exists
|
// Already exists
|
||||||
for (g in raw.groups) {
|
for (g in raw.groups) {
|
||||||
if (g.name == groupName) {
|
if (g.name == groupName) {
|
||||||
|
|
|
@ -4,14 +4,14 @@ import iron.object.Object;
|
||||||
|
|
||||||
class AddTraitNode extends LogicNode {
|
class AddTraitNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var trait:Dynamic = inputs[2].get();
|
var trait: Dynamic = inputs[2].get();
|
||||||
|
|
||||||
if (object == null || trait == null) return;
|
if (object == null || trait == null) return;
|
||||||
|
|
||||||
object.addTrait(trait);
|
object.addTrait(trait);
|
||||||
|
|
|
@ -4,11 +4,11 @@ class AlternateNode extends LogicNode {
|
||||||
|
|
||||||
var b = true;
|
var b = true;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
b ? runOutput(0) : runOutput(1);
|
b ? runOutput(0) : runOutput(1);
|
||||||
b = !b;
|
b = !b;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,19 @@ package armory.logicnode;
|
||||||
|
|
||||||
class AnimActionNode extends LogicNode {
|
class AnimActionNode extends LogicNode {
|
||||||
|
|
||||||
public var value:String;
|
public var value: String;
|
||||||
|
|
||||||
public function new(tree:LogicTree, value = "") {
|
public function new(tree: LogicTree, value = "") {
|
||||||
super(tree);
|
super(tree);
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (inputs.length > 0) return inputs[0].get();
|
if (inputs.length > 0) return inputs[0].get();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
if (inputs.length > 0) inputs[0].set(value);
|
if (inputs.length > 0) inputs[0].set(value);
|
||||||
else this.value = value;
|
else this.value = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
||||||
|
|
||||||
class AnimationStateNode extends LogicNode {
|
class AnimationStateNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
var animation = object.animation;
|
var animation = object.animation;
|
||||||
|
|
|
@ -8,13 +8,13 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class AppendTransformNode extends LogicNode {
|
class AppendTransformNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var matrix:Mat4 = inputs[2].get();
|
var matrix: Mat4 = inputs[2].get();
|
||||||
|
|
||||||
if (object == null || matrix == null) return;
|
if (object == null || matrix == null) return;
|
||||||
|
|
||||||
|
|
|
@ -6,20 +6,20 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class ApplyForceAtLocationNode extends LogicNode {
|
class ApplyForceAtLocationNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var force:Vec4 = inputs[2].get();
|
var force: Vec4 = inputs[2].get();
|
||||||
var location:Vec4 = inputs[3].get();
|
var location: Vec4 = inputs[3].get();
|
||||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||||
|
|
||||||
if (object == null || force == null || location == null) return;
|
if (object == null || force == null || location == null) return;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rb:RigidBody = object.getTrait(RigidBody);
|
var rb: RigidBody = object.getTrait(RigidBody);
|
||||||
if (!local) {
|
if (!local) {
|
||||||
rb.applyForce(force, location);
|
rb.applyForce(force, location);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,19 +6,19 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class ApplyForceNode extends LogicNode {
|
class ApplyForceNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var force:Vec4 = inputs[2].get();
|
var force: Vec4 = inputs[2].get();
|
||||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||||
|
|
||||||
if (object == null || force == null) return;
|
if (object == null || force == null) return;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rb:RigidBody = object.getTrait(RigidBody);
|
var rb: RigidBody = object.getTrait(RigidBody);
|
||||||
if (!local) {
|
if (!local) {
|
||||||
rb.applyForce(force);
|
rb.applyForce(force);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,20 +6,20 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class ApplyImpulseAtLocationNode extends LogicNode {
|
class ApplyImpulseAtLocationNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var impulse:Vec4 = inputs[2].get();
|
var impulse: Vec4 = inputs[2].get();
|
||||||
var location:Vec4 = inputs[3].get();
|
var location: Vec4 = inputs[3].get();
|
||||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||||
|
|
||||||
if (object == null || impulse == null || location == null) return;
|
if (object == null || impulse == null || location == null) return;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rb:RigidBody = object.getTrait(RigidBody);
|
var rb: RigidBody = object.getTrait(RigidBody);
|
||||||
if (!local) {
|
if (!local) {
|
||||||
rb.applyImpulse(impulse, location); }
|
rb.applyImpulse(impulse, location); }
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -6,19 +6,19 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class ApplyImpulseNode extends LogicNode {
|
class ApplyImpulseNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var impulse:Vec4 = inputs[2].get();
|
var impulse: Vec4 = inputs[2].get();
|
||||||
var local:Bool = inputs.length > 3 ? inputs[3].get() : false;
|
var local: Bool = inputs.length > 3 ? inputs[3].get() : false;
|
||||||
|
|
||||||
if (object == null || impulse == null) return;
|
if (object == null || impulse == null) return;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rb:RigidBody = object.getTrait(RigidBody);
|
var rb: RigidBody = object.getTrait(RigidBody);
|
||||||
if (!local) {
|
if (!local) {
|
||||||
rb.applyImpulse(impulse);
|
rb.applyImpulse(impulse);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,18 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class ApplyTorqueImpulseNode extends LogicNode {
|
class ApplyTorqueImpulseNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var torque:Vec4 = inputs[2].get();
|
var torque: Vec4 = inputs[2].get();
|
||||||
|
|
||||||
if (object == null || torque == null) return;
|
if (object == null || torque == null) return;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rb:RigidBody = object.getTrait(RigidBody);
|
var rb: RigidBody = object.getTrait(RigidBody);
|
||||||
rb.applyTorqueImpulse(torque);
|
rb.applyTorqueImpulse(torque);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
|
@ -6,18 +6,18 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class ApplyTorqueNode extends LogicNode {
|
class ApplyTorqueNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var torque:Vec4 = inputs[2].get();
|
var torque: Vec4 = inputs[2].get();
|
||||||
|
|
||||||
if (object == null || torque == null) return;
|
if (object == null || torque == null) return;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rb:RigidBody = object.getTrait(RigidBody);
|
var rb: RigidBody = object.getTrait(RigidBody);
|
||||||
rb.applyTorque(torque);
|
rb.applyTorque(torque);
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayAddNode extends LogicNode {
|
class ArrayAddNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var ar:Array<Dynamic> = inputs[1].get();
|
var ar: Array<Dynamic> = inputs[1].get();
|
||||||
if (ar == null) return;
|
if (ar == null) return;
|
||||||
|
|
||||||
if (inputs.length > 2) {
|
if (inputs.length > 2) {
|
||||||
for (i in 2...inputs.length) {
|
for (i in 2...inputs.length) {
|
||||||
var value:Dynamic = inputs[i].get();
|
var value: Dynamic = inputs[i].get();
|
||||||
ar.push(value);
|
ar.push(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayAddUniqueNode extends LogicNode {
|
class ArrayAddUniqueNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var ar:Array<Dynamic> = inputs[1].get();
|
var ar: Array<Dynamic> = inputs[1].get();
|
||||||
if (ar == null) return;
|
if (ar == null) return;
|
||||||
|
|
||||||
if (inputs.length > 2) {
|
if (inputs.length > 2) {
|
||||||
for (i in 2...inputs.length) {
|
for (i in 2...inputs.length) {
|
||||||
var value:Dynamic = inputs[i].get();
|
var value: Dynamic = inputs[i].get();
|
||||||
if (ar.indexOf(value) == -1) ar.push(value);
|
if (ar.indexOf(value) == -1) ar.push(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayBooleanNode extends LogicNode {
|
class ArrayBooleanNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<Bool> = [];
|
public var value: Array<Bool> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:Bool = inp.get();
|
var val: Bool = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class ArrayBooleanNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,18 @@ import iron.math.Vec4;
|
||||||
|
|
||||||
class ArrayColorNode extends LogicNode {
|
class ArrayColorNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<Vec4> = [];
|
public var value: Array<Vec4> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:Vec4 = inp.get();
|
var val: Vec4 = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class ArrayColorNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayFloatNode extends LogicNode {
|
class ArrayFloatNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<Float> = [];
|
public var value: Array<Float> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:Float = inp.get();
|
var val: Float = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class ArrayFloatNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,15 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayGetNode extends LogicNode {
|
class ArrayGetNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var ar:Array<Dynamic> = inputs[0].get();
|
var ar: Array<Dynamic> = inputs[0].get();
|
||||||
if (ar == null) return null;
|
if (ar == null) return null;
|
||||||
|
|
||||||
var i:Int = inputs[1].get();
|
var i: Int = inputs[1].get();
|
||||||
if (i < 0) i = ar.length + i;
|
if (i < 0) i = ar.length + i;
|
||||||
if (i < 0 || i > ar.length - 1) {
|
if (i < 0 || i > ar.length - 1) {
|
||||||
var className = Type.getClassName(Type.getClass(tree));
|
var className = Type.getClassName(Type.getClass(tree));
|
||||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayInArrayNode extends LogicNode {
|
class ArrayInArrayNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var array:Array<Dynamic> = inputs[0].get();
|
var array: Array<Dynamic> = inputs[0].get();
|
||||||
var value:Dynamic = inputs[1].get();
|
var value: Dynamic = inputs[1].get();
|
||||||
|
|
||||||
return ! (array.indexOf(value) == -1);
|
return array.indexOf(value) != -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayIntegerNode extends LogicNode {
|
class ArrayIntegerNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<Int> = [];
|
public var value: Array<Int> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:Int = inp.get();
|
var val: Int = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class ArrayIntegerNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayLengthNode extends LogicNode {
|
class ArrayLengthNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var ar:Array<Dynamic> = inputs[0].get();
|
var ar: Array<Dynamic> = inputs[0].get();
|
||||||
return ar != null ? ar.length : 0;
|
return ar != null ? ar.length : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayLoopNode extends LogicNode {
|
class ArrayLoopNode extends LogicNode {
|
||||||
|
|
||||||
var value:Dynamic;
|
var value: Dynamic;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var ar:Array<Dynamic> = inputs[1].get();
|
var ar: Array<Dynamic> = inputs[1].get();
|
||||||
if (ar == null) return;
|
if (ar == null) return;
|
||||||
|
|
||||||
for (val in ar) {
|
for (val in ar) {
|
||||||
|
@ -24,7 +24,7 @@ class ArrayLoopNode extends LogicNode {
|
||||||
runOutput(2);
|
runOutput(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayNode extends LogicNode {
|
class ArrayNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<Dynamic> = [];
|
public var value: Array<Dynamic> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:Dynamic = inp.get();
|
var val: Dynamic = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class ArrayNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,18 @@ import iron.object.Object;
|
||||||
|
|
||||||
class ArrayObjectNode extends LogicNode {
|
class ArrayObjectNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<Object> = [];
|
public var value: Array<Object> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:Object = inp.get();
|
var val: Object = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class ArrayObjectNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayPopNode extends LogicNode {
|
class ArrayPopNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var ar:Array<Dynamic> = inputs[0].get();
|
var ar: Array<Dynamic> = inputs[0].get();
|
||||||
if (ar == null) return null;
|
if (ar == null) return null;
|
||||||
|
|
||||||
return ar.pop();
|
return ar.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayRemoveNode extends LogicNode {
|
class ArrayRemoveNode extends LogicNode {
|
||||||
|
|
||||||
var removedValue:Dynamic = null;
|
var removedValue: Dynamic = null;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var ar:Array<Dynamic> = inputs[1].get();
|
var ar: Array<Dynamic> = inputs[1].get();
|
||||||
if (ar == null) return;
|
if (ar == null) return;
|
||||||
|
|
||||||
var i:Int = inputs[2].get();
|
var i: Int = inputs[2].get();
|
||||||
if (i < 0) i = ar.length + i;
|
if (i < 0) i = ar.length + i;
|
||||||
|
|
||||||
removedValue = ar[i];
|
removedValue = ar[i];
|
||||||
|
@ -21,7 +21,7 @@ class ArrayRemoveNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return removedValue;
|
return removedValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,17 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayRemoveValueNode extends LogicNode {
|
class ArrayRemoveValueNode extends LogicNode {
|
||||||
|
|
||||||
var removedValue:Dynamic = null;
|
var removedValue: Dynamic = null;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var ar:Array<Dynamic> = inputs[1].get();
|
var ar: Array<Dynamic> = inputs[1].get();
|
||||||
if (ar == null) return;
|
if (ar == null) return;
|
||||||
|
|
||||||
var val:Dynamic = inputs[2].get();
|
var val: Dynamic = inputs[2].get();
|
||||||
|
|
||||||
removedValue = val;
|
removedValue = val;
|
||||||
ar.remove(val);
|
ar.remove(val);
|
||||||
|
@ -20,7 +20,7 @@ class ArrayRemoveValueNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return removedValue;
|
return removedValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,16 +2,16 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArraySetNode extends LogicNode {
|
class ArraySetNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var ar:Array<Dynamic> = inputs[1].get();
|
var ar: Array<Dynamic> = inputs[1].get();
|
||||||
if (ar == null) return;
|
if (ar == null) return;
|
||||||
|
|
||||||
var i:Int = inputs[2].get();
|
var i: Int = inputs[2].get();
|
||||||
var value:Dynamic = inputs[3].get();
|
var value: Dynamic = inputs[3].get();
|
||||||
|
|
||||||
if (i < 0) ar[ar.length + i] = value;
|
if (i < 0) ar[ar.length + i] = value;
|
||||||
else ar[i] = value;
|
else ar[i] = value;
|
||||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayShiftNode extends LogicNode {
|
class ArrayShiftNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var ar:Array<Dynamic> = inputs[0].get();
|
var ar: Array<Dynamic> = inputs[0].get();
|
||||||
if (ar == null) return null;
|
if (ar == null) return null;
|
||||||
|
|
||||||
return ar.shift();
|
return ar.shift();
|
||||||
|
|
|
@ -2,16 +2,16 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArraySliceNode extends LogicNode {
|
class ArraySliceNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var ar:Array<Dynamic> = inputs[0].get();
|
var ar: Array<Dynamic> = inputs[0].get();
|
||||||
if (ar == null) return null;
|
if (ar == null) return null;
|
||||||
|
|
||||||
var i:Int = inputs[1].get();
|
var i: Int = inputs[1].get();
|
||||||
var end:Int = inputs[2].get();
|
var end: Int = inputs[2].get();
|
||||||
|
|
||||||
if (i < 0) i = ar.length + i;
|
if (i < 0) i = ar.length + i;
|
||||||
if (i < 0 || i > ar.length - 1) {
|
if (i < 0 || i > ar.length - 1) {
|
||||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArraySpliceNode extends LogicNode {
|
class ArraySpliceNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var ar:Array<Dynamic> = inputs[1].get();
|
var ar: Array<Dynamic> = inputs[1].get();
|
||||||
if (ar == null) return;
|
if (ar == null) return;
|
||||||
|
|
||||||
var i = inputs[2].get();
|
var i = inputs[2].get();
|
||||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ArrayStringNode extends LogicNode {
|
class ArrayStringNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<String> = [];
|
public var value: Array<String> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:String = inp.get();
|
var val: String = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ class ArrayStringNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,18 @@ import iron.math.Vec4;
|
||||||
|
|
||||||
class ArrayVectorNode extends LogicNode {
|
class ArrayVectorNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Array<Vec4> = [];
|
public var value: Array<Vec4> = [];
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
for (inp in inputs) {
|
for (inp in inputs) {
|
||||||
var val:Vec4 = inp.get();
|
var val: Vec4 = inp.get();
|
||||||
value.push(val);
|
value.push(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ class ArrayVectorNode extends LogicNode {
|
||||||
return from == 0 ? value : value.length;
|
return from == 0 ? value : value.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,16 +4,16 @@ import iron.object.Object;
|
||||||
|
|
||||||
class BlendActionNode extends LogicNode {
|
class BlendActionNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var action1:String = inputs[2].get();
|
var action1: String = inputs[2].get();
|
||||||
var action2:String = inputs[3].get();
|
var action2: String = inputs[3].get();
|
||||||
var blendFactor:Float = inputs[4].get();
|
var blendFactor: Float = inputs[4].get();
|
||||||
|
|
||||||
if (object == null) return;
|
if (object == null) return;
|
||||||
var animation = object.animation;
|
var animation = object.animation;
|
||||||
if (animation == null) animation = object.getParentArmature(object.name);
|
if (animation == null) animation = object.getParentArmature(object.name);
|
||||||
|
|
|
@ -7,21 +7,21 @@ import iron.math.Mat4;
|
||||||
class BoneFKNode extends LogicNode {
|
class BoneFKNode extends LogicNode {
|
||||||
|
|
||||||
var notified = false;
|
var notified = false;
|
||||||
var m:Mat4 = null;
|
var m: Mat4 = null;
|
||||||
var w:Mat4 = null;
|
var w: Mat4 = null;
|
||||||
var iw = Mat4.identity();
|
var iw = Mat4.identity();
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
#if arm_skin
|
#if arm_skin
|
||||||
|
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var boneName:String = inputs[2].get();
|
var boneName: String = inputs[2].get();
|
||||||
var transform:Mat4 = inputs[3].get();
|
var transform: Mat4 = inputs[3].get();
|
||||||
|
|
||||||
if (object == null) return;
|
if (object == null) return;
|
||||||
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
|
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
|
||||||
if (anim == null) anim = object.getParentArmature(object.name);
|
if (anim == null) anim = object.getParentArmature(object.name);
|
||||||
|
@ -30,7 +30,7 @@ class BoneFKNode extends LogicNode {
|
||||||
var bone = anim.getBone(boneName);
|
var bone = anim.getBone(boneName);
|
||||||
m = anim.getBoneMat(bone);
|
m = anim.getBoneMat(bone);
|
||||||
w = anim.getAbsMat(bone);
|
w = anim.getAbsMat(bone);
|
||||||
|
|
||||||
function moveBone() {
|
function moveBone() {
|
||||||
m.setFrom(w);
|
m.setFrom(w);
|
||||||
m.multmat(transform);
|
m.multmat(transform);
|
||||||
|
|
|
@ -6,26 +6,26 @@ import iron.math.Vec4;
|
||||||
|
|
||||||
class BoneIKNode extends LogicNode {
|
class BoneIKNode extends LogicNode {
|
||||||
|
|
||||||
var goal:Vec4;
|
var goal: Vec4;
|
||||||
var notified = false;
|
var notified = false;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
#if arm_skin
|
#if arm_skin
|
||||||
|
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var boneName:String = inputs[2].get();
|
var boneName: String = inputs[2].get();
|
||||||
goal = inputs[3].get();
|
goal = inputs[3].get();
|
||||||
|
|
||||||
if (object == null || goal == null) return;
|
if (object == null || goal == null) return;
|
||||||
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
|
var anim = object.animation != null ? cast(object.animation, BoneAnimation) : null;
|
||||||
if (anim == null) anim = object.getParentArmature(object.name);
|
if (anim == null) anim = object.getParentArmature(object.name);
|
||||||
|
|
||||||
var bone = anim.getBone(boneName);
|
var bone = anim.getBone(boneName);
|
||||||
|
|
||||||
function solveBone() {
|
function solveBone() {
|
||||||
anim.solveIK(bone, goal);
|
anim.solveIK(bone, goal);
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,19 @@ package armory.logicnode;
|
||||||
|
|
||||||
class BooleanNode extends LogicNode {
|
class BooleanNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Bool;
|
public var value: Bool;
|
||||||
|
|
||||||
public function new(tree:LogicTree, value = false) {
|
public function new(tree: LogicTree, value = false) {
|
||||||
super(tree);
|
super(tree);
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (inputs.length > 0) return inputs[0].get();
|
if (inputs.length > 0) return inputs[0].get();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
if (inputs.length > 0) inputs[0].set(value);
|
if (inputs.length > 0) inputs[0].set(value);
|
||||||
else this.value = value;
|
else this.value = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
||||||
|
|
||||||
class BranchNode extends LogicNode {
|
class BranchNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var b:Bool = inputs[1].get();
|
var b: Bool = inputs[1].get();
|
||||||
b ? runOutput(0) : runOutput(1);
|
b ? runOutput(0) : runOutput(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,31 +4,32 @@ import iron.object.Object;
|
||||||
|
|
||||||
class CallFunctionNode extends LogicNode {
|
class CallFunctionNode extends LogicNode {
|
||||||
|
|
||||||
var result:Dynamic;
|
var result: Dynamic;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
if (object == null) return;
|
if (object == null) return;
|
||||||
|
|
||||||
var funName:String = inputs[2].get();
|
var funName: String = inputs[2].get();
|
||||||
var args:Array<Dynamic> = [];
|
var args: Array<Dynamic> = [];
|
||||||
|
|
||||||
for (i in 3...inputs.length) {
|
for (i in 3...inputs.length) {
|
||||||
args.push(inputs[i].get());
|
args.push(inputs[i].get());
|
||||||
}
|
}
|
||||||
|
|
||||||
var func = Reflect.field(object, funName);
|
var func = Reflect.field(object, funName);
|
||||||
if (func != null)
|
if (func != null) {
|
||||||
result = Reflect.callMethod(object, func, args);
|
result = Reflect.callMethod(object, func, args);
|
||||||
|
}
|
||||||
|
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,15 @@ package armory.logicnode;
|
||||||
|
|
||||||
class CallGroupNode extends LogicNode {
|
class CallGroupNode extends LogicNode {
|
||||||
|
|
||||||
public var property0:String;
|
public var property0: String;
|
||||||
var callTree:LogicTree = null;
|
var callTree: LogicTree = null;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
@:access(iron.Trait)
|
@:access(iron.Trait)
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
|
|
||||||
if (callTree == null) {
|
if (callTree == null) {
|
||||||
var classType = Type.resolveClass(property0);
|
var classType = Type.resolveClass(property0);
|
||||||
|
|
|
@ -2,16 +2,16 @@ package armory.logicnode;
|
||||||
|
|
||||||
class CallHaxeStaticNode extends LogicNode {
|
class CallHaxeStaticNode extends LogicNode {
|
||||||
|
|
||||||
var result:Dynamic;
|
var result: Dynamic;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
|
|
||||||
var path:String = inputs[1].get();
|
var path: String = inputs[1].get();
|
||||||
if (path != '') {
|
if (path != "") {
|
||||||
var dotIndex = path.lastIndexOf(".");
|
var dotIndex = path.lastIndexOf(".");
|
||||||
var classPath = path.substr(0, dotIndex);
|
var classPath = path.substr(0, dotIndex);
|
||||||
var classType = Type.resolveClass(classPath);
|
var classType = Type.resolveClass(classPath);
|
||||||
|
@ -22,7 +22,7 @@ class CallHaxeStaticNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetCheckboxNode extends LogicNode {
|
class CanvasGetCheckboxNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if arm_ui
|
#if arm_ui
|
||||||
override function get(from:Int) {
|
override function get(from: Int) {
|
||||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
if (canvas == null || !canvas.ready) return null;
|
if (canvas == null || !canvas.ready) return null;
|
||||||
|
|
||||||
|
|
||||||
// This Try/Catch hacks around an issue where the handles are
|
// This Try/Catch hacks around an issue where the handles are
|
||||||
// not created yet, even though canvas.ready is true.
|
// not created yet, even though canvas.ready is true.
|
||||||
try {
|
try {
|
||||||
return canvas.getHandle(inputs[0].get()).selected;
|
return canvas.getHandle(inputs[0].get()).selected;
|
||||||
} catch (e:Dynamic) {return null;}
|
}
|
||||||
|
catch (e: Dynamic) { return null; }
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetInputTextNode extends LogicNode {
|
class CanvasGetInputTextNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if arm_ui
|
#if arm_ui
|
||||||
override function get(from:Int) {
|
override function get(from: Int) {
|
||||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
if (canvas == null || !canvas.ready) return null;
|
if (canvas == null || !canvas.ready) return null;
|
||||||
|
|
||||||
|
|
||||||
// This Try/Catch hacks around an issue where the handles are
|
// This Try/Catch hacks around an issue where the handles are
|
||||||
// not created yet, even though canvas.ready is true.
|
// not created yet, even though canvas.ready is true.
|
||||||
try {
|
try {
|
||||||
return canvas.getHandle(inputs[0].get()).text;
|
return canvas.getHandle(inputs[0].get()).text;
|
||||||
} catch (e:Dynamic) {return null;}
|
}
|
||||||
|
catch (e: Dynamic) { return null; }
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetLocationNode extends LogicNode {
|
class CanvasGetLocationNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var x:Float;
|
var x: Float;
|
||||||
var y:Float;
|
var y: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class CanvasGetLocationNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
|
@ -33,7 +33,7 @@ class CanvasGetLocationNode extends LogicNode {
|
||||||
tree.notifyOnUpdate(update);
|
tree.notifyOnUpdate(update);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (from == 1) return x;
|
if (from == 1) return x;
|
||||||
else if (from == 2) return y;
|
else if (from == 2) return y;
|
||||||
else return 0;
|
else return 0;
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetPBNode extends LogicNode {
|
class CanvasGetPBNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var at:Int;
|
var at: Int;
|
||||||
var max:Int;
|
var max: Int;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class CanvasGetPBNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
|
@ -33,7 +33,7 @@ class CanvasGetPBNode extends LogicNode {
|
||||||
tree.notifyOnUpdate(update);
|
tree.notifyOnUpdate(update);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (from == 1) return at;
|
if (from == 1) return at;
|
||||||
else if (from == 2) return max;
|
else if (from == 2) return max;
|
||||||
else return 0;
|
else return 0;
|
||||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetPositionNode extends LogicNode {
|
class CanvasGetPositionNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if arm_ui
|
#if arm_ui
|
||||||
override function get(from:Int) {
|
override function get(from: Int) {
|
||||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
if (canvas == null || !canvas.ready) return null;
|
if (canvas == null || !canvas.ready) return null;
|
||||||
|
|
||||||
|
|
||||||
// This Try/Catch hacks around an issue where the handles are
|
// This Try/Catch hacks around an issue where the handles are
|
||||||
// not created yet, even though canvas.ready is true.
|
// not created yet, even though canvas.ready is true.
|
||||||
try {
|
try {
|
||||||
return canvas.getHandle(inputs[0].get()).position;
|
return canvas.getHandle(inputs[0].get()).position;
|
||||||
} catch (e:Dynamic) {return null;}
|
}
|
||||||
|
catch (e: Dynamic) { return null; }
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetRotationNode extends LogicNode {
|
class CanvasGetRotationNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var rad:Float;
|
var rad: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class CanvasGetRotationNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
|
@ -32,7 +32,7 @@ class CanvasGetRotationNode extends LogicNode {
|
||||||
tree.notifyOnUpdate(update);
|
tree.notifyOnUpdate(update);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (from == 1) return rad;
|
if (from == 1) return rad;
|
||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetScaleNode extends LogicNode {
|
class CanvasGetScaleNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var width:Int;
|
var width: Int;
|
||||||
var height:Int;
|
var height: Int;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class CanvasGetScaleNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
|
@ -33,7 +33,7 @@ class CanvasGetScaleNode extends LogicNode {
|
||||||
tree.notifyOnUpdate(update);
|
tree.notifyOnUpdate(update);
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (from == 1) return height;
|
if (from == 1) return height;
|
||||||
else if (from == 2) return width;
|
else if (from == 2) return width;
|
||||||
else return 0;
|
else return 0;
|
||||||
|
|
|
@ -5,24 +5,24 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasGetSliderNode extends LogicNode {
|
class CanvasGetSliderNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if arm_ui
|
#if arm_ui
|
||||||
override function get(from:Int) {
|
override function get(from: Int) {
|
||||||
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.getTrait(CanvasScript);
|
||||||
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
if (canvas == null) canvas = Scene.active.camera.getTrait(CanvasScript);
|
||||||
if (canvas == null || !canvas.ready) return null;
|
if (canvas == null || !canvas.ready) return null;
|
||||||
|
|
||||||
|
|
||||||
// This Try/Catch hacks around an issue where the handles are
|
// This Try/Catch hacks around an issue where the handles are
|
||||||
// not created yet, even though canvas.ready is true.
|
// not created yet, even though canvas.ready is true.
|
||||||
try {
|
try {
|
||||||
return canvas.getHandle(inputs[0].get()).value;
|
return canvas.getHandle(inputs[0].get()).value;
|
||||||
} catch (e:Dynamic) {return null;}
|
}
|
||||||
|
catch (e: Dynamic) { return null; }
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetAssetNode extends LogicNode {
|
class CanvasSetAssetNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var asset:String;
|
var asset: String;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class CanvasSetAssetNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
asset = Std.string(inputs[2].get());
|
asset = Std.string(inputs[2].get());
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetLocationNode extends LogicNode {
|
class CanvasSetLocationNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var newX:Float;
|
var newX: Float;
|
||||||
var newY:Float;
|
var newY: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class CanvasSetLocationNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
newX = inputs[2].get();
|
newX = inputs[2].get();
|
||||||
newY = inputs[3].get();
|
newY = inputs[3].get();
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetPBNode extends LogicNode {
|
class CanvasSetPBNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var newAt:Int;
|
var newAt: Int;
|
||||||
var newMax:Int;
|
var newMax: Int;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class CanvasSetPBNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
newAt = inputs[2].get();
|
newAt = inputs[2].get();
|
||||||
newMax = inputs[3].get();
|
newMax = inputs[3].get();
|
||||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetRotationNode extends LogicNode {
|
class CanvasSetRotationNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var rad:Float;
|
var rad: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class CanvasSetRotationNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
rad = inputs[2].get();
|
rad = inputs[2].get();
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetScaleNode extends LogicNode {
|
class CanvasSetScaleNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var height:Int;
|
var height: Int;
|
||||||
var width:Int;
|
var width: Int;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class CanvasSetScaleNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
height = inputs[2].get();
|
height = inputs[2].get();
|
||||||
width = inputs[3].get();
|
width = inputs[3].get();
|
||||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetSliderNode extends LogicNode {
|
class CanvasSetSliderNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var value:Float;
|
var value: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,12 +22,13 @@ class CanvasSetSliderNode extends LogicNode {
|
||||||
try {
|
try {
|
||||||
canvas.getHandle(element).value = value;
|
canvas.getHandle(element).value = value;
|
||||||
tree.removeUpdate(update);
|
tree.removeUpdate(update);
|
||||||
} catch (e:Dynamic) {}
|
}
|
||||||
|
catch (e: Dynamic) {}
|
||||||
|
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
value = inputs[2].get();
|
value = inputs[2].get();
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
|
|
|
@ -6,14 +6,14 @@ import kha.Color;
|
||||||
|
|
||||||
class CanvasSetTextColorNode extends LogicNode {
|
class CanvasSetTextColorNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var r:Float;
|
var r: Float;
|
||||||
var g:Float;
|
var g: Float;
|
||||||
var b:Float;
|
var b: Float;
|
||||||
var a:Float;
|
var a: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +22,11 @@ class CanvasSetTextColorNode extends LogicNode {
|
||||||
if (!canvas.ready) return;
|
if (!canvas.ready) return;
|
||||||
tree.removeUpdate(update);
|
tree.removeUpdate(update);
|
||||||
|
|
||||||
canvas.getElement(element).color_text = Color.fromFloats(r,g,b,a);
|
canvas.getElement(element).color_text = Color.fromFloats(r, g, b, a);
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
r = inputs[2].get();
|
r = inputs[2].get();
|
||||||
g = inputs[3].get();
|
g = inputs[3].get();
|
||||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetTextNode extends LogicNode {
|
class CanvasSetTextNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var text:String;
|
var text: String;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class CanvasSetTextNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
text = Std.string(inputs[2].get());
|
text = Std.string(inputs[2].get());
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
|
|
|
@ -5,11 +5,11 @@ import armory.trait.internal.CanvasScript;
|
||||||
|
|
||||||
class CanvasSetVisibleNode extends LogicNode {
|
class CanvasSetVisibleNode extends LogicNode {
|
||||||
|
|
||||||
var canvas:CanvasScript;
|
var canvas: CanvasScript;
|
||||||
var element:String;
|
var element: String;
|
||||||
var visible:Bool;
|
var visible: Bool;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class CanvasSetVisibleNode extends LogicNode {
|
||||||
else canvas.getElement(element).visible = false;
|
else canvas.getElement(element).visible = false;
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
element = inputs[1].get();
|
element = inputs[1].get();
|
||||||
visible = inputs[2].get();
|
visible = inputs[2].get();
|
||||||
canvas = Scene.active.getTrait(CanvasScript);
|
canvas = Scene.active.getTrait(CanvasScript);
|
||||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
||||||
|
|
||||||
class CaseStringNode extends LogicNode {
|
class CaseStringNode extends LogicNode {
|
||||||
|
|
||||||
public var property0:String;
|
public var property0: String;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var s:String = inputs[0].get();
|
var s: String = inputs[0].get();
|
||||||
if (s == null) return null;
|
if (s == null) return null;
|
||||||
|
|
||||||
switch (property0) {
|
switch (property0) {
|
||||||
|
|
|
@ -6,14 +6,14 @@ class CastPhysicsRayNode extends LogicNode {
|
||||||
|
|
||||||
var v = new Vec4();
|
var v = new Vec4();
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var vfrom:Vec4 = inputs[0].get();
|
var vfrom: Vec4 = inputs[0].get();
|
||||||
var vto:Vec4 = inputs[1].get();
|
var vto: Vec4 = inputs[1].get();
|
||||||
var mask:Int = inputs[2].get();
|
var mask: Int = inputs[2].get();
|
||||||
|
|
||||||
if (vfrom == null || vto == null) return null;
|
if (vfrom == null || vto == null) return null;
|
||||||
|
|
||||||
|
@ -26,13 +26,14 @@ class CastPhysicsRayNode extends LogicNode {
|
||||||
if (rb != null) return rb.object;
|
if (rb != null) return rb.object;
|
||||||
}
|
}
|
||||||
else if (from == 1) { // Hit
|
else if (from == 1) { // Hit
|
||||||
var hitPointWorld:Vec4 = rb != null ? physics.hitPointWorld : null;
|
var hitPointWorld: Vec4 = rb != null ? physics.hitPointWorld : null;
|
||||||
if (hitPointWorld != null) {
|
if (hitPointWorld != null) {
|
||||||
v.set(hitPointWorld.x, hitPointWorld.y, hitPointWorld.z, 1);
|
v.set(hitPointWorld.x, hitPointWorld.y, hitPointWorld.z, 1);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
} else { // Normal
|
}
|
||||||
var hitNormalWorld:Vec4 = rb != null ? physics.hitNormalWorld : null;
|
else { // Normal
|
||||||
|
var hitNormalWorld: Vec4 = rb != null ? physics.hitNormalWorld : null;
|
||||||
if (hitNormalWorld != null) {
|
if (hitNormalWorld != null) {
|
||||||
v.set(hitNormalWorld.x, hitNormalWorld.y, hitNormalWorld.z, 0);
|
v.set(hitNormalWorld.x, hitNormalWorld.y, hitNormalWorld.z, 0);
|
||||||
return v;
|
return v;
|
||||||
|
|
|
@ -4,14 +4,14 @@ import iron.object.Object;
|
||||||
|
|
||||||
class ClearParentNode extends LogicNode {
|
class ClearParentNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
var object:Object = inputs[1].get();
|
var object: Object = inputs[1].get();
|
||||||
var keepTransform:Bool = inputs[2].get();
|
var keepTransform: Bool = inputs[2].get();
|
||||||
|
|
||||||
if (object == null || object.parent == null) return;
|
if (object == null || object.parent == null) return;
|
||||||
|
|
||||||
object.parent.removeChild(object, keepTransform);
|
object.parent.removeChild(object, keepTransform);
|
||||||
|
|
|
@ -6,18 +6,18 @@ class ColorNode extends LogicNode {
|
||||||
|
|
||||||
var value = new Vec4();
|
var value = new Vec4();
|
||||||
|
|
||||||
public function new(tree:LogicTree, r = 0.8, g = 0.8, b = 0.8, a = 1.0) {
|
public function new(tree: LogicTree, r = 0.8, g = 0.8, b = 0.8, a = 1.0) {
|
||||||
super(tree);
|
super(tree);
|
||||||
|
|
||||||
value.set(r, g, b, a);
|
value.set(r, g, b, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (inputs.length > 0) return inputs[0].get();
|
if (inputs.length > 0) return inputs[0].get();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
if (inputs.length > 0) inputs[0].set(value);
|
if (inputs.length > 0) inputs[0].set(value);
|
||||||
else this.value = value;
|
else this.value = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,17 +4,17 @@ import iron.math.Vec4;
|
||||||
|
|
||||||
class CompareNode extends LogicNode {
|
class CompareNode extends LogicNode {
|
||||||
|
|
||||||
public var property0:String;
|
public var property0: String;
|
||||||
public var property1:Float;
|
public var property1: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Bool {
|
override function get(from: Int): Bool {
|
||||||
|
|
||||||
var v1:Dynamic = inputs[0].get();
|
var v1: Dynamic = inputs[0].get();
|
||||||
var v2:Dynamic = inputs[1].get();
|
var v2: Dynamic = inputs[1].get();
|
||||||
var cond = false;
|
var cond = false;
|
||||||
|
|
||||||
switch (property0) {
|
switch (property0) {
|
||||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ConcatenateStringNode extends LogicNode {
|
class ConcatenateStringNode extends LogicNode {
|
||||||
|
|
||||||
public var value:String;
|
public var value: String;
|
||||||
|
|
||||||
public function new(tree:LogicTree, value = "") {
|
public function new(tree: LogicTree, value = "") {
|
||||||
super(tree);
|
super(tree);
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
value = "";
|
value = "";
|
||||||
for (inp in inputs) value += inp.get();
|
for (inp in inputs) value += inp.get();
|
||||||
return value;
|
return value;
|
||||||
|
|
|
@ -2,15 +2,15 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ContainsStringNode extends LogicNode {
|
class ContainsStringNode extends LogicNode {
|
||||||
|
|
||||||
public var property0:String;
|
public var property0: String;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var s1:String = inputs[0].get();
|
var s1: String = inputs[0].get();
|
||||||
var s2:String = inputs[1].get();
|
var s2: String = inputs[1].get();
|
||||||
if (s1 == null || s2 == null) return null;
|
if (s1 == null || s2 == null) return null;
|
||||||
|
|
||||||
switch (property0) {
|
switch (property0) {
|
||||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
||||||
|
|
||||||
class DegToRadNode extends LogicNode {
|
class DegToRadNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var deg:Float = inputs[0].get();
|
var deg: Float = inputs[0].get();
|
||||||
return deg * 0.0174532924;
|
return deg * 0.0174532924;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@ class DisplayInfoNode extends LogicNode {
|
||||||
|
|
||||||
static inline var displayIndex = 0;
|
static inline var displayIndex = 0;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (from == 0) return kha.Display.all[displayIndex].width;
|
if (from == 0) return kha.Display.all[displayIndex].width;
|
||||||
else return kha.Display.all[displayIndex].height;
|
else return kha.Display.all[displayIndex].height;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,18 @@ package armory.logicnode;
|
||||||
|
|
||||||
class DynamicNode extends LogicNode {
|
class DynamicNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Dynamic;
|
public var value: Dynamic;
|
||||||
|
|
||||||
public function new(tree:LogicTree, value:Dynamic = null) {
|
public function new(tree: LogicTree, value: Dynamic = null) {
|
||||||
super(tree);
|
super(tree);
|
||||||
this.value = value == null ? {} : value;
|
this.value = value == null ? {} : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,14 @@ package armory.logicnode;
|
||||||
|
|
||||||
class ExpressionNode extends LogicNode {
|
class ExpressionNode extends LogicNode {
|
||||||
|
|
||||||
public var property0:String;
|
public var property0: String;
|
||||||
var result:Dynamic;
|
var result: Dynamic;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
|
|
||||||
#if hscript
|
#if hscript
|
||||||
var expr = property0;
|
var expr = property0;
|
||||||
|
@ -22,7 +22,7 @@ class ExpressionNode extends LogicNode {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,19 +2,19 @@ package armory.logicnode;
|
||||||
|
|
||||||
class FloatNode extends LogicNode {
|
class FloatNode extends LogicNode {
|
||||||
|
|
||||||
public var value:Float;
|
public var value: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree, value = 0.0) {
|
public function new(tree: LogicTree, value = 0.0) {
|
||||||
super(tree);
|
super(tree);
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
if (inputs.length > 0) return inputs[0].get();
|
if (inputs.length > 0) return inputs[0].get();
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
override function set(value:Dynamic) {
|
override function set(value: Dynamic) {
|
||||||
if (inputs.length > 0) inputs[0].set(value);
|
if (inputs.length > 0) inputs[0].set(value);
|
||||||
else this.value = value;
|
else this.value = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,20 +3,20 @@ package armory.logicnode;
|
||||||
class FunctionNode extends LogicNode {
|
class FunctionNode extends LogicNode {
|
||||||
|
|
||||||
@:allow(armory.logicnode.LogicTree)
|
@:allow(armory.logicnode.LogicTree)
|
||||||
var args:Array<Dynamic> = [];
|
var args: Array<Dynamic> = [];
|
||||||
@:allow(armory.logicnode.LogicTree)
|
@:allow(armory.logicnode.LogicTree)
|
||||||
var result:Dynamic;
|
var result: Dynamic;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
@:allow(armory.logicnode.LogicTree)
|
@:allow(armory.logicnode.LogicTree)
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int) {
|
override function get(from: Int): Dynamic {
|
||||||
return this.args[from - 1];
|
return this.args[from - 1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,13 @@ package armory.logicnode;
|
||||||
class FunctionOutputNode extends LogicNode {
|
class FunctionOutputNode extends LogicNode {
|
||||||
|
|
||||||
@:allow(armory.logicnode.LogicTree)
|
@:allow(armory.logicnode.LogicTree)
|
||||||
var result:Dynamic;
|
var result: Dynamic;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
this.result = inputs[1].get();
|
this.result = inputs[1].get();
|
||||||
runOutput(0);
|
runOutput(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,12 @@ class GamepadCoordsNode extends LogicNode {
|
||||||
|
|
||||||
var coords = new Vec4();
|
var coords = new Vec4();
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var num:Int = inputs[0].get();
|
var num: Int = inputs[0].get();
|
||||||
var gamepad = iron.system.Input.getGamepad(num);
|
var gamepad = iron.system.Input.getGamepad(num);
|
||||||
if (from == 0) {
|
if (from == 0) {
|
||||||
coords.x = gamepad.leftStick.x;
|
coords.x = gamepad.leftStick.x;
|
||||||
|
@ -32,9 +32,11 @@ class GamepadCoordsNode extends LogicNode {
|
||||||
coords.x = gamepad.rightStick.movementX;
|
coords.x = gamepad.rightStick.movementX;
|
||||||
coords.y = gamepad.rightStick.movementY;
|
coords.y = gamepad.rightStick.movementY;
|
||||||
return coords;
|
return coords;
|
||||||
} else if(from == 4) {
|
}
|
||||||
|
else if (from == 4) {
|
||||||
return gamepad.down("l2");
|
return gamepad.down("l2");
|
||||||
} else if(from == 5) {
|
}
|
||||||
|
else if (from == 5) {
|
||||||
return gamepad.down("r2");
|
return gamepad.down("r2");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -4,17 +4,16 @@ import iron.math.Vec4;
|
||||||
|
|
||||||
class GateNode extends LogicNode {
|
class GateNode extends LogicNode {
|
||||||
|
|
||||||
public var property0:String;
|
public var property0: String;
|
||||||
public var property1:Float;
|
public var property1: Float;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function run(from:Int) {
|
override function run(from: Int) {
|
||||||
|
var v1: Dynamic = inputs[1].get();
|
||||||
var v1:Dynamic = inputs[1].get();
|
var v2: Dynamic = inputs[2].get();
|
||||||
var v2:Dynamic = inputs[2].get();
|
|
||||||
var cond = false;
|
var cond = false;
|
||||||
|
|
||||||
switch (property0) {
|
switch (property0) {
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.CameraObject;
|
||||||
|
|
||||||
class GetCameraFovNode extends LogicNode {
|
class GetCameraFovNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var camera:CameraObject = inputs[0].get();
|
var camera: CameraObject = inputs[0].get();
|
||||||
|
|
||||||
if (camera == null) return 0.0;
|
if (camera == null) return 0.0;
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,15 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetChildNode extends LogicNode {
|
class GetChildNode extends LogicNode {
|
||||||
|
|
||||||
public var property0:String;
|
public var property0: String;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
var childName:String = inputs[1].get();
|
var childName: String = inputs[1].get();
|
||||||
|
|
||||||
if (object == null || childName == null) return null;
|
if (object == null || childName == null) return null;
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class GetChildNode extends LogicNode {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function contains(o:Object, name:String):Object {
|
function contains(o: Object, name: String): Object {
|
||||||
if (o.name.indexOf(name) >= 0) return o;
|
if (o.name.indexOf(name) >= 0) return o;
|
||||||
else {
|
else {
|
||||||
for (c in o.children) {
|
for (c in o.children) {
|
||||||
|
@ -41,7 +41,7 @@ class GetChildNode extends LogicNode {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function startsWith(o:Object, name:String):Object {
|
function startsWith(o: Object, name: String): Object {
|
||||||
if (StringTools.startsWith(o.name, name)) return o;
|
if (StringTools.startsWith(o.name, name)) return o;
|
||||||
else {
|
else {
|
||||||
for (c in o.children) {
|
for (c in o.children) {
|
||||||
|
@ -52,7 +52,7 @@ class GetChildNode extends LogicNode {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function endsWith(o:Object, name:String):Object {
|
function endsWith(o: Object, name: String): Object {
|
||||||
if (StringTools.endsWith(o.name, name)) return o;
|
if (StringTools.endsWith(o.name, name)) return o;
|
||||||
else {
|
else {
|
||||||
for (c in o.children) {
|
for (c in o.children) {
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetChildrenNode extends LogicNode {
|
class GetChildrenNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class GetContactsNode extends LogicNode {
|
class GetContactsNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
|
|
|
@ -4,13 +4,13 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetDistanceNode extends LogicNode {
|
class GetDistanceNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object1:Object = inputs[0].get();
|
var object1: Object = inputs[0].get();
|
||||||
var object2:Object = inputs[1].get();
|
var object2: Object = inputs[1].get();
|
||||||
|
|
||||||
if (object1 == null || object2 == null) return 0;
|
if (object1 == null || object2 == null) return 0;
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,12 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class GetFirstContactNode extends LogicNode {
|
class GetFirstContactNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
|
|
|
@ -1,17 +1,13 @@
|
||||||
package armory.logicnode;
|
package armory.logicnode;
|
||||||
|
|
||||||
import iron.object.Object;
|
|
||||||
import iron.math.Vec4;
|
|
||||||
import armory.trait.physics.RigidBody;
|
|
||||||
|
|
||||||
class GetGravityNode extends LogicNode {
|
class GetGravityNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var physics = armory.trait.physics.PhysicsWorld.active;
|
var physics = armory.trait.physics.PhysicsWorld.active;
|
||||||
return physics.world.getGravity();
|
return physics.world.getGravity();
|
||||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
||||||
|
|
||||||
class GetGroupNode extends LogicNode {
|
class GetGroupNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var groupName:String = inputs[0].get();
|
var groupName: String = inputs[0].get();
|
||||||
return iron.Scene.active.getGroup(groupName);
|
return iron.Scene.active.getGroup(groupName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,13 @@ package armory.logicnode;
|
||||||
|
|
||||||
class GetHaxePropertyNode extends LogicNode {
|
class GetHaxePropertyNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Dynamic = inputs[0].get();
|
var object: Dynamic = inputs[0].get();
|
||||||
var property:String = inputs[1].get();
|
var property: String = inputs[1].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetLocationNode extends LogicNode {
|
class GetLocationNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.MeshObject;
|
||||||
|
|
||||||
class GetMaterialNode extends LogicNode {
|
class GetMaterialNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:MeshObject = inputs[0].get();
|
var object: MeshObject = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.MeshObject;
|
||||||
|
|
||||||
class GetMeshNode extends LogicNode {
|
class GetMeshNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:MeshObject = inputs[0].get();
|
var object: MeshObject = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetNameNode extends LogicNode {
|
class GetNameNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return '';
|
if (object == null) return "";
|
||||||
|
|
||||||
return object.name;
|
return object.name;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,12 @@ package armory.logicnode;
|
||||||
|
|
||||||
class GetObjectNode extends LogicNode {
|
class GetObjectNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var objectName:String = inputs[0].get();
|
var objectName: String = inputs[0].get();
|
||||||
|
|
||||||
return iron.Scene.active.getChild(objectName);
|
return iron.Scene.active.getChild(objectName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetParentNode extends LogicNode {
|
class GetParentNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -4,13 +4,13 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetPropertyNode extends LogicNode {
|
class GetPropertyNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
var property:String = inputs[1].get();
|
var property: String = inputs[1].get();
|
||||||
|
|
||||||
if (from == 0) {
|
if (from == 0) {
|
||||||
if (object == null || object.properties == null) return null;
|
if (object == null || object.properties == null) return null;
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
package armory.logicnode;
|
package armory.logicnode;
|
||||||
|
|
||||||
import iron.object.Object;
|
import iron.object.Object;
|
||||||
import iron.math.Quat;
|
|
||||||
import iron.math.Vec3;
|
import iron.math.Vec3;
|
||||||
|
|
||||||
class GetRotationNode extends LogicNode {
|
class GetRotationNode extends LogicNode {
|
||||||
public function new(tree:LogicTree) {
|
|
||||||
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
if (object == null)
|
if (object == null) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var rot = object.transform.rot;
|
var rot = object.transform.rot;
|
||||||
switch (from) {
|
switch (from) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -21,8 +23,9 @@ class GetRotationNode extends LogicNode {
|
||||||
case 1:
|
case 1:
|
||||||
// vector
|
// vector
|
||||||
var sqrtW = Math.sqrt(1 - (rot.w * rot.w));
|
var sqrtW = Math.sqrt(1 - (rot.w * rot.w));
|
||||||
if (sqrtW == 0)
|
if (sqrtW == 0) {
|
||||||
return new Vec3(0, 0, 1);
|
return new Vec3(0, 0, 1);
|
||||||
|
}
|
||||||
return new Vec3(rot.x / sqrtW, rot.y / sqrtW, rot.z / sqrtW);
|
return new Vec3(rot.x / sqrtW, rot.y / sqrtW, rot.z / sqrtW);
|
||||||
case 2:
|
case 2:
|
||||||
// angle radians
|
// angle radians
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetScaleNode extends LogicNode {
|
class GetScaleNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,15 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetTraitNode extends LogicNode {
|
class GetTraitNode extends LogicNode {
|
||||||
|
|
||||||
var cname:Class<iron.Trait> = null;
|
var cname: Class<iron.Trait> = null;
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
var name:String = inputs[1].get();
|
var name: String = inputs[1].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetTransformNode extends LogicNode {
|
class GetTransformNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,16 @@ import armory.trait.physics.RigidBody;
|
||||||
|
|
||||||
class GetVelocityNode extends LogicNode {
|
class GetVelocityNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
if (object == null) return null;
|
if (object == null) return null;
|
||||||
|
|
||||||
#if arm_physics
|
#if arm_physics
|
||||||
var rb:RigidBody = object.getTrait(RigidBody);
|
var rb: RigidBody = object.getTrait(RigidBody);
|
||||||
|
|
||||||
if (rb != null) {
|
if (rb != null) {
|
||||||
if (from == 0) return rb.getLinearVelocity();
|
if (from == 0) return rb.getLinearVelocity();
|
||||||
|
|
|
@ -4,12 +4,12 @@ import iron.object.Object;
|
||||||
|
|
||||||
class GetVisibleNode extends LogicNode {
|
class GetVisibleNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
var object:Object = inputs[0].get();
|
var object: Object = inputs[0].get();
|
||||||
|
|
||||||
if (object == null) false;
|
if (object == null) false;
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@ package armory.logicnode;
|
||||||
|
|
||||||
class GlobalObjectNode extends LogicNode {
|
class GlobalObjectNode extends LogicNode {
|
||||||
|
|
||||||
public function new(tree:LogicTree) {
|
public function new(tree: LogicTree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
override function get(from:Int):Dynamic {
|
override function get(from: Int): Dynamic {
|
||||||
return iron.Scene.global;
|
return iron.Scene.global;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue