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

Fixing mistakes + abort for Lerp node #15

Merged
merged 1 commit into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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