CameraSystem
Inherits: Object
Description
Section titled “Description”Server keeping track of different cameras accessible in Orblit.
The CameraSystem keeps track of different cameras accessible in Orblit. These are external cameras such as webcams or the cameras on your phone.
It is notably used to provide AR modules with a video feed from the camera.
Note: This class is currently only implemented on Linux, Android, macOS, and iOS. On other platforms no CameraFeeds will be available. To get a CameraFeed on iOS, enable EditorExportPlatformIOS.modules/camera.
Properties
Section titled “Properties”| Type | Name | Default |
|---|---|---|
| bool | monitoring_feeds |
false |
Methods
Section titled “Methods”| Returns | Method |
|---|---|
| void | add_feed(feed: CameraFeed) |
| Array[CameraFeed] | feeds() |
| CameraFeed | get_feed(index: int) |
| int | get_feed_count() |
| void | remove_feed(feed: CameraFeed) |
Signals
Section titled “Signals”camera_feed_added
camera_feed_added(id: int)
Emitted when a CameraFeed is added (e.g. a webcam is plugged in).
camera_feed_removed
camera_feed_removed(id: int)
Emitted when a CameraFeed is removed (e.g. a webcam is unplugged).
camera_feeds_updated
camera_feeds_updated()
Emitted when camera feeds are updated.
Enumerations
Section titled “Enumerations”FeedImage
enum FeedImage
FEED_RGBA_IMAGE = 0
The RGBA camera image.
FEED_YCBCR_IMAGE = 0
The YCbCr camera image.
FEED_Y_IMAGE = 0
The Y component camera image.
FEED_CBCR_IMAGE = 1
The CbCr component camera image.
Property descriptions
Section titled “Property descriptions”monitoring_feeds
bool monitoring_feeds = false
If true, the server is actively monitoring available camera feeds.
This has a performance cost, so only set it to true when you’re actively accessing the camera.
Note: After setting it to true, you can receive updated camera feeds through the camera_feeds_updated signal.
public override void OnStart(){ CameraSystem.CameraFeedsUpdated += OnCameraFeedsUpdated; CameraSystem.MonitoringFeeds = true;}
void OnCameraFeedsUpdated(){ var feeds = CameraSystem.Feeds();}Method descriptions
Section titled “Method descriptions”add_feed
void add_feed(feed: CameraFeed)
Adds the camera feed to the camera server.
feeds
Array[CameraFeed] feeds()
Returns an array of CameraFeeds.
get_feed
CameraFeed get_feed(index: int)
Returns the CameraFeed corresponding to the camera with the given index.
get_feed_count
int get_feed_count()
Returns the number of CameraFeeds registered.
remove_feed
void remove_feed(feed: CameraFeed)
Removes the specified camera feed.
