mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Model tilts
- Add modeltilt variable, for more manual control of the model tilting. By default this just copies standingslope, but doesn't get cleared in the air. - Shadows & trailing bananas now tilt to match the ground they are on. - Rocket Sneakers & afterimages now tilt to match the player's current orientation.
This commit is contained in:
parent
a752e6c8e4
commit
95cbee52c6
7 changed files with 33 additions and 4 deletions
|
@ -1647,11 +1647,11 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
|
||||||
#ifdef USE_FTRANSFORM_ANGLEZ
|
#ifdef USE_FTRANSFORM_ANGLEZ
|
||||||
// Slope rotation from Kart
|
// Slope rotation from Kart
|
||||||
p.anglez = 0.0f;
|
p.anglez = 0.0f;
|
||||||
if (spr->mobj->standingslope)
|
if (spr->mobj->modeltilt)
|
||||||
{
|
{
|
||||||
fixed_t tempz = spr->mobj->standingslope->normal.z;
|
fixed_t tempz = spr->mobj->modeltilt->normal.z;
|
||||||
fixed_t tempy = spr->mobj->standingslope->normal.y;
|
fixed_t tempy = spr->mobj->modeltilt->normal.y;
|
||||||
fixed_t tempx = spr->mobj->standingslope->normal.x;
|
fixed_t tempx = spr->mobj->modeltilt->normal.x;
|
||||||
fixed_t tempangle = AngleFixed(R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx));
|
fixed_t tempangle = AngleFixed(R_PointToAngle2(0, 0, FixedSqrt(FixedMul(tempy, tempy) + FixedMul(tempz, tempz)), tempx));
|
||||||
p.anglez = FIXED_TO_FLOAT(tempangle);
|
p.anglez = FIXED_TO_FLOAT(tempangle);
|
||||||
tempangle = -AngleFixed(R_PointToAngle2(0, 0, tempz, tempy));
|
tempangle = -AngleFixed(R_PointToAngle2(0, 0, tempz, tempy));
|
||||||
|
|
|
@ -2928,6 +2928,9 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
if (thing->momz <= 0)
|
if (thing->momz <= 0)
|
||||||
{
|
{
|
||||||
thing->standingslope = tmfloorslope;
|
thing->standingslope = tmfloorslope;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
thing->modeltilt = thing->standingslope;
|
||||||
|
#endif
|
||||||
if (thing->momz == 0 && thing->player && !startingonground)
|
if (thing->momz == 0 && thing->player && !startingonground)
|
||||||
P_PlayerHitFloor(thing->player, true);
|
P_PlayerHitFloor(thing->player, true);
|
||||||
}
|
}
|
||||||
|
@ -2939,6 +2942,9 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||||
if (thing->momz >= 0)
|
if (thing->momz >= 0)
|
||||||
{
|
{
|
||||||
thing->standingslope = tmceilingslope;
|
thing->standingslope = tmceilingslope;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
thing->modeltilt = thing->standingslope;
|
||||||
|
#endif
|
||||||
if (thing->momz == 0 && thing->player && !startingonground)
|
if (thing->momz == 0 && thing->player && !startingonground)
|
||||||
P_PlayerHitFloor(thing->player, true);
|
P_PlayerHitFloor(thing->player, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1985,6 +1985,9 @@ void P_XYMovement(mobj_t *mo)
|
||||||
// Now compare the Zs of the different quantizations
|
// Now compare the Zs of the different quantizations
|
||||||
if (oldangle-newangle > ANG30 && oldangle-newangle < ANGLE_180) { // Allow for a bit of sticking - this value can be adjusted later
|
if (oldangle-newangle > ANG30 && oldangle-newangle < ANGLE_180) { // Allow for a bit of sticking - this value can be adjusted later
|
||||||
mo->standingslope = oldslope;
|
mo->standingslope = oldslope;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
mo->modeltilt = mo->standingslope;
|
||||||
|
#endif
|
||||||
P_SlopeLaunch(mo);
|
P_SlopeLaunch(mo);
|
||||||
|
|
||||||
//CONS_Printf("launched off of slope - ");
|
//CONS_Printf("launched off of slope - ");
|
||||||
|
@ -2557,6 +2560,9 @@ boolean P_ZMovement(mobj_t *mo)
|
||||||
if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM))
|
if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM))
|
||||||
{
|
{
|
||||||
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope;
|
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
mo->modeltilt = mo->standingslope;
|
||||||
|
#endif
|
||||||
P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope);
|
P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -394,6 +394,9 @@ typedef struct mobj_s
|
||||||
INT32 cvmem;
|
INT32 cvmem;
|
||||||
|
|
||||||
struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?)
|
struct pslope_s *standingslope; // The slope that the object is standing on (shouldn't need synced in savegames, right?)
|
||||||
|
#ifdef HWRENDER
|
||||||
|
struct pslope_s *modeltilt; // Slope used for model tilting. Also is not synched, this is totally visual.
|
||||||
|
#endif
|
||||||
|
|
||||||
boolean resetinterp; // if true, some fields should not be interpolated (see R_InterpolateMobjState implementation)
|
boolean resetinterp; // if true, some fields should not be interpolated (see R_InterpolateMobjState implementation)
|
||||||
boolean colorized; // Whether the mobj uses the rainbow colormap
|
boolean colorized; // Whether the mobj uses the rainbow colormap
|
||||||
|
|
|
@ -2996,7 +2996,11 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
|
||||||
if (diff2 & MD2_HPREV)
|
if (diff2 & MD2_HPREV)
|
||||||
mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p);
|
mobj->hprev = (mobj_t *)(size_t)READUINT32(save_p);
|
||||||
if (diff2 & MD2_SLOPE)
|
if (diff2 & MD2_SLOPE)
|
||||||
|
{
|
||||||
mobj->standingslope = P_SlopeById(READUINT16(save_p));
|
mobj->standingslope = P_SlopeById(READUINT16(save_p));
|
||||||
|
#ifdef HWRENDER
|
||||||
|
mobj->modeltilt = mobj->standingslope;
|
||||||
|
#endif
|
||||||
if (diff2 & MD2_COLORIZED)
|
if (diff2 & MD2_COLORIZED)
|
||||||
mobj->colorized = READUINT8(save_p);
|
mobj->colorized = READUINT8(save_p);
|
||||||
if (diff2 & MD2_MIRRORED)
|
if (diff2 & MD2_MIRRORED)
|
||||||
|
|
|
@ -899,6 +899,9 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
|
||||||
if (P_MobjFlip(thing)*(thing->momz) < 0) // falling, land on slope
|
if (P_MobjFlip(thing)*(thing->momz) < 0) // falling, land on slope
|
||||||
{
|
{
|
||||||
thing->standingslope = slope;
|
thing->standingslope = slope;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
thing->modeltilt = thing->standingslope;
|
||||||
|
#endif
|
||||||
if (!thing->player || !(thing->player->pflags & PF_BOUNCING))
|
if (!thing->player || !(thing->player->pflags & PF_BOUNCING))
|
||||||
thing->momz = -P_MobjFlip(thing);
|
thing->momz = -P_MobjFlip(thing);
|
||||||
}
|
}
|
||||||
|
@ -915,6 +918,9 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope)
|
||||||
thing->momx = mom.x;
|
thing->momx = mom.x;
|
||||||
thing->momy = mom.y;
|
thing->momy = mom.y;
|
||||||
thing->standingslope = slope;
|
thing->standingslope = slope;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
thing->modeltilt = thing->standingslope;
|
||||||
|
#endif
|
||||||
if (!thing->player || !(thing->player->pflags & PF_BOUNCING))
|
if (!thing->player || !(thing->player->pflags & PF_BOUNCING))
|
||||||
thing->momz = -P_MobjFlip(thing);
|
thing->momz = -P_MobjFlip(thing);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1995,6 +1995,10 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
|
||||||
|
|
||||||
ghost->fuse = ghost->info->damage;
|
ghost->fuse = ghost->info->damage;
|
||||||
ghost->skin = mobj->skin;
|
ghost->skin = mobj->skin;
|
||||||
|
ghost->standingslope = mobj->standingslope;
|
||||||
|
#ifdef HWRENDER
|
||||||
|
ghost->modeltilt = mobj->modeltilt;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (mobj->flags2 & MF2_OBJECTFLIP)
|
if (mobj->flags2 & MF2_OBJECTFLIP)
|
||||||
ghost->flags |= MF2_OBJECTFLIP;
|
ghost->flags |= MF2_OBJECTFLIP;
|
||||||
|
|
Loading…
Reference in a new issue