Commit Graph

350 Commits

Author SHA1 Message Date
Phillip Stephens 316d937f11 Minor compile fixes and corrections 2023-10-22 17:18:03 -07:00
Luke Street e9ec10a382 Add simd_none implementation 2022-08-03 18:15:45 -04:00
Luke Street ac7d83009d CMatrix4f: Explicit operator==/!= 2022-06-03 01:52:41 -04:00
Luke Street 6547f76752 Remove error-causing constexprs 2022-05-31 20:17:23 -04:00
Phillip Stephens 8410394d4b
Add toRGBA and toRGB5A3 to CColor 2022-05-13 23:46:19 -07:00
Luke Street 8e4dfb022a CMatrix3f: Remove normalize from CQuaternion ctor 2022-05-12 12:05:29 -04:00
Luke Street f3e649716a Revert change to CAABox closestPointAlongVector / furthestPointAlongVector 2022-03-20 16:22:06 -04:00
Phillip Stephens 11606d3676
Fix constexpr in CQuaternion 2022-03-12 09:49:30 -08:00
Phillip Stephens fc33e18b4a
constexpr fixes 2022-03-12 09:03:27 -08:00
Phillip Stephens 82a3a0def9
Fix floorPowerOfTwo 2022-03-02 23:50:07 -08:00
Phillip Stephens e9c0fe7a6e
Remove athena types 2022-02-27 20:46:10 -08:00
Phillip Stephens e53b380f42
Add CVector2d/4d 2022-02-20 18:41:54 -08:00
Luke Street ec125acf29 CColor: Fix COLOR macro (again) 2021-10-25 22:54:47 -04:00
Luke Street 6e865b656a MSVC build fix for COLOR macro 2021-10-25 19:17:25 -04:00
Phillip Stephens f3630be9de
Add CVector3f->CEulerAngles constructor to CEulerAngles 2021-07-11 17:56:32 -07:00
Phillip Stephens bb9b4c83af
Fix incorrect division operator 2021-05-23 11:52:00 -07:00
Phillip Stephens 9130bf977e
Add IsNan helper function to CVector3f 2021-05-16 15:29:06 -07:00
Luke Street b3806c03a5 Fixes for MSVC arch detection & SIMD compilation 2021-02-15 21:03:44 -05:00
Luke Street 3c4bcf37d2 Update simd_neon
- Fixes m128d dot3
- Simplifies negate operations
2021-01-09 14:27:27 -05:00
Luke Street 9ea070c2d7 CVector2f: Remove unnecessary constexpr 2021-01-06 20:33:36 -05:00
Luke Street 906e7736a0 Add simd_neon.hpp to CMakeLists 2020-10-20 02:28:17 -04:00
Luke Street 566db657d9 Add NEON support & more constexpr 2020-10-20 02:25:44 -04:00
Phillip Stephens eec855018a
Add countLeadingZeros 2020-09-19 15:43:35 -07:00
Luke Street 58c8a902ac CVector3f/CVector2f: Fix isZero 2020-09-16 00:41:47 -04:00
Luke Street f99184556a CVector3f/CVector2f: Fix clamp in getAngleDiff 2020-04-19 21:01:49 -04:00
Lioncash 5520001117 General: Mark file-scope constexpr variables as inline
Allows the compiler to unify all usages of these constants down to a
single address if they're ODR used, rather than creating an individual
copy within each translation unit.

Unfortunately all file-scope variables don't have inline implied for
them by default (only for static class member variables).

Shrinks the size of the emitted binary a little bit.
2020-04-19 03:22:13 -04:00
Jack Andersen 6c46735ab1 Make zeustest work with nodiscard 2020-04-11 12:50:02 -10:00
Jack Andersen ef35789909 Exclude CMake CXX standard from MSVC 2020-04-10 19:02:01 -10:00
Phillip Stephens 6ac3066a6f
Merge pull request #22 from lioncash/nodiscard
General: Mark functions as nodiscard where applicable
2020-03-04 17:31:13 -08:00
Lioncash 81f9b4a4ee General: Mark functions as nodiscard where applicable
Given this aims to be a general purpose math library for use in various
other libraries applications for axiodl, we can annotate functions that
return by value or reference with [[nodiscard]] where it's very obvious
that not making use of the return value is a bug.

This allows the compiler to diagnose and emit warnings for these API
misuses at compile-time, preventing silent bugs from occurring.

Any cases where not using the return value is desirable may still be
casted to void in order to silence warnings.
2020-03-04 03:07:54 -05:00
Phillip Stephens 97cec53046
Merge branch 'master' of ssh+git://git.axiodl.com/AxioDL/zeus 2020-03-03 16:48:12 -08:00
Phillip Stephens 82c2a2d85b
Minor fixes 2020-03-03 16:47:59 -08:00
Phillip Stephens c70243ff32
Merge pull request #21 from encounter/sse4a
Add SSE4a CPUID check
2019-12-10 20:48:34 -08:00
Luke Street c3671245e2 Add SSE4a CPUID check 2019-12-10 17:09:24 -05:00
Phillip Stephens bf416af1ed
Merge pull request #20 from lioncash/local
CQuaternion: Remove unnecessary local in slerp()
2019-09-21 05:46:07 -07:00
Lioncash 9409825ace CQuaternion: Remove unnecessary local in slerp()
We can turn this assignment into a direct return expression, tidying up
the code a little bit.
2019-09-20 21:01:17 -04:00
Phillip Stephens 949dbff9b8
Merge pull request #19 from lioncash/constexpr
CVector2i: Make CVector2f-related constructor non-constexpr
2019-09-06 00:59:47 -07:00
Lioncash 9045766c52 CVector2i: Make CVector2f-related constructor non-constexpr
These make use of SIMD accessors, which aren't constexpr.
2019-09-06 02:25:33 -04:00
Phillip Stephens 419c1369ee
Merge pull request #18 from lioncash/color
CColor: Correct luminance setting within toHSL()
2019-09-05 19:36:32 -07:00
Lioncash 9f0c1e8218 CColor: Correct luminance setting within toHSL()
The function wasn't setting the luminance out reference, this corrects
that.
2019-09-05 21:27:37 -04:00
Lioncash 53c6c115fe CColor: Use initializer_list version of std::min/std::max where applicable
Same behavior, but less verbose.
2019-09-05 21:21:35 -04:00
Phillip Stephens 63ecd31813
Merge pull request #16 from lioncash/rot
Global: Remove unused rotr/rotl functions
2019-09-04 19:35:25 -07:00
Phillip Stephens 4d0e4f21ab
Merge pull request #15 from lioncash/noexcept
Global: Mark hash_combine_impl() as noexcept
2019-09-04 19:33:47 -07:00
Phillip Stephens 85035bc178
Merge pull request #17 from lioncash/matrix
CMatrix4f: Make copy assignment constexpr
2019-09-04 19:32:56 -07:00
Lioncash 29399159e9 CMatrix4f: Make copy assignment constexpr
Matches the constexpr copy constructor.
2019-09-04 11:59:53 -04:00
Lioncash 76a7129d80 Global: Remove unused rotr/rotl functions
These don't appear to be used by anything, so they can be removed.
2019-09-04 10:37:21 -04:00
Lioncash 3d14be889c Global: Mark hash_combine_impl() as noexcept
This is used with hashes that are declared noexcept, so this should also
be noexcept.
2019-09-04 10:35:27 -04:00
Phillip Stephens 2206497e35
Merge pull request #14 from lioncash/vec
CVector2i: Make interface constexpr where applicable
2019-09-04 01:03:42 -07:00
Lioncash 890c1e28e0 CVector2i: Add static assert for enforcing vector size
Provides compile-time guarantees about struct layout.
2019-09-04 03:05:28 -04:00
Lioncash c39186d3ba CVector2i: Make conversions to float explicit 2019-09-04 02:53:29 -04:00