diff options
| author | realtradam <[email protected]> | 2023-03-26 04:19:40 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-03-26 04:19:40 -0400 |
| commit | 6a0ef52763cee6e6d7c631516461e0600d9a2da1 (patch) | |
| tree | 551a58a654a08c37a44bba2d3616b214d045a02f /src/rodeo_math.c | |
| parent | 4670ac42a773ea97157f71d78687f79d6ba3c1d9 (diff) | |
| download | RodeoKit-6a0ef52763cee6e6d7c631516461e0600d9a2da1.tar.gz RodeoKit-6a0ef52763cee6e6d7c631516461e0600d9a2da1.zip | |
hmm
Diffstat (limited to 'src/rodeo_math.c')
| -rw-r--r-- | src/rodeo_math.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/src/rodeo_math.c b/src/rodeo_math.c index 0e19a1e..0e421ed 100644 --- a/src/rodeo_math.c +++ b/src/rodeo_math.c @@ -2,12 +2,18 @@ // -- internal -- // public #include "rodeo.h" +// private +#include "rodeo_internal.h" // -- system -- #include <stdint.h> +#include <math.h> // -- external -- #include "SDL2/SDL.h" +#include "stc/crandom.h" +#define CGLM_FORCE_DEPTH_ZERO_TO_ONE +#include "cglm/cglm.h" // rounds to nearest rather then truncation rodeo_color_RGBA8_t @@ -32,17 +38,39 @@ rodeo_color_RGBA8_to_RGBAFloat(const rodeo_color_RGBA8_t color) }; } +void +rodeo_random_seed_set(uint64_t seed) +{ + irodeo_random_seed_set(stc64_new(seed)); +} + double -rodeo_random_simple_float_get(void) +rodeo_random_double_get(void) { - return 0; + stc64_t *seed = irodeo_random_seed_get(); + return stc64_randf(seed); } uint64_t -rodeo_random_simple_uint64_get(void) +rodeo_random_uint64_get(void) { - return 0; + stc64_t *seed = irodeo_random_seed_get(); + return stc64_rand(seed); } +// need to test this, might be wrong +/* +rodeo_vector2_t +rodeo_angle_to_vector2(float angle) +{ + rodeo_vector2_t result = { {1.0f, 0.0f} }; + glm_vec2_rotate( + (float*)&(result.array), + angle * 2.0f * (float)GLM_PI, + (float*)&result.array + ); + return result; +} +*/ |
