From da3ce2dde91e81bf04b00deaac3b9604c9fb5fd0 Mon Sep 17 00:00:00 2001 From: Eric-Paul Ickhorn Date: Mon, 9 Sep 2024 21:31:49 +0200 Subject: [PATCH] Add (unsigned, signed) integer vectors Those vectors are needed for storing a position that is only on fixed points on a grid. The position and size of a window must be expressed as integer vectors, for example. --- .../utility/inc-c/voxula/internals/utility.h | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/modules/utility/inc-c/voxula/internals/utility.h b/modules/utility/inc-c/voxula/internals/utility.h index b20e516..57df9be 100644 --- a/modules/utility/inc-c/voxula/internals/utility.h +++ b/modules/utility/inc-c/voxula/internals/utility.h @@ -2,6 +2,7 @@ #ifndef VOXULA_UTILITY_H #define VOXULA_UTILITY_H +#include #include #include @@ -14,6 +15,15 @@ typedef uint64_t vx_uuid_d; typedef struct vx_vec2f vx_vec2f_s; typedef struct vx_vec3f vx_vec3f_s; typedef struct vx_vec4f vx_vec4f_s; + +typedef struct vx_vec2u vx_vec2u_s; +typedef struct vx_vec3u vx_vec3u_s; +typedef struct vx_vec4u vx_vec4u_s; + +typedef struct vx_vec2i vx_vec2i_s; +typedef struct vx_vec3i vx_vec3i_s; +typedef struct vx_vec4i vx_vec4i_s; + typedef struct vx_mat2f vx_mat2f_s; typedef struct vx_mat3f vx_mat3f_s; typedef struct vx_mat4f vx_mat4f_s; @@ -106,6 +116,48 @@ struct vx_vec4f float w; }; +struct vx_vec2u +{ + uint64_t x; + uint64_t y; +}; + +struct vx_vec3u +{ + uint64_t x; + uint64_t y; + uint64_t z; +}; + +struct vx_vec4u +{ + uint64_t x; + uint64_t y; + uint64_t z; + uint64_t w; +}; + +struct vx_vec2i +{ + int64_t x; + int64_t y; +}; + +struct vx_vec3i +{ + int64_t x; + int64_t y; + int64_t z; +}; + +struct vx_vec4i +{ + int64_t x; + int64_t y; + int64_t z; + int64_t w; +}; + struct vx_mat2f { float val[4];