I wish to achieve a middle mouse camera zoom using logic nodes. However, the mouse input seems very confusing.
The mouse node “middle” + “moved” hopefully refers to the middle mouse button movement, as there is a separate node for “pointer” or actual “mouse” movement. Hence the confusion with “Wheel Delta” in Mouse movement node with dark green output??
I can’t figure out the Node set up that could work as well as a relatively simple HAXE code:
package arm;
import iron.object.CameraObject;
class CameraControls extends iron.Trait {
public function new() {
super();
var mouse = iron.system.Input.getMouse();
notifyOnUpdate(function() {
var camera = cast(object.getChild("Camera"),CameraObject);
if(mouse.wheelDelta != 0)
camera.data.raw.fov += mouse.wheelDelta * 0.02;
camera.buildProjection();
});
}
}