Some function about quaternion 3x3matrix and random
typedef float matrix[9];
typedef float3 vector;
{ return linear interpolation between the value a and b }
{ return linear interpolation between the vector a and b }
{ takes the value in the range (smin.smax) and shifts it to the corresponding value in the new range (min,max) }
{ takes the value in the range (0,1) and shifts it to the corresponding value in the new range (min,max) }
{ takes the vector in range (smin.smax) and shifts it to the corresponding vector in the new range (min,max) }
{ computes the angle between vector v1 and v2 }
{ normalizes quaternion q }
{ rotates vector v by quaternion q }
{ computes the rotation quaternion which rotates the vector v1 onto the vector v2 }
{ creates a quaternion from euler angles }
{ creates euler angle representing quaternion }
{ generates a quaternion using angle and axi }
{ converts a quaternion to a 3x3matrix }
{ multiplies two quaternions and returns the result }
{ inverts a quaternion rotation }
{ return linear interpolation between the q1 and q2 }
{ return a quaternion blend between q1 and q2 based on the bias }
{ converts a quaternion to axi and angle }
{ core of random }
{ return random float }
{ return random vector }
{ makes matrix a become identity matrix }
{ copies matrix b to a }
{ stores matrix to attribute }
{ loads matix from attribute }
{ multiplies matrix b,c and apply the result to matrix a }
{ vector multiply matrix }
{ scales the matrix a in three directions simultaneously (X, Y, Z - given by the components of the scale_vector) }
{ scales the mateix a ,d is scaled direction,k is strength }