Skip to content

Commit 1e9ff19

Browse files
cpp operator fixes
1 parent 9a66849 commit 1e9ff19

41 files changed

Lines changed: 197 additions & 290 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.19)
22
project(libmath2 VERSION 0.1.0 LANGUAGES C CXX)
33

4-
set(CMAKE_C_STANDARD 11)
4+
set(CMAKE_C_STANDARD 23)
55
set(CMAKE_C_STANDARD_REQUIRED ON)
66
set(CMAKE_CXX_STANDARD 20)
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -62,7 +62,7 @@ if(LM2_BUILD_TESTS)
6262
FetchContent_MakeAvailable(googletest)
6363
endif()
6464

65-
file(GLOB_RECURSE LM2_TEST_SOURCES tests/*.cpp)
65+
file(GLOB_RECURSE LM2_TEST_SOURCES tests/**.cpp)
6666

6767
add_executable(libmath2-tests ${LM2_TEST_SOURCES})
6868
target_link_libraries(libmath2-tests PRIVATE libmath2 GTest::gtest_main)

agent/modules/lm2_aabb2.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ types:
33
- lm2_align
44
- lm2_corner2
55
- lm2_rect_cut
6+
- lm2_aabb2_f64
7+
- lm2_aabb2_f32
8+
- lm2_aabb2_i64
9+
- lm2_aabb2_i32
10+
- lm2_aabb2_i16
11+
- lm2_aabb2_i8
12+
- lm2_aabb2_u64
13+
- lm2_aabb2_u32
14+
- lm2_aabb2_u16
15+
- lm2_aabb2_u8
616
functions:
717
- lm2_r2_align_subrect_f32
818
- lm2_r2_align_subrect_f64

agent/modules/lm2_aabb3.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ category: geometry3d
22
types:
33
- lm2_aabb3_face
44
- lm2_corner3
5+
- lm2_aabb3_f64
6+
- lm2_aabb3_f32
7+
- lm2_aabb3_i64
8+
- lm2_aabb3_i32
9+
- lm2_aabb3_i16
10+
- lm2_aabb3_i8
11+
- lm2_aabb3_u64
12+
- lm2_aabb3_u32
13+
- lm2_aabb3_u16
14+
- lm2_aabb3_u8
515
functions:
616
- lm2_aabb3_contains_point_f32
717
- lm2_aabb3_contains_point_f64

docs/index.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,4 @@ lm2_<module>_<operation>_<type>
5858
For example:
5959
- `lm2_v3_add_f32` — Add two 3D float vectors
6060
- `lm2_m4x4_inverse_f64` — Invert a 4x4 double matrix
61-
- `lm2_quat_slerp_f32` — Spherical interpolation between float quaternions
62-
63-
Default type aliases (f32) are provided for convenience:
64-
- `lm2_v2` = `lm2_v2_f32`
65-
- `lm2_v3` = `lm2_v3_f32`
66-
- `lm2_v4` = `lm2_v4_f32`
67-
- `lm2_m4x4` = `lm2_m4x4_f32`
68-
- `lm2_quat` = `lm2_quat_f32`
69-
- `lm2_r2` = `lm2_r2_f32`
61+
- `lm2_quat_slerp_f32` — Spherical interpolation between float quaternions

docs/modules/matrices.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ Matrices are essential for combining translation, rotation, and scaling transfor
1919
|------|--------|-------------|
2020
| `lm2_m3x2_f64` | `double` | 3x2 affine 2D transformation matrix |
2121
| `lm2_m3x2_f32` | `float` | 3x2 affine 2D transformation matrix |
22-
| `lm2_m3x2` | `float` | Default alias for `lm2_m3x2_f32` |
2322
| `lm2_m3x3_f64` | `double` | 3x3 matrix (2D homogeneous / 3D rotation) |
2423
| `lm2_m3x3_f32` | `float` | 3x3 matrix |
25-
| `lm2_m3x3` | `float` | Default alias for `lm2_m3x3_f32` |
2624
| `lm2_m4x4_f64` | `double` | 4x4 3D transformation matrix |
2725
| `lm2_m4x4_f32` | `float` | 4x4 3D transformation matrix |
28-
| `lm2_m4x4` | `float` | Default alias for `lm2_m4x4_f32` |
2926

3027
## Matrix 3x2 Layout
3128

docs/modules/quaternions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Quaternions avoid gimbal lock, interpolate smoothly, concatenate efficiently, an
1919
|------|--------|-------------|
2020
| `lm2_quat_f64` | `double` | 64-bit quaternion |
2121
| `lm2_quat_f32` | `float` | 32-bit quaternion |
22-
| `lm2_quat` | `float` | Default alias for `lm2_quat_f32` |
2322

2423
**Format:** `[x, y, z, w]` where `w` is the scalar part and `(x, y, z)` is the vector part.
2524

docs/modules/ranges.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ AABBs are the most common spatial structure for broad-phase collision detection,
2929
| `lm2_r2_u32` | `uint32_t` | 2D range (uint32) |
3030
| `lm2_r2_u16` | `uint16_t` | 2D range (uint16) |
3131
| `lm2_r2_u8` | `uint8_t` | 2D range (uint8) |
32-
| `lm2_r2` | `float` | Default alias for `lm2_r2_f32` |
3332

3433
3D ranges (`lm2_r3_*`) and 4D ranges (`lm2_r4_*`) follow the same pattern.
3534

docs/modules/vectors.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ Each dimensionality has types for all supported numeric precisions:
3131
| `lm2_v2_u32` | `uint32_t` | 32-bit unsigned int 2D vector |
3232
| `lm2_v2_u16` | `uint16_t` | 16-bit unsigned int 2D vector |
3333
| `lm2_v2_u8` | `uint8_t` | 8-bit unsigned int 2D vector |
34-
| `lm2_v2` | `float` | Default alias for `lm2_v2_f32` |
3534

3635
### 3D Vectors (`lm2_v3_*`)
3736

38-
Same type variants as 2D with an additional `z` component. Default: `lm2_v3` = `lm2_v3_f32`.
37+
Same type variants as 2D with an additional `z` component.
3938

4039
### 4D Vectors (`lm2_v4_*`)
4140

42-
Same type variants with `x`, `y`, `z`, `w` components. Default: `lm2_v4` = `lm2_v4_f32`.
41+
Same type variants with `x`, `y`, `z`, `w` components.
4342

4443
## Component Access
4544

0 commit comments

Comments
 (0)