- Enough with this "momentum" garbage. What Doom calls "momentum" is really
velocity, and now it's known as such. The actor variables momx/momy/momz are now known as velx/vely/velz, and the ACS functions GetActorMomX/Y/Z are now known as GetActorVelX/Y/Z. For compatibility, momx/momy/momz will continue to work as aliases from DECORATE. The ACS functions, however, require you to use the new name, since they never saw an official release yet. SVN r1689 (trunk)
This commit is contained in:
parent
ed0d804792
commit
e4af82ae96
88 changed files with 881 additions and 863 deletions
|
|
@ -65,7 +65,7 @@ static FRandom pr_slook ("SlooK");
|
|||
static FRandom pr_skiptarget("SkipTarget");
|
||||
|
||||
// movement interpolation is fine for objects that are moved by their own
|
||||
// momentum. But for monsters it is problematic.
|
||||
// velocity. But for monsters it is problematic.
|
||||
// 1. They don't move every tic
|
||||
// 2. Their animation is not designed for movement interpolation
|
||||
// The result is that they tend to 'glide' across the floor
|
||||
|
|
@ -475,8 +475,8 @@ bool P_Move (AActor *actor)
|
|||
actor->x = origx;
|
||||
actor->y = origy;
|
||||
movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4;
|
||||
actor->momx += FixedMul (deltax, movefactor);
|
||||
actor->momy += FixedMul (deltay, movefactor);
|
||||
actor->velx += FixedMul (deltax, movefactor);
|
||||
actor->vely += FixedMul (deltay, movefactor);
|
||||
}
|
||||
|
||||
if (!try_ok)
|
||||
|
|
@ -1522,7 +1522,7 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround)
|
|||
{
|
||||
if ((P_AproxDistance (player->mo->x - actor->x,
|
||||
player->mo->y - actor->y) > 2*MELEERANGE)
|
||||
&& P_AproxDistance (player->mo->momx, player->mo->momy)
|
||||
&& P_AproxDistance (player->mo->velx, player->mo->vely)
|
||||
< 5*FRACUNIT)
|
||||
{ // Player is sneaking - can't detect
|
||||
return false;
|
||||
|
|
@ -1994,8 +1994,8 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
|
|||
else
|
||||
{
|
||||
actor->FastChaseStrafeCount = 0;
|
||||
actor->momx = 0;
|
||||
actor->momy = 0;
|
||||
actor->velx = 0;
|
||||
actor->vely = 0;
|
||||
fixed_t dist = P_AproxDistance (actor->x - actor->target->x, actor->y - actor->target->y);
|
||||
if (dist < CLASS_BOSS_STRAFE_RANGE)
|
||||
{
|
||||
|
|
@ -2004,8 +2004,8 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi
|
|||
angle_t ang = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y);
|
||||
if (pr_chase() < 128) ang += ANGLE_90;
|
||||
else ang -= ANGLE_90;
|
||||
actor->momx = 13 * finecosine[ang>>ANGLETOFINESHIFT];
|
||||
actor->momy = 13 * finesine[ang>>ANGLETOFINESHIFT];
|
||||
actor->velx = 13 * finecosine[ang>>ANGLETOFINESHIFT];
|
||||
actor->vely = 13 * finesine[ang>>ANGLETOFINESHIFT];
|
||||
actor->FastChaseStrafeCount = 3; // strafe time
|
||||
}
|
||||
}
|
||||
|
|
@ -2165,7 +2165,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates)
|
|||
abs(corpsehit-> y - viletryy) > maxdist )
|
||||
continue; // not actually touching
|
||||
|
||||
corpsehit->momx = corpsehit->momy = 0;
|
||||
corpsehit->velx = corpsehit->vely = 0;
|
||||
// [RH] Check against real height and radius
|
||||
|
||||
fixed_t oldheight = corpsehit->height;
|
||||
|
|
@ -2371,8 +2371,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
|
|||
// Let the aim trail behind the player
|
||||
self->angle = R_PointToAngle2 (self->x,
|
||||
self->y,
|
||||
self->target->x - self->target->momx * 3,
|
||||
self->target->y - self->target->momy * 3);
|
||||
self->target->x - self->target->velx * 3,
|
||||
self->target->y - self->target->vely * 3);
|
||||
|
||||
if (self->target->flags & MF_SHADOW)
|
||||
{
|
||||
|
|
@ -2562,14 +2562,14 @@ void P_TossItem (AActor *item)
|
|||
|
||||
if (style==2)
|
||||
{
|
||||
item->momx += pr_dropitem.Random2(7) << FRACBITS;
|
||||
item->momy += pr_dropitem.Random2(7) << FRACBITS;
|
||||
item->velx += pr_dropitem.Random2(7) << FRACBITS;
|
||||
item->vely += pr_dropitem.Random2(7) << FRACBITS;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->momx = pr_dropitem.Random2() << 8;
|
||||
item->momy = pr_dropitem.Random2() << 8;
|
||||
item->momz = FRACUNIT*5 + (pr_dropitem() << 10);
|
||||
item->velx = pr_dropitem.Random2() << 8;
|
||||
item->vely = pr_dropitem.Random2() << 8;
|
||||
item->velz = FRACUNIT*5 + (pr_dropitem() << 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue