mirror of
https://github.com/guezoloic/t3dsr.git
synced 2026-01-25 12:34:24 +00:00
feat(vec3): add a few basic functions
This commit is contained in:
@@ -28,13 +28,34 @@ inline static Vec3f_t vec3f_clone(const Vec3f_t *__restrict v)
|
||||
return *v;
|
||||
}
|
||||
|
||||
Vec3f_t vec3f_add_r(Vec3f_t *__restrict out, Vec3f_t a);
|
||||
Vec3f_t* vec3f_add_r(Vec3f_t *__restrict out, Vec3f_t a);
|
||||
Vec3f_t vec3f_add(Vec3f_t a, Vec3f_t b);
|
||||
|
||||
Vec3f_t vec3f_sub_r(Vec3f_t *__restrict out, Vec3f_t a);
|
||||
Vec3f_t* vec3f_sub_r(Vec3f_t *__restrict out, Vec3f_t a);
|
||||
Vec3f_t vec3f_sub(Vec3f_t a, Vec3f_t b);
|
||||
|
||||
Vec3f_t vec3f_scale_r(Vec3f_t *__restrict out, float scale);
|
||||
Vec3f_t* vec3f_scale_r(Vec3f_t *__restrict out, float scale);
|
||||
Vec3f_t vec3f_scale(Vec3f_t a, float scale);
|
||||
|
||||
float vec3f_dot(Vec3f_t a, Vec3f_t b);
|
||||
|
||||
inline static float vec3f_len(Vec3f_t v)
|
||||
{
|
||||
return sqrtf(vec3f_dot(v, v));
|
||||
}
|
||||
|
||||
Vec3f_t* vec3f_norm_r(Vec3f_t *__restrict v);
|
||||
Vec3f_t vec3f_norm(Vec3f_t v);
|
||||
|
||||
Vec3f_t* vec3f_lerp_r(Vec3f_t *__restrict a, Vec3f_t b, float t);
|
||||
Vec3f_t vec3f_lerp(Vec3f_t a, Vec3f_t b, float t);
|
||||
|
||||
float vec3f_angle(Vec3f_t a, Vec3f_t b);
|
||||
|
||||
Vec3f_t vec3f_proj(Vec3f_t a, Vec3f_t b);
|
||||
|
||||
Vec3f_t vec3f_refl(Vec3f_t v, Vec3f_t normal);
|
||||
|
||||
float vec3f_dist(Vec3f_t a, Vec3f_t b);
|
||||
|
||||
#endif /* vec3_h */
|
||||
|
||||
Reference in New Issue
Block a user