|
23 | 23 |
|
24 | 24 | #pragma once |
25 | 25 |
|
26 | | -#include <math.h> |
27 | 26 | #include <stdbool.h> |
28 | 27 | #include <string.h> |
29 | 28 |
|
30 | 29 | #ifndef M_PI |
31 | 30 | #define M_PI 3.14159265358979323846 |
32 | 31 | #endif |
33 | 32 |
|
34 | | -// --------------------------------------------------------------------------- |
35 | | -// Scalar |
36 | | -// --------------------------------------------------------------------------- |
| 33 | +#pragma mark - float |
37 | 34 |
|
38 | 35 | /** |
39 | 36 | * @return `degrees` converted to radians. |
@@ -85,9 +82,7 @@ static inline float float_sign(float f) { |
85 | 82 | return (f > 0.f) - (f < 0.f); |
86 | 83 | } |
87 | 84 |
|
88 | | -// --------------------------------------------------------------------------- |
89 | | -// float2 |
90 | | -// --------------------------------------------------------------------------- |
| 85 | +#pragma mark - float2 |
91 | 86 |
|
92 | 87 | /** |
93 | 88 | * @brief Two-component single-precision vector. Component layout matches HLSL `float2`. |
@@ -132,9 +127,7 @@ static inline float2 float2_lerp(float2 a, float2 b, float t) { |
132 | 127 |
|
133 | 128 | static inline bool float2_equal(float2 a, float2 b) { return a.x == b.x && a.y == b.y; } |
134 | 129 |
|
135 | | -// --------------------------------------------------------------------------- |
136 | | -// float3 |
137 | | -// --------------------------------------------------------------------------- |
| 130 | +#pragma mark - float3 |
138 | 131 |
|
139 | 132 | /** |
140 | 133 | * @brief Three-component single-precision vector. Component layout matches HLSL `float3`. |
@@ -196,9 +189,7 @@ static inline float3 float3_reflect(float3 v, float3 n) { |
196 | 189 |
|
197 | 190 | static inline bool float3_equal(float3 a, float3 b) { return a.x == b.x && a.y == b.y && a.z == b.z; } |
198 | 191 |
|
199 | | -// --------------------------------------------------------------------------- |
200 | | -// float4 |
201 | | -// --------------------------------------------------------------------------- |
| 192 | +#pragma mark - float4 |
202 | 193 |
|
203 | 194 | /** |
204 | 195 | * @brief Four-component single-precision vector. Component layout matches HLSL `float4`. |
@@ -246,9 +237,7 @@ static inline float4 float4_lerp(float4 a, float4 b, float t) { |
246 | 237 |
|
247 | 238 | static inline bool float4_equal(float4 a, float4 b) { return a.x == b.x && a.y == b.y && a.z == b.z && a.w == b.w; } |
248 | 239 |
|
249 | | -// --------------------------------------------------------------------------- |
250 | | -// float4x4 |
251 | | -// --------------------------------------------------------------------------- |
| 240 | +#pragma mark - float4x4 |
252 | 241 |
|
253 | 242 | /** |
254 | 243 | * @brief Column-major 4x4 single-precision matrix. Layout matches HLSL `float4x4`. |
|
0 commit comments