v3_muls( a, 1.f / v3_length( a ), a );
}
-static inline f32 vg_lerpf( f32 a, f32 b, f32 t )
-{
+static inline f32 vg_lerpf( f32 a, f32 b, f32 t ){
return a + t*(b-a);
}
return a + t*(b-a);
}
+static inline void vg_slewf( f32 *a, f32 b, f32 speed ){
+ f32 d = vg_signf( b-*a ),
+ c = *a + d*speed;
+ *a = vg_minf( b*d, c*d ) * d;
+}
+
+static inline f32 vg_smoothstepf( f32 x ){
+ return x*x*(3.0f - 2.0f*x);
+}
+
+
/* correctly lerp around circular period -pi -> pi */
static f32 vg_alerpf( f32 a, f32 b, f32 t )
{
d[3] = q[3]*s;
}
-static inline void q_nlerp( v4f a, v4f b, f32 t, v4f d )
-{
+static inline void q_nlerp( v4f a, v4f b, f32 t, v4f d ){
if( v4_dot(a,b) < 0.0f ){
- v4_muls( b, -1.0f, d );
- v4_lerp( a, d, t, d );
+ v4f c;
+ v4_muls( b, -1.0f, c );
+ v4_lerp( a, c, t, d );
}
else
v4_lerp( a, b, t, d );