Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from Simonrazer/master
Browse files Browse the repository at this point in the history
Fixing mistakes + abort  for Lerp node
  • Loading branch information
luboslenco authored Aug 15, 2018
2 parents 11684d4 + f728755 commit fd8a5d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Sources/armory/logicnode/LerpVectorsNode.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class LerpVectorsNode extends LogicNode {
var t=0.0;
var c:Float;
var f=0.0;
var abo:Bool;

public function new(tree:LogicTree) {
super(tree);
Expand All @@ -19,16 +20,21 @@ class LerpVectorsNode extends LogicNode {
v1 = inputs[1].get();
v2 = inputs[2].get();
t = inputs[3].get();
f = (t / iron.system.Time.delta);

f = (t / iron.system.Time.delta);
}

override function get(from:Int):Dynamic {
override function get(from:Int):Dynamic {
abo = inputs[4].get();
trace(t);
if (abo) {
t = 0;
}
if (v1==null) {
return null;
c=1;
}
if (t>=0) {
trace(t);
if (t>0) {
v.x=v1.x+((v2.x-v1.x)/f)*c;
v.y=v1.y+((v2.y-v1.y)/f)*c;
v.z=v1.z+((v2.z-v1.z)/f)*c;
Expand Down
1 change: 1 addition & 0 deletions blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def init(self, context):
self.inputs.new('NodeSocketVector', 'Starting Vector')
self.inputs.new('NodeSocketVector', 'End Vector')
self.inputs.new('NodeSocketFloat', 'Time For Change')
self.inputs.new('NodeSocketBool', 'Stop Interpolation')
self.outputs.new('NodeSocketVector', 'Vector')

def register():
Expand Down

0 comments on commit fd8a5d0

Please sign in to comment.