File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,27 @@ void CDemoPlay::stat_Stop()
198
198
#define FIX (a ) \
199
199
while (a >= m_count) \
200
200
a -= m_count
201
- extern void spline1 (float t, Fvector* p, Fvector* ret);
201
+ static void spline1 (float t, Fvector* p, Fvector* ret)
202
+ {
203
+ float t2 = t * t;
204
+ float t3 = t2 * t;
205
+ float m[4 ];
206
+
207
+ ret->x = 0 .0f ;
208
+ ret->y = 0 .0f ;
209
+ ret->z = 0 .0f ;
210
+ m[0 ] = (0 .5f * ((-1 .0f * t3) + (2 .0f * t2) + (-1 .0f * t)));
211
+ m[1 ] = (0 .5f * ((3 .0f * t3) + (-5 .0f * t2) + (0 .0f * t) + 2 .0f ));
212
+ m[2 ] = (0 .5f * ((-3 .0f * t3) + (4 .0f * t2) + (1 .0f * t)));
213
+ m[3 ] = (0 .5f * ((1 .0f * t3) + (-1 .0f * t2) + (0 .0f * t)));
214
+
215
+ for (int i = 0 ; i < 4 ; i++)
216
+ {
217
+ ret->x += p[i].x * m[i];
218
+ ret->y += p[i].y * m[i];
219
+ ret->z += p[i].z * m[i];
220
+ }
221
+ }
202
222
203
223
bool CDemoPlay::ProcessCam (SCamEffectorInfo& info)
204
224
{
You can’t perform that action at this time.
0 commit comments