/apps/demos/scenery: drift ! steer !

This commit is contained in:
veclavtalica
2025-03-05 05:26:05 +03:00
parent f90b973d86
commit 787977b747
2 changed files with 63 additions and 20 deletions

View File

@ -86,6 +86,10 @@ static inline Vec3 vec3_norm(Vec3 a) {
return vec3_scale(a, 1.0f / n);
}
static inline float vec3_angle(Vec3 a, Vec3 b) {
return acosf(vec3_dot(vec3_norm(a), vec3_norm(b)));
}
static inline Vec3 vec3_rotate(Vec3 v, float angle, Vec3 axis) {
/* from cglm */
Vec3 v1, v2, k;