65 res->
x = res->
y = res->
z = res->
w = 0.0f;
131 res->
x = v->
x * inv_len;
132 res->
y = v->
y * inv_len;
133 res->
z = v->
z * inv_len;
134 res->
w = v->
w * inv_len;
175 res->
x = v->
x > 0.0f ? 1.0f : v->
x < 0.0f ? -1.0f : 0.0f;
176 res->
y = v->
y > 0.0f ? 1.0f : v->
y < 0.0f ? -1.0f : 0.0f;
177 res->
z = v->
z > 0.0f ? 1.0f : v->
z < 0.0f ? -1.0f : 0.0f;
178 res->
w = v->
w > 0.0f ? 1.0f : v->
w < 0.0f ? -1.0f : 0.0f;
234 res->
x = a->
x + t * (b->
x - a->
x);
235 res->
y = a->
y + t * (b->
y - a->
y);
236 res->
z = a->
z + t * (b->
z - a->
z);
237 res->
w = a->
w + t * (b->
w - a->
w);
270 res->
x = v->
x * inv_w;
271 res->
y = v->
y * inv_w;
272 res->
z = v->
z * inv_w;
275 res->
x = res->
y = res->
z = res->
w = 0.0f;
301 res->
x = (b->
x == 0.0f) ? 0.0f : a->
x / b->
x;
302 res->
y = (b->
y == 0.0f) ? 0.0f : a->
y / b->
y;
303 res->
z = (b->
z == 0.0f) ? 0.0f : a->
z / b->
z;
304 res->
w = (b->
w == 0.0f) ? 0.0f : a->
w / b->
w;
389 res->
x = res->
y = res->
z = res->
w = 0.0f;
393 res->
x = b->
x * scale;
394 res->
y = b->
y * scale;
395 res->
z = b->
z * scale;
396 res->
w = b->
w * scale;
409 res->
x = v->
x - normal->
x * d;
410 res->
y = v->
y - normal->
y * d;
411 res->
z = v->
z - normal->
z * d;
412 res->
w = v->
w - normal->
w * d;
426 res->
x = a->
x - projected.
x;
427 res->
y = a->
y - projected.
y;
428 res->
z = a->
z - projected.
z;
429 res->
w = a->
w - projected.
w;
434#ifdef VECMAT_RUNTIME_DISPATCH
436 vec4_add_ptr_(res, a, b);
444#ifdef VECMAT_RUNTIME_DISPATCH
446 vec4_sub_ptr_(res, a, b);
454#ifdef VECMAT_RUNTIME_DISPATCH
456 vec4_mul_ptr_(res, a, b);
464#ifdef VECMAT_RUNTIME_DISPATCH
466 vec4_mul_scalar_ptr_(res, v, s);
474#ifdef VECMAT_RUNTIME_DISPATCH
476 vec4_div_scalar_ptr_(res, v, s);
484#ifdef VECMAT_RUNTIME_DISPATCH
486 vec4_neg_ptr_(res, v);
494#ifdef VECMAT_RUNTIME_DISPATCH
496 vec4_abs_ptr_(res, v);
504#ifdef VECMAT_RUNTIME_DISPATCH
506 vec4_normalize_ptr_(res, v);
514#ifdef VECMAT_RUNTIME_DISPATCH
516 vec4_min_ptr_(res, a, b);
524#ifdef VECMAT_RUNTIME_DISPATCH
526 vec4_max_ptr_(res, a, b);
534#ifdef VECMAT_RUNTIME_DISPATCH
536 vec4_lerp_ptr_(res, a, b, t);
544#ifdef VECMAT_RUNTIME_DISPATCH
546 vec4_clamp_ptr_(res, v, min, max);
554#ifdef VECMAT_RUNTIME_DISPATCH
556 vec4_div_ptr_(res, a, b);
564#ifdef VECMAT_RUNTIME_DISPATCH
566 vec4_add_scalar_ptr_(res, v, s);
574#ifdef VECMAT_RUNTIME_DISPATCH
576 vec4_sub_scalar_ptr_(res, v, s);
584#ifdef VECMAT_RUNTIME_DISPATCH
586 vec4_clamp_scalar_ptr_(res, v, min, max);
594#ifdef VECMAT_RUNTIME_DISPATCH
596 vec4_saturate_ptr_(res, v);
604#ifdef VECMAT_RUNTIME_DISPATCH
606 vec4_sign_ptr_(res, v);
614#ifdef VECMAT_RUNTIME_DISPATCH
616 vec4_floor_ptr_(res, v);
624#ifdef VECMAT_RUNTIME_DISPATCH
626 vec4_ceil_ptr_(res, v);
634#ifdef VECMAT_RUNTIME_DISPATCH
636 vec4_round_ptr_(res, v);
644#ifdef VECMAT_RUNTIME_DISPATCH
646 vec4_fract_ptr_(res, v);
654#ifdef VECMAT_RUNTIME_DISPATCH
656 vec4_homogenize_ptr_(res, v);
#define VECMAT_SCALAR_API
#define VECMAT_FMAX(a, b)
vm_float_t vec4_dot(vector4 a, vector4 b)
Computes the dot product of two vector4.
#define VECMAT_FMIN(a, b)
vm_float_t vec4_length(vector4 v)
Computes the length (magnitude) of a vector4.
VECMAT_SCALAR_API void vec4_sub_ptr_scalar(vector4 *res, const vector4 *a, const vector4 *b)
Performs component-wise subtraction of two vector4.
void vec4_to_vec3_ptr(vector3 *res, const vector4 *v)
Copies the x, y, z components from a vector4 to a vector3.
void vec4_div_ptr(vector4 *res, const vector4 *a, const vector4 *b)
void vec4_clamp_scalar_ptr(vector4 *res, const vector4 *v, const vm_float_t min, const vm_float_t max)
void vec4_add_scalar_ptr(vector4 *res, const vector4 *v, const vm_float_t s)
VECMAT_SCALAR_API void vec4_clamp_scalar_ptr_scalar(vector4 *res, const vector4 *v, const vm_float_t min, const vm_float_t max)
Clamps each component to the scalar range [min, max].
VECMAT_SCALAR_API void vec4_max_ptr_scalar(vector4 *res, const vector4 *a, const vector4 *b)
Performs component-wise maximum of two vector4.
void vec4_min_ptr(vector4 *res, const vector4 *a, const vector4 *b)
VECMAT_SCALAR_API void vec4_neg_ptr_scalar(vector4 *res, const vector4 *v)
Performs component-wise negation of a vector4.
void vec4_floor_ptr(vector4 *res, const vector4 *v)
VECMAT_SCALAR_API void vec4_round_ptr_scalar(vector4 *res, const vector4 *v)
Performs component-wise rounding of a vector4 to the nearest integer.
void vec4_sign_ptr(vector4 *res, const vector4 *v)
VECMAT_SCALAR_API void vec4_saturate_ptr_scalar(vector4 *res, const vector4 *v)
Clamps each component to the range [0, 1].
void vec4_mul_scalar_ptr(vector4 *res, const vector4 *v, const vm_float_t s)
void vec4_homogenize_ptr(vector4 *res, const vector4 *v)
VECMAT_SCALAR_API void vec4_div_scalar_ptr_scalar(vector4 *res, const vector4 *v, const vm_float_t s)
Performs component-wise division of a vector4 by a scalar.
void vec4_add_ptr(vector4 *res, const vector4 *a, const vector4 *b)
void vec4_max_ptr(vector4 *res, const vector4 *a, const vector4 *b)
VECMAT_SCALAR_API void vec4_homogenize_ptr_scalar(vector4 *res, const vector4 *v)
Homogenizes a vector4 by dividing its x, y, z components by w.
VECMAT_SCALAR_API void vec4_add_ptr_scalar(vector4 *res, const vector4 *a, const vector4 *b)
Performs component-wise addition of two vector4.
void vec4_fract_ptr(vector4 *res, const vector4 *v)
VECMAT_SCALAR_API void vec4_mul_ptr_scalar(vector4 *res, const vector4 *a, const vector4 *b)
Performs component-wise multiplication of two vector4.
VECMAT_SCALAR_API void vec4_abs_ptr_scalar(vector4 *res, const vector4 *v)
Performs component-wise absolute value on a vector4.
void vec4_abs_ptr(vector4 *res, const vector4 *v)
void vec4_saturate_ptr(vector4 *res, const vector4 *v)
VECMAT_SCALAR_API void vec4_sign_ptr_scalar(vector4 *res, const vector4 *v)
Computes the component-wise sign of a vector4.
void vec4_lerp_ptr(vector4 *res, const vector4 *a, const vector4 *b, const vm_float_t t)
VECMAT_SCALAR_API void vec4_normalize_ptr_scalar(vector4 *res, const vector4 *v)
Normalizes a vector4 by scaling its components to unit length.
void vec4_div_scalar_ptr(vector4 *res, const vector4 *v, const vm_float_t s)
VECMAT_SCALAR_API void vec4_floor_ptr_scalar(vector4 *res, const vector4 *v)
Performs component-wise floor operation on a vector4.
void vec4_project_ptr(vector4 *res, const vector4 *a, const vector4 *b)
Projects a onto b.
void vec4_ceil_ptr(vector4 *res, const vector4 *v)
void vec4_reject_ptr(vector4 *res, const vector4 *a, const vector4 *b)
Returns the component of a orthogonal to b.
void vec4_round_ptr(vector4 *res, const vector4 *v)
void vec4_neg_ptr(vector4 *res, const vector4 *v)
VECMAT_SCALAR_API void vec4_div_ptr_scalar(vector4 *res, const vector4 *a, const vector4 *b)
Divides two vectors component-wise.
VECMAT_SCALAR_API void vec4_clamp_ptr_scalar(vector4 *res, const vector4 *v, const vector4 *min, const vector4 *max)
Performs component-wise clamping of a vector4 to the specified min and max bounds.
void vec4_normalize_ptr(vector4 *res, const vector4 *v)
void vec4_sub_scalar_ptr(vector4 *res, const vector4 *v, const vm_float_t s)
VECMAT_SCALAR_API void vec4_mul_scalar_ptr_scalar(vector4 *res, const vector4 *v, const vm_float_t s)
Performs component-wise multiplication of a vector4 by a scalar.
VECMAT_SCALAR_API void vec4_sub_scalar_ptr_scalar(vector4 *res, const vector4 *v, const vm_float_t s)
Subtracts a scalar from each component.
void vec4_slide_ptr(vector4 *res, const vector4 *v, const vector4 *normal)
Removes the component of v along normal.
VECMAT_SCALAR_API void vec4_min_ptr_scalar(vector4 *res, const vector4 *a, const vector4 *b)
Performs component-wise minimum of two vector4.
void vec4_mul_ptr(vector4 *res, const vector4 *a, const vector4 *b)
VECMAT_SCALAR_API void vec4_ceil_ptr_scalar(vector4 *res, const vector4 *v)
Performs component-wise ceiling of a vector4.
VECMAT_SCALAR_API void vec4_fract_ptr_scalar(vector4 *res, const vector4 *v)
Returns the fractional part of each component.
void vec4_sub_ptr(vector4 *res, const vector4 *a, const vector4 *b)
VECMAT_SCALAR_API void vec4_add_scalar_ptr_scalar(vector4 *res, const vector4 *v, const vm_float_t s)
Adds a scalar to each component.
VECMAT_SCALAR_API void vec4_lerp_ptr_scalar(vector4 *res, const vector4 *a, const vector4 *b, const vm_float_t t)
Performs linear interpolation between two vector4 with interpolation factor t.
void vec4_clamp_ptr(vector4 *res, const vector4 *v, const vector4 *min, const vector4 *max)