157 res->
x = a->
x < b->
x ? a->
x : b->
x;
158 res->
y = a->
y < b->
y ? a->
y : b->
y;
159 res->
z = a->
z < b->
z ? a->
z : b->
z;
160 res->
w = a->
w < b->
w ? a->
w : b->
w;
173 res->
x = a->
x > b->
x ? a->
x : b->
x;
174 res->
y = a->
y > b->
y ? a->
y : b->
y;
175 res->
z = a->
z > b->
z ? a->
z : b->
z;
176 res->
w = a->
w > b->
w ? a->
w : b->
w;
188 res->
x = v->
x > 0 ? 1 : v->
x < 0 ? -1 : 0;
189 res->
y = v->
y > 0 ? 1 : v->
y < 0 ? -1 : 0;
190 res->
z = v->
z > 0 ? 1 : v->
z < 0 ? -1 : 0;
191 res->
w = v->
w > 0 ? 1 : v->
w < 0 ? -1 : 0;
205 const vm_float_t clamped_t = (t < 0.0f) ? 0.0f : (t > 1.0f) ? 1.0f : t;
224 res->
x = v->
x < min->
x ? min->
x : (v->
x > max->
x ? max->
x : v->
x);
225 res->
y = v->
y < min->
y ? min->
y : (v->
y > max->
y ? max->
y : v->
y);
226 res->
z = v->
z < min->
z ? min->
z : (v->
z > max->
z ? max->
z : v->
z);
227 res->
w = v->
w < min->
w ? min->
w : (v->
w > max->
w ? max->
w : v->
w);
252 if (r != 0 && ((a < 0) != (b < 0))) {
265 if (r != 0 && ((a < 0) != (b < 0))) {
280 res->
x = (b->
x == 0) ? 0 : a->
x / b->
x;
281 res->
y = (b->
y == 0) ? 0 : a->
y / b->
y;
282 res->
z = (b->
z == 0) ? 0 : a->
z / b->
z;
283 res->
w = (b->
w == 0) ? 0 : a->
w / b->
w;
vm_float_t vec4i_length(vector4i v)
Computes the length (magnitude) of a vector4i.
void vec4i_add_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Adds the components of two vector4i and stores the result in res.
void vec4i_to_vec3i_ptr(vector3i *res, const vector4i *v)
Copies the x, y, z components of a vector4i and stores the result in a vector3i.
void vec4i_div_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Divides two vectors component-wise.
void vec4i_mod_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Component-wise floor modulo of a by b.
void vec4i_abs_ptr(vector4i *res, const vector4i *v)
Computes the absolute value of each component of a vector4i and stores the result in res.
void vec4i_clamp_ptr(vector4i *res, const vector4i *v, const vector4i *min, const vector4i *max)
Clamps the components of a vector4i to the range [min, max] and stores the result in res.
void vec4i_max_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Computes the component-wise maximum of two vector4i and stores the result in res.
void vec4i_div_scalar_ptr(vector4i *res, const vector4i *v, const vm_int_t s)
Divides the components of a vector4i by a scalar and stores the result in res.
void vec4i_normalize_ptr(vector4i *res, const vector4i *v)
Normalizes a vector4i by dividing its components by the vector length and stores the result in res.
void vec4i_mul_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Multiplies the components of two vector4i and stores the result in res.
void vec4i_mul_scalar_ptr(vector4i *res, const vector4i *v, const vm_int_t s)
Multiplies the components of a vector4i by a scalar and stores the result in res.
void vec4i_neg_ptr(vector4i *res, const vector4i *v)
Negates the components of a vector4i and stores the result in res.
void vec4i_min_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Takes the component-wise minimum of two vector4i and stores the result in res.
void vec4i_sub_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Subtracts the components of the second vector from the first vector4i and stores the result in res.
void vec4i_lerp_ptr(vector4i *res, const vector4i *a, const vector4i *b, const vm_float_t t)
Linearly interpolates between two vector4i using an interpolation factor t (clamped to [0,...
void vec4i_add_scalar_ptr(vector4i *res, const vector4i *v, const vm_int_t s)
Adds a scalar to each component.
void vec4i_div_floor_ptr(vector4i *res, const vector4i *a, const vector4i *b)
Component-wise floored division of a by b.
static vm_int_t vm_div_floor4(const vm_int_t a, const vm_int_t b)
void vec4i_sub_scalar_ptr(vector4i *res, const vector4i *v, const vm_int_t s)
Subtracts a scalar from each component.
void vec4i_sign_ptr(vector4i *res, const vector4i *v)
Computes the sign (-1, 0, or 1) of each component of a vector4i and stores the result in res.
static vm_int_t vm_mod_floor4(const vm_int_t a, const vm_int_t b)
void vec4i_wrap_ptr(vector4i *res, const vector4i *v, const vector4i *period)
Wraps each component of v into [0, period).