summaryrefslogtreecommitdiffstats
path: root/core/math/projection.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@f128f383e892865379cb8b14e7bcc9858efe2973Spartan3222024-11-271-8/+4
|\
| * Fix stringification of ProjectionRémi Verschelde2024-11-251-8/+4
| |
| * Fix Projection::invert on orthogonal projections and others.Álex Román2024-11-181-91/+219
| | | | | | | | | | | | Fixes #68878, specially when using orthographic projection. Also adds some tests.
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Fix `Projection::invert` on orthogonal projections and others.Álex Román2024-10-221-91/+219
| | | | | | | | | | | | | | | | Relates to godotengine/godot#68878, specially when using orthographic projection. Also adds some tests. Adapted from godotengine/godot#95303
* | Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Merge pull request #90063 from aaronfranke/really-floatyRémi Verschelde2024-04-041-5/+5
|\ | | | | | | Fix some uses of `float` and `real_t` in `core/math`
| * Fix some uses of float and real_t in core/mathAaron Franke2024-03-291-5/+5
| |
* | Use Reverse Z for the depth bufferKhasehemwy2024-04-041-3/+4
|/
* Remove unnecessary line from Projection::get_z_farMatthew2023-09-201-1/+0
| | | | | | | Removes a line from Projection::get_z_far that flips the normal of a plane. While this may be required for similar code elsewhere in the file, this is unnecessary here, as only the length of the normal is used and not the direction. Flipping the normal does not change its magnitude and therefore is unnecessary in this case.
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Fix "p_zfar" to "p_znear" in Projection.create_orthogonalHei2022-12-151-1/+1
| | | Was confused why it always gave inf:s.
* Static analysis: remove "break" after "return"Andy Maloney2022-11-181-6/+6
| | | | Changes as requested to keep in sync with godotengine/godot-cpp#929
* Use float literals for float calculations in ColorAaron Franke2022-10-071-2/+5
|
* Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg2022-10-071-7/+7
| | | | change warnings=all to use /W4.
* Enhancements to includes in core data structuresAaron Franke2022-10-051-1/+2
|
* Rename Projection `matrix` to `columns`Aaron Franke2022-10-041-105/+107
|
* Rename `str2var` to `str_to_var` and similarMicky2022-08-261-4/+4
| | | | | | | | | | | | | | | | | | Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too. - `var2str` -> `var_to_str` - `str2var` -> `str_to_var` - `bytes2var` -> `bytes_to_var` - `bytes2var_with_objects` -> `bytes_to_var_with_objects` - `var2bytes` -> `var_to_bytes` - `var2bytes_with_objects` -> `var_to_bytes_with_objects` - `linear2db` -> `linear_to_db` - `db2linear` -> `db_to_linear` - `deg2rad` -> `deg_to_rad` - `rad2deg` -> `rad_to_deg` - `dict2inst` -> `dict_to_inst` - `inst2dict` -> `inst_to_dict`
* Implement Vector4, Vector4i, Projectionreduz2022-07-231-0/+931
Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.