Merge pull request #52285 from rxlecky/camera-override-cleanup

Clean up and simplify camera override API
This commit is contained in:
Thaddeus Crews 2025-09-30 18:35:11 -05:00
commit d86123870b
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
4 changed files with 241 additions and 328 deletions

View file

@ -49,12 +49,14 @@
<return type="Camera2D" />
<description>
Returns the currently active 2D camera. Returns [code]null[/code] if there are no active cameras.
[b]Note:[/b] If called while the [i]Camera Override[/i] system is active in editor, this will return the internally managed override camera. It is therefore advised to avoid caching the return value, or to check that the cached value is still a valid instance and is the current camera before use. See [method @GlobalScope.is_instance_valid] and [method Camera2D.is_current].
</description>
</method>
<method name="get_camera_3d" qualifiers="const">
<return type="Camera3D" />
<description>
Returns the currently active 3D camera.
Returns the currently active 3D camera. Returns [code]null[/code] if there are no active cameras.
[b]Note:[/b] If called while the [i]Camera Override[/i] system is active in editor, this will return the internally managed override camera. It is therefore advised to avoid caching the return value, or to check that the cached value is a valid instance and is the current camera before use. See [method @GlobalScope.is_instance_valid] and [member Camera3D.current].
</description>
</method>
<method name="get_canvas_cull_mask_bit" qualifiers="const">