Stop reinventing lerp() all over the place.

This commit is contained in:
Mari the Deer 2022-05-29 18:07:30 +02:00
commit 65597c181a
10 changed files with 38 additions and 31 deletions

View file

@ -60,7 +60,7 @@ extend Class SWWMHandler
private ui void DrawActor( RenderEvent e, Actor a )
{
Vector3 pos = a.prev*(1.-e.FracTic)+a.pos*e.FracTic;
Vector3 pos = SWWMUtility.LerpVector3(a.prev,a.pos,e.FracTic);
if ( a is 'DynamicLight' ) DrawWorldCircle(e,pos,a.args[3]*2,Color(a.args[0],a.args[1],a.args[2]));
if ( (a.radius > 0.) && (a.height > 0.) )
{
@ -86,9 +86,9 @@ extend Class SWWMHandler
DrawWorldLine(e,pos,pos+y*16,"Green");
DrawWorldLine(e,pos,pos+z*16,"Blue");
if ( a.vel != (0,0,0) ) DrawWorldLine(e,pos,pos+a.vel*GameTicRate,"Yellow");
if ( a.target ) DrawWorldLine(e,pos,a.target.prev*(1.-e.FracTic)+a.target.pos*e.FracTic,"Gold");
if ( a.tracer ) DrawWorldLine(e,pos,a.tracer.prev*(1.-e.FracTic)+a.tracer.pos*e.FracTic,"Orange");
if ( a.master ) DrawWorldLine(e,pos,a.master.prev*(1.-e.FracTic)+a.master.pos*e.FracTic,"Purple");
if ( a.target ) DrawWorldLine(e,pos,SWWMUtility.LerpVector3(a.target.prev,a.target.pos,e.FracTic),"Gold");
if ( a.tracer ) DrawWorldLine(e,pos,SWWMUtility.LerpVector3(a.tracer.prev,a.tracer.pos,e.FracTic),"Orange");
if ( a.master ) DrawWorldLine(e,pos,SWWMUtility.LerpVector3(a.master.prev,a.master.pos,e.FracTic),"Purple");
double hdiff = a.Height/2;
if ( a.bFLOATBOB ) hdiff += a.GetBobOffset();
Vector3 ndc = SWWMUtility.ProjectPoint(projdata,e.viewpos+level.Vec3Diff(e.viewpos,pos+(0,0,hdiff)));