17daabeb29
- Made so all nodes outputting a quaternion object also output it as a XYZ (vector) + W (float) combination - Modernized the interface of the "Action/Rotate Object" node, to align on the newer "Action/Set Rotation" node interface ("Action/Rotate Object Along Axis" is now depreciated, but still usable) - Fixed a blender-side-only bug with the "Logic/Switch" node (...which technically could have lead to a compile-time problem if exploited the right way) - Fixed a bug on the "Action/Set Rotation" node: now, quaternion input is automatically normalized in order to avoid accidental scaling - Added a "Value/Separate Quaternion" node - Made so the names of some sockets change in the "Set Rotation" and "Rotate Object" nodes, so they adapt to those nodes' input types. (Same thing with "Value/Vector From Transform"'s output type)
24 lines
418 B
Haxe
24 lines
418 B
Haxe
package armory.logicnode;
|
|
|
|
import iron.math.Quat;
|
|
import kha.FastFloat;
|
|
|
|
class SeparateQuaternionNode extends LogicNode {
|
|
var q:Quat = null;
|
|
|
|
public function new(tree:LogicTree) { super(tree); }
|
|
|
|
override function get(from:Int):Dynamic{
|
|
q = inputs[0].get();
|
|
if (from==0)
|
|
return q.x;
|
|
else if (from==1)
|
|
return q.y;
|
|
else if (from==2)
|
|
return q.z;
|
|
else
|
|
return q.w;
|
|
|
|
}
|
|
}
|