Commit graph

18 commits

Author SHA1 Message Date
Aaron Franke
83634119d4
Replace Quaternion Euler constructor with from_euler method 2022-11-01 09:28:12 -05:00
Haoyu Qiu
5da515773d Add is_finite method for checking built-in types 2022-10-08 13:25:08 +08:00
Aaron Franke
43722dbcbc
Use float literals for float calculations in Color 2022-10-07 11:28:47 -05:00
Aaron Franke
97d232c11d
Enhancements to includes in core data structures 2022-10-05 23:11:02 -05:00
Silc Renew
dded7c72c1 Make cubic_interpolate() consider key time in animation 2022-08-19 14:48:37 +09:00
Silc Renew
4211e68d80 rename and unify notation for spherical interpolation 2022-07-27 23:22:50 +09:00
Silc 'Tokage' Renew
e252d4e6fe Fix cubic_slerp
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
Co-authored-by: Pasi Nuutinmaki <gnssstylist@sci.fi>
2022-07-25 22:44:39 +09:00
Silc 'Tokage' Renew
b06d253920 Fix blend animation to solve TRS track bug & blend order inconsistency 2022-03-16 05:11:55 +09:00
lawnjelly
1485924a2b Float literals - fix main primitives to use real_t casting
Uses (real_t) casting to ensure appropriate calculations are done in 32 bit where real_t is compiled as 32 bit.
2022-02-24 08:15:10 +00:00
lawnjelly
5298e16e80 Float literals - fix main primitives to use .f
Converts float literals from double format (e.g. 0.0) to float format (e.g. 0.0f) where appropriate for 32 bit calculations.
2022-02-10 18:43:19 +00:00
Rémi Verschelde
5ddb518496
Core: Make all Variant math types structs
Some were declared as structs (public by default) and others as classes
(private by default) but in practice all these math types exposed as
Variants are all 100% public.
2022-02-04 16:48:24 +01:00
lawnjelly
b411a731fe Add nodiscard to core math classes to catch c++ errors.
A common source of errors is to call functions (such as round()) expecting them to work in place, but them actually being designed only to return the processed value. Not using the return value in this case in indicative of a bug, and can be flagged as a warning by using the [[nodiscard]] attribute.
2022-01-20 13:07:49 +00:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Rémi Verschelde
7da392bcc5
Don't return reference on copy assignment operators
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.

According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.

This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
2021-11-30 16:26:29 +01:00
Aaron Franke
744b43b527
Fix Quaternion multiplication operator 2021-11-04 11:24:46 -05:00
reduz
a69541da4c Implement Animation Compression
Roughly based on https://github.com/godotengine/godot-proposals/issues/3375 (used format is slightly different).

* Implement bitwidth based animation compression (see animation.h for format).
* Can compress imported animations up to 10 times.
* Compression format opens the door to streaming.
* Works transparently (happens all inside animation.h)
2021-10-21 18:27:34 -03:00
Aaron Franke
93b494d4ae
Add Quaternion angle_to method 2021-06-17 23:57:00 -04:00
Marcel Admiraal
8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
Renamed from core/math/quat.h (Browse further)