mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +00:00
- some more inline functions.
This commit is contained in:
parent
87689d3ba6
commit
5b610390e1
1 changed files with 42 additions and 0 deletions
42
src/actor.h
42
src/actor.h
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue