armory/Sources/armory/logicnode/SetCameraNode.hx

21 lines
361 B
Haxe
Raw Permalink Normal View History

2018-11-10 20:39:51 +01:00
package armory.logicnode;
import iron.object.CameraObject;
class SetCameraNode extends LogicNode {
2019-12-19 23:54:08 +01:00
public function new(tree: LogicTree) {
2018-11-10 20:39:51 +01:00
super(tree);
}
2019-12-19 23:54:08 +01:00
override function run(from: Int) {
var camera: CameraObject = inputs[1].get();
2018-11-10 20:39:51 +01:00
if (camera == null) return;
camera.buildProjection();
iron.Scene.active.camera = camera;
runOutput(0);
}
}