INNER CODE UNIT · C++
halfStart
camila314/gdp · Slerp2D.cpp:2
float halfStart = startAngle * 0.5f;
float halfEnd = endAngle * 0.5f;
float cosStart = cosf(halfStart);
float sinStart = sinf(halfStart);
float cosEnd = cosf(halfEnd);
float sinEnd = sinf(halfEnd);
float dot = (cosStart * cosEnd) + (sinStart * sinEnd);
float weightStart, weightEnd;
if (dot < 0.f) {
dot = -dot;
sinEnd = -sinEnd;
cosEnd = -cosEnd;
}
if (1.f - dot > 0.0001f) {