mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- float_vel wraps
This commit is contained in:
parent
0aad018796
commit
cf90970121
5 changed files with 10 additions and 10 deletions
|
@ -278,8 +278,8 @@ void lotsofstuff(DDukeActor* actor, int n, int spawntype)
|
|||
void ms(DDukeActor* const actor)
|
||||
{
|
||||
//T1,T2 and T3 are used for all the sector moving stuff!!!
|
||||
actor->spr.pos.X += actor->spr.xvel * actor->spr.angle.Cos() * inttoworld;
|
||||
actor->spr.pos.Y += actor->spr.xvel * actor->spr.angle.Sin() * inttoworld;
|
||||
actor->spr.pos.X += actor->float_xvel() * actor->spr.angle.Cos();
|
||||
actor->spr.pos.Y += actor->float_xvel() * actor->spr.angle.Sin();
|
||||
|
||||
int j = actor->temp_data[1];
|
||||
int k = actor->temp_data[2];
|
||||
|
|
|
@ -524,7 +524,7 @@ int DoEelDeath(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
// slide while falling
|
||||
auto vec = actor->spr.angle.ToVector() * actor->spr.xvel * inttoworld;
|
||||
auto vec = actor->spr.angle.ToVector() * actor->float_xvel();
|
||||
|
||||
actor->user.coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
|
||||
DoFindGroundPoint(actor);
|
||||
|
|
|
@ -504,7 +504,7 @@ int DoHornetDeath(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
// slide while falling
|
||||
auto vec = actor->spr.angle.ToVector() * actor->spr.xvel * inttoworld;
|
||||
auto vec = actor->spr.angle.ToVector() * actor->float_xvel();
|
||||
|
||||
actor->user.coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, 1, ACTORMOVETICS);
|
||||
|
||||
|
|
|
@ -1448,7 +1448,7 @@ void PlaceActorsOnTracks(void)
|
|||
actor->user.track_dir = 1;
|
||||
}
|
||||
|
||||
actor->user.track_vel = actor->spr.xvel * 256;
|
||||
actor->user.track_vel = actor->int_xvel() * 256;
|
||||
actor->user.vel_tgt = actor->user.track_vel;
|
||||
actor->user.vel_rate = 6;
|
||||
|
||||
|
@ -3433,7 +3433,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
|
||||
// (velocity * difference between the target and the object) /
|
||||
// distance
|
||||
actor->set_int_zvel((int) -((actor->spr.xvel * (actor->spr.pos.Z - tpoint->pos.Z)) / dist));
|
||||
actor->set_int_zvel((int) -((actor->int_xvel() * (actor->spr.pos.Z - tpoint->pos.Z)) / dist));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3487,7 +3487,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
else
|
||||
{
|
||||
// calculate a new x and y
|
||||
vec.XY() = actor->spr.angle.ToVector() * actor->spr.xvel * inttoworld;
|
||||
vec.XY() = actor->spr.angle.ToVector() * actor->float_xvel();
|
||||
}
|
||||
|
||||
if (actor->float_zvel() != 0)
|
||||
|
|
|
@ -7715,7 +7715,7 @@ int ComboMissileSeek(DSWActor* actor, int16_t delay_tics, int16_t aware_range/*,
|
|||
double zdiff = actor->spr.pos.Z - ActorZOfTop(goal) - (ActorSizeZ(goal) * 0.25);
|
||||
double dist = g_sqrt((actor->spr.pos.XY() - goal->spr.pos.XY()).LengthSquared() + zdiff * zdiff);
|
||||
|
||||
actor->user.change.Z = (actor->spr.xvel * zinttoworld) * zdiff / dist + actor->user.change.Z * (15 / 16.);
|
||||
actor->user.change.Z = (actor->float_xvel()) * zdiff / dist + actor->user.change.Z * (15 / 16.);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -7779,7 +7779,7 @@ int VectorMissileSeek(DSWActor* actor, int16_t delay_tics, int16_t turn_speed, i
|
|||
|
||||
auto oc = actor->user.change;
|
||||
|
||||
auto vel = (actor->spr.xvel * zinttoworld) / dist;
|
||||
auto vel = (actor->int_xvel() * zinttoworld) / dist;
|
||||
actor->user.change = DVector3(delta, -zdiff) * vel;
|
||||
|
||||
// the large turn_speed is the slower the turn
|
||||
|
@ -7827,7 +7827,7 @@ int VectorWormSeek(DSWActor* actor, int16_t delay_tics, int16_t aware_range1, in
|
|||
|
||||
auto oc = actor->user.change;
|
||||
|
||||
auto vel = (actor->spr.xvel * zinttoworld) / dist;
|
||||
auto vel = (actor->int_xvel() * zinttoworld) / dist;
|
||||
actor->user.change = DVector3(delta, zdiff) * vel + oc * (7. / 8);
|
||||
|
||||
SetAngleFromChange(actor);
|
||||
|
|
Loading…
Reference in a new issue