Commit graph

82 commits

Author SHA1 Message Date
Juan Linietsky eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
Juan Linietsky f14defb6f9 WIP CameraEffects implementation (bokeh not working for now) 2020-02-11 12:15:03 +01:00
lawnjelly eaf8e5ce52 Change CameraMatrix::get_viewport_size to get_viewport_half_extents
Fixes #26637.
Fixes #19900.

The viewport_size returned by get_viewport_size was previously incorrect, being half the correct value. The function is renamed to get_viewport_half_extents, and now returns a Vector2.

Code which called this function has also been modified accordingly.

This PR also fixes shadow culling when using ortho cameras, because the correct input for CameraMatrix::set_orthogonal should be the full HEIGHT from get_viewport_half_extents, and not half the width.

It also fixes state.ubo_data.viewport_size in rasterizer_scene_gles3.cpp to be the width and the height of the viewport in pixels as stated in the documentation, rather than the current value which is half the viewport extents in worldspace, presumed to be a bug.
2020-01-22 18:22:00 +00:00
Ben Hickling fdd7cfa820 fixed camera project_position function that was still using the near parameter in a few calculations 2020-01-09 14:34:31 +00:00
SIYU FU d80e979a48 Update Camera.project_position to not return get_global_transform().origin if projection mode is orthogonal 2020-01-02 17:54:41 +01:00
Rémi Verschelde 3e649f8cba
Merge pull request #34665 from timothyqiu/camera-fov
Clamps fov/size for Camera gizmo
2020-01-01 11:37:28 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Haoyu Qiu cbb8930813 Clamps fov/size for Camera gizmo 2019-12-29 11:39:04 +08:00
Rémi Verschelde 6c557b8bdf Camera: Don't set default value for project_position
A z_depth of 0 returns the camera position, which is not really useful.
This also makes the API breakage from 3.1 clearer as 3.1 code will now
fail to compile, so users will have to adapt and use the new parameter.

For the reference, in 3.1, the z_depth was hardcoded to the near plane.

Closes #33493.
2019-11-10 00:17:26 +01:00
Hugo Locurcio aba157865a
Add missing semicolons to BIND_ENUM_CONSTANT macro uses 2019-10-02 09:57:12 +02:00
Tomasz Chabora af5e0fff66 Remove ERR_EXPLAIN from scene/* code 2019-08-09 13:54:52 +02:00
jfons 30b3591152 Expose ClippedCamera clip_offset 2019-06-14 17:39:13 +02:00
Rémi Verschelde 62b868fd37
Merge pull request #26942 from RandomShaper/fix-vp-issues
Fix Viewport and Camera issues
2019-05-30 18:31:15 +02:00
Cheeseness 6fe957de63 Add a depth parameter to Camera::project_position() 2019-05-29 02:04:50 +10:00
Jummit ce2c45bde7 add get_camera_rid method 2019-05-27 16:05:27 +02:00
JFonS 9e97bac0cf Fixes to ClippedCamera
This work has been kindly sponsored by IMVU.
2019-05-10 10:35:15 +02:00
Hein-Pieter van Braam 5d33f241f0
Merge pull request #26064 from JFonS/add_frustum_camera_mode
Add FRUSTUM camera mode, allowing tilted frustums
2019-04-23 06:20:13 +03:00
Pedro J. Estébanez e3fc5fb1db Fix Viewport and Camera issues
1. Consider 'own_world' as well as 'world' to stop propagating enter/exit world notifications.
2. Clean & fix handling of camera currency.

This fixes some random crashes and error logs in the editor; namely
- when enabling/disabling own world in a Viewport;
- when switching back from a subscene displayed into a main scene's Viewport;
- when exiting the editor after any of them;
- memory corruption (can that explain certain other seemingly unrelated crash reports?).

This also fixes situations where a Viewport and its main Camera get out of sync about which World is relevant to them.
2019-03-30 00:25:26 +01:00
Juan Linietsky 3299045988 Remove setting that caused is_inside_tree() errors on doppler tracking enabled. 2019-02-26 09:16:23 -03:00
JFonS 54b95b6c5a Add FRUSTUM camera mode, allowing tilted frustums
This new camera mode makes it easy to create tilted frustums for mirror
or portal effects.

This work was kindly sponsored by IMVU.
2019-02-19 17:48:08 +01:00
Yusuf a7e6a31d7f binding for get_frustum() of camera class 2019-01-28 21:43:59 +03:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Juan Linietsky 39e8aca1b7 Update FOV if edited in gizmo, fixes #16400 2018-09-06 16:22:34 -03:00
Marcelo Fernandez f344763b58 Add missing BIND_ENUM_CONSTANT to ClippedCamera 2018-08-23 13:53:05 -03:00
Juan Linietsky ee07fb5ebe Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ability to choose between bodies and areas when colliding. 2018-08-21 15:31:23 -03:00
Juan Linietsky e20864c340 Clipped camera implementation, a camera that avoids going into geometry. 2018-08-21 11:48:48 -03:00
Juan Linietsky 52e6f1f25c
Merge pull request #20072 from RandomShaper/fix-camera-offsets
Fix camera offsets not applied always
2018-08-10 16:24:39 -03:00
Juan Linietsky aff57a613b Add extra functions to toggle bits in visualinstance and camera, same as physics. Helps with #6685 2018-07-29 20:05:16 -03:00
Juan Linietsky d1550b4a9b Ability to disable scale in nodes, closes #19927 2018-07-18 13:48:09 -03:00
Pedro J. Estébanez ec5c96dbe1 Fix camera offsets not applied always
Specifically, project/unproject methods weren't taking them into account. Frustum computation may be affected as well.

This commit considers them for the camera matrix at all times.
2018-07-09 21:07:15 +02:00
Juan Linietsky dfd1331690 Allow editing of some unbound properties when hinted (or no range hinted) 2018-05-16 09:13:41 -03:00
Jakub Grzesik f78c7353ea a way to ensure that camera is disabled 2018-03-17 10:57:04 +01:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Rémi Verschelde b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Juan Linietsky 02e883713a
Merge pull request #14977 from volzhs/fix-crash-group
Fix crash & error at saving scene
2017-12-26 11:43:02 -03:00
volzhs ff68b80df7 Fix error if scene has Camera at saving scene 2017-12-25 02:43:37 +09:00
Daniel J. Ramirez 1696db8f00 Fixes 3d camera keep aspect. 2017-12-22 14:24:38 -06:00
Will Nations d9cb00151b [DOCS] Camera property changes 2017-12-11 12:48:41 -06:00
Juan Linietsky dd892a327d Added some clean up in camera/viewport management. Fixes #12279, Fixes #12774 2017-12-07 12:13:20 -03:00
Hugo Locurcio 541df26184
Tweak the default camera node settings
- Increase FOV to 70
- Put the Z-near plane at 0.05 meters
2017-11-25 23:48:30 +01:00
Poommetee Ketson 9b634180aa Refactor Fixed to Physics 2017-10-21 21:28:08 +07:00
AndreaCatania 4537977d6d Renamed fixed_process to physics_process 2017-09-30 16:19:07 +02:00
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Ignacio Etcheverry 32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
Ignacio Etcheverry 2f290038d6 Removes type information from method binds 2017-08-10 07:17:50 +02:00
Juan Linietsky 2e73be99d8 Lots of work on Audio & Physics engine:
-Added new 3D stream player node
-Added ability for Area to capture sound from streams
-Added small features in physics to be able to properly guess distance to areas for sound
-Fixed 3D CollisionObject so shapes are added the same as in 2D, directly from children
-Fixed KinematicBody API to make it the same as 2D.
2017-07-15 08:32:34 -03:00
Hugo Locurcio cdcc3c919b Increase the default perspective camera FOV
This does not affect existing projects, but will affect newly-created
editor settings and Camera nodes.
2017-06-16 12:07:07 +02:00