Commit Graph

726 Commits

Author SHA1 Message Date
4505aee3c2 Guards AVX2 usage with a preprocessor definition
Ensures that AVX2 intrinsics are only included when the
OMATH_USE_AVX2 preprocessor definition is set. This prevents
compilation errors when AVX2 support is not available or
explicitly disabled.
2025-09-18 05:22:22 +03:00
Billy Robert O'Neal III
ee8073ceb4 Don't name std::fmodf.
The C standard library function fmodf is not guaranteed to be in namespace std, and in fact is not with a default Ubuntu 24.04 installation, leading to the following compile error:

```console
Change Dir: '/vcpkg/buildtrees/vcpkg-ci-orange-math/x64-linux-dbg'

Run Build Command(s): /vcpkg/downloads/tools/ninja/1.12.1-linux/ninja -v -v -j33
[1/2] /usr/bin/c++ -DOMATH_SUPRESS_SAFETY_CHECKS -DOMATH_VERSION=\"3.5.0\" -isystem /vcpkg/installed/x64-linux/include -fPIC -g -std=gnu++23 -MD -MT CMakeFiles/main.dir/main.cpp.o -MF CMakeFiles/main.dir/main.cpp.o.d -o CMakeFiles/main.dir/main.cpp.o -c /vcpkg/scripts/test_ports/vcpkg-ci-orange-math/project/main.cpp
FAILED: CMakeFiles/main.dir/main.cpp.o
/usr/bin/c++ -DOMATH_SUPRESS_SAFETY_CHECKS -DOMATH_VERSION=\"3.5.0\" -isystem /vcpkg/installed/x64-linux/include -fPIC -g -std=gnu++23 -MD -MT CMakeFiles/main.dir/main.cpp.o -MF CMakeFiles/main.dir/main.cpp.o.d -o CMakeFiles/main.dir/main.cpp.o -c /vcpkg/scripts/test_ports/vcpkg-ci-orange-math/project/main.cpp
In file included from /vcpkg/installed/x64-linux/include/omath/omath.hpp:22,
                 from /vcpkg/scripts/test_ports/vcpkg-ci-orange-math/project/main.cpp:1:
/vcpkg/installed/x64-linux/include/omath/color.hpp: In member function ‘constexpr omath::Hsv omath::Color::to_hsv() const’:
/vcpkg/installed/x64-linux/include/omath/color.hpp:98:45: error: ‘fmodf’ is not a member of ‘std’; did you mean ‘modf’?
   98 |                 hsv_data.hue = 60.f * (std::fmodf(((green - blue) / delta), 6.f));
      |                                             ^~~~~
      |                                             modf
ninja: build stopped: subcommand failed.
```

Only the 'sufficient additional overloads' of `fmod` are guaranteed to be in `std`. Since this is clearly intended to call the (float, float) overload, explicitly cast `((green - blue) / delta)` (which is a `double`) to `float` and call the name in `std` as suggested by the diagnostic.
2025-09-17 19:15:10 -07:00
800965a16c Merge pull request #73 from orange-cpp/featore/performance_tests
added performance folder
2025-09-17 20:53:11 +03:00
3e560cbfa4 fix 2025-09-17 20:50:30 +03:00
fbebed3d16 patch 2025-09-17 20:46:00 +03:00
439da31334 improved bench 2025-09-17 20:40:03 +03:00
f7cb5eef1f fix 2025-09-17 20:25:22 +03:00
f6254c6a8c patch 2025-09-17 20:22:42 +03:00
e0c5c1c56b added benchmark submodule 2025-09-17 20:14:33 +03:00
e090ac1d9a added benchmark 2025-09-17 19:56:50 +03:00
dc3606301d added avx mutiplication 2025-09-17 19:47:29 +03:00
eb0ca6627f renamed folder 2025-09-17 18:07:28 +03:00
e2be30f505 added performance folder 2025-09-17 17:47:55 +03:00
a742d99205 Merge pull request #72 from orange-cpp/feature/mat_refactor
Feature/mat refactor
2025-09-17 17:41:15 +03:00
578a4e1d32 removed unused var 2025-09-17 17:38:17 +03:00
13e0bb3262 added space 2025-09-17 17:33:05 +03:00
619c15072c decomposed mutiplication 2025-09-17 17:30:57 +03:00
242fc45ffa forgot std 2025-09-17 17:23:02 +03:00
36628c0400 Merge pull request #71 from orange-cpp/feature/mat_perf_boost
Improves matrix multiplication performance
2025-09-17 17:18:12 +03:00
a630da39e3 Improves matrix multiplication performance
Optimizes matrix multiplication by specializing the algorithm
based on the matrix storage type (row-major or column-major).

This change significantly improves performance by leveraging
memory access patterns specific to each storage order.
2025-09-17 17:12:41 +03:00
910100c6dd Add acknowledgment for AmbushedRaccoon's contribution 2025-09-16 16:58:00 +03:00
dbae07546f Merge pull request #69 from luadebug/patch-1
Repair omath.hpp by removing unexisting header include
2025-09-15 15:01:04 +03:00
Saikari
d1d26352d6 Update omath.hpp 2025-09-15 13:13:55 +03:00
4f0cfd4cef Adds 2D screen to world conversion
Adds an overload for screen_to_world that accepts a 2D screen position.

Renames screen_to_dnc to screen_to_ndc for clarity.
v3.6.1
2025-09-14 04:48:56 +03:00
8c03a07600 patch 2025-09-14 04:43:25 +03:00
498df95e3e Enables formatting support for Angle objects
Adds a partial specialization of `std::formatter` for `omath::Angle`
to provide formatting support using `std::format`.

This allows `Angle` objects to be easily formatted as strings,
including degree symbol representation, using standard formatting
techniques.
2025-09-14 04:43:01 +03:00
7ad0e3f10b Removes unnecessary div tag
Removes an empty div tag, which streamlines the HTML structure and contributes to cleaner code.
2025-09-13 20:13:35 +03:00
4372f429ae Repositions YouTube preview link
Moves the YouTube preview link to improve the README's visual flow.
2025-09-13 20:08:48 +03:00
077653e5ce Improves README readability
Adds a newline to the README file for better visual separation
between the contribute button and the horizontal rule.
2025-09-13 19:55:23 +03:00
5ec26f9def Improves button aesthetics on README
Adds whitespace to the buttons displayed on the README to improve their appearance.
2025-09-13 19:53:09 +03:00
f48232cc1d Updates README with gallery, install and usage
Enhances the README by adding a gallery showcasing OMath's capabilities,
providing a clearer installation guide, and improving usage examples
to facilitate easier adoption.
Also restructures the navigation for better user experience.
2025-09-13 19:50:58 +03:00
32b1b90414 Update README.md 2025-09-13 19:20:37 +03:00
0b18129eac Update README.md 2025-09-13 19:16:19 +03:00
8983cfc6d9 Update README.md 2025-09-09 22:15:00 +03:00
123184987f Update README.md 2025-09-09 21:48:54 +03:00
ac7aeee9be Merge pull request #68 from orange-cpp/feature/screen_to_world
Feature/screen to world
2025-09-09 02:58:32 +03:00
1d8dba6487 Fixes float type conversion in world_to_screen
Fixes a potential type conversion issue by explicitly casting the x-coordinate to float in the world_to_screen test. This prevents possible compiler warnings and ensures the intended behavior.
2025-09-09 02:13:45 +03:00
18b0b210cf Adds projection test for world-to-screen consistency
Adds a test to verify the consistency of world-to-screen and
screen-to-world projections. This ensures that projecting a point
from world to screen and back results in the same point, thereby
validating the correctness of the camera projection transformations.
2025-09-09 01:37:38 +03:00
9e08f5bb5c Adds screen to world space conversion
Adds functionality to convert screen coordinates to world space, including handling for cases where the inverse view projection matrix is singular or when the world position is out of screen bounds.

Also exposes Camera class to unit tests.
2025-09-09 01:31:23 +03:00
a61d3f20b7 Simplifies raycast early exit condition
Combines the infinite length raycast hit check into a single condition.

This clarifies the logic and avoids redundant checks for early exit
in the ray-triangle intersection test, improving performance.
2025-09-08 23:52:35 +03:00
4340e83914 Merge pull request #67 from orange-cpp/feature/angle-improvement
Implements angle class with normalization
2025-09-08 20:18:11 +03:00
1efa28d676 Implements angle class with normalization
Adds an angle class with support for different normalization
and clamping strategies. Includes trigonometric functions and
arithmetic operators. Introduces unit tests to verify correct
functionality.

Disables unity builds to address a compilation issue.
2025-09-08 20:15:59 +03:00
f393d0c1c3 Merge pull request #66 from orange-cpp/feature/remove-legacy
Removes deprecated Matrix class
2025-09-08 19:59:34 +03:00
55c5bb92da Removes deprecated Matrix class
Removes the deprecated `Matrix` class and its associated source files and unit tests.

This change is to ensure code cleanliness and prevent accidental usage of the slow and outdated `Matrix` class.
The `Mat` class should be used instead.
2025-09-08 19:56:04 +03:00
6f203e3a20 Update LICENSE 2025-09-08 15:52:01 +03:00
038de53783 updated logo psd 2025-09-06 23:14:14 +03:00
fde3e1dcb9 Update README.md 2025-09-04 23:49:07 +03:00
6153478d6e Update CREDITS.md 2025-09-04 20:36:12 +03:00
4a6ddb230b Update LICENSE 2025-09-04 20:35:25 +03:00
bb61e2303e Update SECURITY.md 2025-09-04 20:35:04 +03:00