Removed Look At noe since Armory added it.
This commit is contained in:
parent
88612157cc
commit
e7574b343d
Binary file not shown.
Before Width: | Height: | Size: 23 KiB |
15
README.md
15
README.md
|
@ -3,23 +3,10 @@ These are Armory Nodes I've Made...
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Enhanced Transform</li>
|
<li>Enhanced Transform</li>
|
||||||
<li>Look At</li> <span>In progress...</span>
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
# To Do
|
# To Do
|
||||||
---- I want to add and fix the following ----
|
Presently Nothing.
|
||||||
<br/>
|
|
||||||
Add:
|
|
||||||
<ul>
|
|
||||||
<li>Near</li>
|
|
||||||
<li>Track To</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
Fix:
|
|
||||||
<ul>
|
|
||||||
<li>Look At</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
![1 Enhanced Transform](Images/Enhanced_Transform.png)
|
![1 Enhanced Transform](Images/Enhanced_Transform.png)
|
||||||
![2 Look At](Images/Look_At.png)
|
|
||||||
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
15
blender.py
15
blender.py
|
@ -16,24 +16,9 @@ class EnhancedTransformNode(Node, ArmLogicTreeNode):
|
||||||
self.inputs.new('NodeSocketVector', 'Scale')
|
self.inputs.new('NodeSocketVector', 'Scale')
|
||||||
self.outputs.new('ArmNodeSocketAction', 'Out')
|
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():
|
def register():
|
||||||
# Add custom nodes
|
# Add custom nodes
|
||||||
add_node(EnhancedTransformNode, category='Action')
|
add_node(EnhancedTransformNode, category='Action')
|
||||||
add_node(LookAtNode, category='Action')
|
|
||||||
|
|
||||||
# Register newly added nodes
|
# Register newly added nodes
|
||||||
arm.nodes_logic.register_nodes()
|
arm.nodes_logic.register_nodes()
|
||||||
|
|
Loading…
Reference in New Issue