예제 #1
0
float MUST_USE_RESULT Quat::AngleBetween(const Quat &target) const
{
	assume(this->IsInvertible());
	Quat delta = target / *this;
	delta.Normalize();
	return delta.Angle();
}
예제 #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);
}
예제 #3
0
float Quat::AngleBetween(const Quat &target) const
{
	assume(this->IsInvertible());
	Quat q = target / *this;
	return q.Angle();
}