diff --git a/src/include/util.h b/src/include/util.h index 69856c9..9c58cc1 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -12,6 +12,7 @@ typedef float vec2_t[2]; bool is_alive(cl_entity_t* ent); bool valid_client(cl_entity_t* ent); char* get_name(int ent_idx); +vec3_t vec3(float x, float y, float z); bool vec_is_zero(vec3_t v); bool world_to_screen(vec3_t vec, vec2_t screen); diff --git a/src/util.c b/src/util.c index ffbe598..6cae693 100644 --- a/src/util.c +++ b/src/util.c @@ -18,6 +18,16 @@ char* get_name(int ent_idx) { return info.name; } +vec3_t vec3(float x, float y, float z) { + vec3_t ret; + + ret[0] = x; + ret[1] = y; + ret[2] = z; + + return ret; +} + bool vec_is_zero(vec3_t v) { return v[0] == 0.0f && v[1] == 0.0f && v[2] == 0.0f; }