armory/Sources/armory/logicnode/SetCameraFovNode.hx

23 lines
393 B
Haxe
Raw Normal View History

2017-12-06 22:20:42 +01:00
package armory.logicnode;
import iron.object.CameraObject;
class SetCameraFovNode extends LogicNode {
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2017-12-06 22:20:42 +01:00
super(tree);
}
2019-12-19 23:54:08 +01:00
override function run(from: Int) {
var camera: CameraObject = inputs[1].get();
var fov: Float = inputs[2].get();
2017-12-06 22:20:42 +01:00
if (camera == null) return;
camera.data.raw.fov = fov;
camera.buildProjection();
2018-10-22 10:10:33 +02:00
runOutput(0);
2017-12-06 22:20:42 +01:00
}
}