Sophie

Sophie

distrib > Momonga > development > i686 > media > os > by-pkgid > 8c540a784f66580d7d5d8b4a0b34456f > files > 10

libspnav-devel-0.2.2-1m.mo8.i686.rpm

#include <math.h>
#include "vmath.h"

quat_t quat_rotate(quat_t q, float angle, float x, float y, float z)
{
	quat_t rq;
	float half_angle = angle * 0.5;
	float sin_half = sin(half_angle);

	rq.w = cos(half_angle);
	rq.x = x * sin_half;
	rq.y = y * sin_half;
	rq.z = z * sin_half;

	return quat_mul(q, rq);
}