d[0] = a[0]+b[0]; d[1] = a[1]+b[1]; d[2] = a[2]+b[2];
}
+static inline void v3i_add( v3i a, v3i b, v3i d )
+{
+ d[0] = a[0]+b[0]; d[1] = a[1]+b[1]; d[2] = a[2]+b[2];
+}
+
static inline void v4_add( v4f a, v4f b, v4f d )
{
d[0] = a[0]+b[0];
d[0] = a[0]-b[0]; d[1] = a[1]-b[1]; d[2] = a[2]-b[2];
}
+static inline void v3i_sub( v3i a, v3i b, v3i d )
+{
+ d[0] = a[0]-b[0]; d[1] = a[1]-b[1]; d[2] = a[2]-b[2];
+}
+
static inline void v3_mul( v3f a, v3f b, v3f d )
{
d[0] = a[0]*b[0]; d[1] = a[1]*b[1]; d[2] = a[2]*b[2];
static inline void q_nlerp( v4f a, v4f b, float t, v4f d )
{
- if( v4_dot(a,b) < 0.0f )
- {
+ if( v4_dot(a,b) < 0.0f ){
v4_muls( b, -1.0f, d );
v4_lerp( a, d, t, d );
}
static inline float vg_randf(void)
{
+ /* TODO: replace with our own rand */
return (float)rand()/(float)(RAND_MAX);
}
v3_muladds( p, p0, 3.0f*tt -ttt -3.0f*t +1.0f, p );
}
+static void eval_bezier3( v3f p0, v3f p1, v3f p2, float t, v3f p )
+{
+ float u = 1.0f-t;
+
+ v3_muls( p0, u*u, p );
+ v3_muladds( p, p1, 2.0f*u*t, p );
+ v3_muladds( p, p2, t*t, p );
+}
+
#endif /* VG_M_H */