Merge pull request #1219 from katharostech/feature/vector-math-distance

Add a Distance Measurement to the Vector Math Node
This commit is contained in:
Lubos Lenco 2019-03-13 20:03:14 +01:00 committed by GitHub
commit e43193bd79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -40,6 +40,8 @@ class VectorMathNode extends LogicNode {
v.z *= v2.z;
case "Length":
f = v.length();
case "Distance":
f = v.distanceTo(v2);
}
if (from == 0) return v;

View file

@ -17,6 +17,7 @@ class VectorMathNode(Node, ArmLogicTreeNode):
('Average', 'Average', 'Average'),
('Cross Product', 'Cross Product', 'Cross Product'),
('Length', 'Length', 'Length'),
('Distance', 'Distance', 'Distance'),
],
name='', default='Add')