mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Cleanup and simplify camera override API
- Harmonise the camera override 2D and 3D APIs - Switch to using Camera2D/3D nodes to provide override functionality. This makes for simpler code, gets rid of much of copy-pasted camera code and makes code that relies on current viewport camera such as VisibleOnScreenNotifiers and object picking work out of the box. - Make camera override code only accesible within DEBUG_ENABLED builds
This commit is contained in:
parent
825ef2387f
commit
02e1919514
4 changed files with 241 additions and 328 deletions
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue