Removed Look At noe since Armory added it.

This commit is contained in:
Maxim Stewart 2018-09-28 15:24:09 -05:00
parent 88612157cc
commit e7574b343d
4 changed files with 1 additions and 78 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

View File

@ -3,23 +3,10 @@ These are Armory Nodes I've Made...
<ul>
<li>Enhanced Transform</li>
<li>Look At</li> <span>In progress...</span>
</ul>
# To Do
---- I want to add and fix the following ----
<br/>
Add:
<ul>
<li>Near</li>
<li>Track To</li>
</ul>
Fix:
<ul>
<li>Look At</li>
</ul>
Presently Nothing.
# Images
![1 Enhanced Transform](Images/Enhanced_Transform.png)
![2 Look At](Images/Look_At.png)

View File

@ -1,49 +0,0 @@
package armory.logicnode;
import iron.object.Object;
import iron.math.Vec3;
import armory.trait.physics.RigidBody;
class LookAtNode extends LogicNode {
public function new(tree:LogicTree) {
super(tree);
}
override function run() {
var targeter:Object = inputs[1].get();
var target:Object = inputs[2].get();
var threeDeeTrack:Bool = inputs[3].get();
var targeterRot:Vec3;
var targetLoc:Vec3;
if (targeter == null || target == null) return;
targeterRot = new Vec3(targeter.transform.rot.x,
targeter.transform.rot.y,
targeter.transform.rot.z);
targetLoc = new Vec3(target.transform.loc.x,
target.transform.loc.y,
target.transform.loc.z);
var newZLook = targeterRot.z + (targeterRot.z - (targetLoc.y / targetLoc.x));
if ( threeDeeTrack == true ) {
targeter.transform
.setRotation(targeterRot.x, targetLoc.y, newZLook);
} else {
targeter.transform
.setRotation(targeterRot.x, targeterRot.y, newZLook);
}
#if arm_physics
var rigidBody = targeter.getTrait(RigidBody);
if (rigidBody != null) rigidBody.syncTransform();
#end
super.run();
}
}

View File

@ -16,24 +16,9 @@ class EnhancedTransformNode(Node, ArmLogicTreeNode):
self.inputs.new('NodeSocketVector', 'Scale')
self.outputs.new('ArmNodeSocketAction', 'Out')
class LookAtNode(Node, ArmLogicTreeNode):
'''LookAtNode'''
bl_idname = 'LNLookAtNode'
bl_label = 'Look At'
bl_icon = 'GAME'
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.inputs.new('ArmNodeSocketObject', 'Object')
self.inputs.new('NodeSocketBool', '3D Track')
self.outputs.new('ArmNodeSocketAction', 'Out')
def register():
# Add custom nodes
add_node(EnhancedTransformNode, category='Action')
add_node(LookAtNode, category='Action')
# Register newly added nodes
arm.nodes_logic.register_nodes()