Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > e85a8c1fbd60bb44610f0b5fb0c9ddd8 > files > 10

libspnav-devel-0.2.2-2.fc15.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);
}