Implement "reflect" operation for VectorMathNode

This commit is contained in:
Moritz Brückner 2020-06-04 22:19:02 +02:00
parent 12cdd57748
commit 2e398c96ba
2 changed files with 4 additions and 1 deletions

View file

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

View file

@ -18,9 +18,10 @@ class VectorMathNode(Node, ArmLogicTreeNode):
('Cross Product', 'Cross Product', 'Cross Product'),
('Length', 'Length', 'Length'),
('Distance', 'Distance', 'Distance'),
('Reflect', 'Reflect', 'Reflect'),
],
name='', default='Add')
def init(self, context):
self.inputs.new('NodeSocketVector', 'Vector')
self.inputs[-1].default_value = [0.5, 0.5, 0.5]