godot-ios-plugins
godot-ios-plugins copied to clipboard
Add Godot 4.x camera module support with display rotation and CameraFeed formats
split from https://github.com/godotengine/godot/pull/106305 and merge from https://github.com/godotengine/godot/pull/106777
This PR adds comprehensive Godot 4.x support for the iOS camera module with the following improvements:
-
File separation for version-specific code: Split camera implementation into
camera_ios.mm(Godot 3.x) andcamera_ios_4x.mm(Godot 4.x) to reduce#ifdirective complexity -
Display rotation handling: Added
handle_display_rotation_change()support for Godot 4.6+ to properly handle camera feed orientation when device rotates -
CameraFeed format support: Implemented
get_formats()andset_format()for Godot 4.5+ allowing users to query and select camera formats -
Lazy feed initialization: For Godot 4.5+, camera feeds are now initialized via
set_monitoring_feeds()instead of constructor, following the new CameraServer pattern
Version Compatibility
- Godot 3.x: Uses
camera_ios.mm(unchanged behavior) - Godot 4.0-4.4: Basic camera functionality
- Godot 4.5+: CameraFeed format selection support
- Godot 4.6+: Display rotation change callback support
This pull request contains changes for the upcoming 4.6 release, so I'll mark it as ready for review once 4.6 is released.