Merge branch 'master' of https://github.com/armory3d/armory
This commit is contained in:
commit
b39a5af8bd
|
@ -5,6 +5,7 @@ import iron.math.Quat;
|
|||
|
||||
class LookAtNode extends LogicNode {
|
||||
|
||||
public var property0:String;
|
||||
var v1 = new Vec4();
|
||||
var v2 = new Vec4();
|
||||
var q = new Quat();
|
||||
|
@ -19,7 +20,20 @@ class LookAtNode extends LogicNode {
|
|||
|
||||
if (vfrom == null || vto == null) return null;
|
||||
|
||||
v1.set(0, 0, 1);
|
||||
switch (property0) {
|
||||
case "X":
|
||||
v1.set(1, 0, 0);
|
||||
case "-X":
|
||||
v1.set(-1, 0, 0);
|
||||
case "Y":
|
||||
v1.set(0, 1, 0);
|
||||
case "-Y":
|
||||
v1.set(0, -1, 0);
|
||||
case "Z":
|
||||
v1.set(0, 0, 1);
|
||||
case "-Z":
|
||||
v1.set(0, 0, -1);
|
||||
}
|
||||
v2.setFrom(vto).sub(vfrom).normalize();
|
||||
|
||||
q.fromTo(v1, v2);
|
||||
|
|
|
@ -9,9 +9,21 @@ class LookAtNode(Node, ArmLogicTreeNode):
|
|||
bl_label = 'Look At'
|
||||
bl_icon = 'QUESTION'
|
||||
|
||||
property0: EnumProperty(
|
||||
items = [('X', ' X', 'X'),
|
||||
('-X', '-X', '-X'),
|
||||
('Y', ' Y', 'Y'),
|
||||
('-Y', '-Y', '-Y'),
|
||||
('Z', ' Z', 'Z'),
|
||||
('-Z', '-Z', '-Z')],
|
||||
name='With', default='Z')
|
||||
|
||||
def init(self, context):
|
||||
self.inputs.new('NodeSocketVector', 'From Location')
|
||||
self.inputs.new('NodeSocketVector', 'To Location')
|
||||
self.outputs.new('NodeSocketVector', 'Rotation')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
add_node(LookAtNode, category='Value')
|
||||
|
|
|
@ -90,7 +90,7 @@ def parse_output(node, _con, _vert, _frag, _geom, _tesc, _tese, _parse_surface,
|
|||
if '_Emission' in wrd.world_defs:
|
||||
frag.write('emission = {0};'.format(out_emission))
|
||||
if parse_opacity:
|
||||
frag.write('opacity = {0};'.format(out_opacity))
|
||||
frag.write('opacity = {0} - 0.0002;'.format(out_opacity))
|
||||
|
||||
# Volume
|
||||
# parse_volume_input(node.inputs[1])
|
||||
|
|
Loading…
Reference in a new issue