- some more inline functions.

This commit is contained in:
Christoph Oelckers 2016-01-17 16:49:15 +01:00
parent 87689d3ba6
commit 5b610390e1

View file

@ -588,6 +588,36 @@ enum
AMETA_BloodType3, // AxeBlood replacement type
};
struct fixedvec3
{
fixed_t x, y, z;
operator FVector3()
{
return FVector3(FIXED2FLOAT(x), FIXED2FLOAT(y), FIXED2FLOAT(z));
}
operator TVector3<double>()
{
return TVector3<double>(FIXED2DBL(x), FIXED2DBL(y), FIXED2DBL(z));
}
};
struct fixedvec2
{
fixed_t x, y;
operator FVector2()
{
return FVector2(FIXED2FLOAT(x), FIXED2FLOAT(y));
}
operator TVector2<double>()
{
return TVector2<double>(FIXED2DBL(x), FIXED2DBL(y));
}
};
struct FDropItem
{
FName Name;
@ -909,6 +939,18 @@ public:
return R_PointToAngle2(myx, myy, other->x, other->y);
}
fixedvec2 Vec2To(AActor *other) const
{
fixedvec2 ret = { other->x - x, other->y - y };
return ret;
}
fixedvec3 Vec3To(AActor *other) const
{
fixedvec3 ret = { other->x - x, other->y - y, other->z - z };
return ret;
}
inline void SetFriendPlayer(player_t *player);
bool IsVisibleToPlayer() const;