- moved Blood's velocity vector to DCoreActor.

This commit is contained in:
Christoph Oelckers 2022-09-01 20:33:22 +02:00
parent 2f7995619e
commit a5a04b1123
4 changed files with 13 additions and 10 deletions

View file

@ -45,6 +45,8 @@ public:
DVector3 opos;
int time;
DAngle oang;
vec3_t vel;
int16_t spritesetindex;
@ -209,6 +211,12 @@ public:
spr.yint = int(spr.yint * v);
}
DVector3 fVel() const
{
return { FixedToFloat(vel.X), FixedToFloat(vel.Y), FixedToFloat(vel.Z) };
}
// Same as above but with inverted y and z axes to match the renderer's coordinate system.
double interpolatedx(double const smoothratio, int const scale = 16)

View file

@ -677,7 +677,10 @@ void DCoreActor::Serialize(FSerializer& arc)
("sprite", spr)
("time", time)
("spritesetindex", spritesetindex)
("spriteext", sprext);
("spriteext", sprext)
("xvel", vel.X)
("yvel", vel.Y)
("zvel", vel.Z);
if (arc.isReading()) spsmooth = {};
}

View file

@ -19,7 +19,6 @@ class DBloodActor : public DCoreActor
public:
int dudeSlope;
vec3_t vel;
bool hasx;
XSPRITE xspr;
SPRITEHIT hit;
@ -43,11 +42,6 @@ public:
bool hasX() { return hasx; }
void addX() { hasx = true; }
DVector3 fVel() const
{
return { FixedToFloat(vel.X), FixedToFloat(vel.Y), FixedToFloat(vel.Z) };
}
void SetOwner(DBloodActor* own)
{
ownerActor = own;

View file

@ -471,9 +471,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, DUDEEXTRA& w, DUDE
void DBloodActor::Serialize(FSerializer& arc)
{
Super::Serialize(arc);
arc("xvel", vel.X)
("yvel", vel.Y)
("zvel", vel.Z)
arc
("hasx", hasx)
("basepoint", basePoint);