Documentation
¶
Overview ¶
The CameraServer keeps track of different cameras accessible in Godot. 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, the camera plugin from godot-ios-plugins is required.
Index ¶
- func AddFeed(feed CameraFeed.Instance)
- func Advanced() class
- func Feeds() []CameraFeed.Instance
- func GetFeed(index int) CameraFeed.Instance
- func GetFeedCount() int
- func MonitoringFeeds() bool
- func OnCameraFeedAdded(cb func(id int), flags ...Signal.Flags)
- func OnCameraFeedRemoved(cb func(id int), flags ...Signal.Flags)
- func OnCameraFeedsUpdated(cb func(), flags ...Signal.Flags)
- func RemoveFeed(feed CameraFeed.Instance)
- func SetMonitoringFeeds(value bool)
- type Extension
- type ID
- type Instance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Advanced ¶
func Advanced() class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
func GetFeed ¶
func GetFeed(index int) CameraFeed.Instance
Returns the CameraFeed corresponding to the camera with the given 'index'.
func MonitoringFeeds ¶
func MonitoringFeeds() bool
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 OnCameraFeedsUpdated signal.
func OnCameraFeedAdded ¶
Emitted when a CameraFeed is added (e.g. a webcam is plugged in).
func OnCameraFeedRemoved ¶
Emitted when a CameraFeed is removed (e.g. a webcam is unplugged).
func OnCameraFeedsUpdated ¶
Emitted when camera feeds are updated.
func SetMonitoringFeeds ¶
func SetMonitoringFeeds(value bool)
SetMonitoringFeeds sets the property returned by [IsMonitoringFeeds].
Types ¶
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.CameraServer
Instance of the class with convieniently typed arguments and results.