Skip to content

Commit

Permalink
Fix spline1 function in non-static-linking builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad2001MFS committed Oct 5, 2023
1 parent 24f2c2f commit b71d948
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/xrEngine/FDemoPlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,27 @@ void CDemoPlay::stat_Stop()
#define FIX(a) \
while (a >= m_count) \
a -= m_count
extern void spline1(float t, Fvector* p, Fvector* ret);
static void spline1(float t, Fvector* p, Fvector* ret)
{
float t2 = t * t;
float t3 = t2 * t;
float m[4];

ret->x = 0.0f;
ret->y = 0.0f;
ret->z = 0.0f;
m[0] = (0.5f * ((-1.0f * t3) + (2.0f * t2) + (-1.0f * t)));
m[1] = (0.5f * ((3.0f * t3) + (-5.0f * t2) + (0.0f * t) + 2.0f));
m[2] = (0.5f * ((-3.0f * t3) + (4.0f * t2) + (1.0f * t)));
m[3] = (0.5f * ((1.0f * t3) + (-1.0f * t2) + (0.0f * t)));

for (int i = 0; i < 4; i++)
{
ret->x += p[i].x * m[i];
ret->y += p[i].y * m[i];
ret->z += p[i].z * m[i];
}
}

bool CDemoPlay::ProcessCam(SCamEffectorInfo& info)
{
Expand Down

0 comments on commit b71d948

Please sign in to comment.