Hi there,
This does not work for me.
this.camera.addComponent(“camera”, { viewport: { x: 0.2, y: 0.2, w: 0.5, h: 0.5}});
Also CameraComponent does not seem to have a viewport in the documentation.
http://developer.playcanvas.com/en/api/pc.CameraComponent.html
However I can set the viewport on the camera if I use the editor, it is a property of the camera.
Also I can change the viewport programmaticallyI found by hacking but the object looks squashed horizontally and of course this looks like the wrong way to do it.
var c = this.camera.camera.data.camera;
c._rect.x = 0.5;
c._rect.width = 0.5;
Thanks,
Philip