Exemplo n.º 1
0
float MUST_USE_RESULT Quat::AngleBetween(const Quat &target) const
{
	assume(this->IsInvertible());
	Quat delta = target / *this;
	delta.Normalize();
	return delta.Angle();
}
Exemplo n.º 2
0
float3 MUST_USE_RESULT Quat::SlerpVectorAbs(const float3 &from, const float3 &to, float angleRadians)
{
	if (angleRadians <= 0.f)
		return from;
	Quat q = Quat::RotateFromTo(from, to);
	float a = q.Angle();
	if (a <= angleRadians)
		return to;
	float t = angleRadians / a;
	q = Slerp(Quat::identity, q, t);
	return q.Transform(from);
}
Exemplo n.º 3
0
float Quat::AngleBetween(const Quat &target) const
{
	assume(this->IsInvertible());
	Quat q = target / *this;
	return q.Angle();
}