mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Minor changes
This commit is contained in:
parent
6180ddde32
commit
8847cf77b4
6 changed files with 21 additions and 18 deletions
|
@ -2609,9 +2609,11 @@ static int slope_set(lua_State *L)
|
|||
slope->o.z = luaL_checkfixed(L, -1);
|
||||
else
|
||||
slope->o.z = 0;
|
||||
slope->dorigin.x = FixedToDouble(slope->o.x);
|
||||
slope->dorigin.y = FixedToDouble(slope->o.y);
|
||||
slope->dorigin.z = FixedToDouble(slope->o.z);
|
||||
DVector3_Load(&slope->dorigin,
|
||||
FixedToDouble(slope->o.x),
|
||||
FixedToDouble(slope->o.y),
|
||||
FixedToDouble(slope->o.z)
|
||||
);
|
||||
lua_pop(L, 1);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
// Copyright (C) 2024 by Sonic Team Junior.
|
||||
// Copyright (C) 2009 by Stephen McGranahan.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 1999-2024 by Sonic Team Junior.
|
||||
// Copyright (C) 2024 by Sonic Team Junior.
|
||||
// Copyright (C) 2009 by Stephen McGranahan.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2004 by Stephen McGranahan
|
||||
// Copyright (C) 2009 by Stephen McGranahan.
|
||||
// Copyright (C) 2015-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
|
@ -38,17 +38,17 @@ void P_CalculateSlopeNormal(pslope_t *slope) {
|
|||
static void CalculateVectors(pslope_t *slope, dvector3_t *dnormal)
|
||||
{
|
||||
double hyp = hypot(dnormal->x, dnormal->y);
|
||||
if (fpclassify(hyp) == FP_ZERO)
|
||||
|
||||
if (fpclassify(hyp) == FP_NORMAL)
|
||||
{
|
||||
slope->dnormdir.x = slope->dnormdir.y = 0.0;
|
||||
slope->dzdelta = 0.0;
|
||||
slope->dnormdir.x = -dnormal->x / hyp;
|
||||
slope->dnormdir.y = -dnormal->y / hyp;
|
||||
slope->dzdelta = hyp / dnormal->z;
|
||||
}
|
||||
else
|
||||
{
|
||||
slope->dnormdir.x = -(dnormal->x / hyp);
|
||||
slope->dnormdir.y = -(dnormal->y / hyp);
|
||||
|
||||
slope->dzdelta = hyp / dnormal->z;
|
||||
slope->dnormdir.x = slope->dnormdir.y = 0.0;
|
||||
slope->dzdelta = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// SONIC ROBO BLAST 2
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2004 by Stephen McGranahan
|
||||
// Copyright (C) 2009 by Stephen McGranahan.
|
||||
// Copyright (C) 2015-2023 by Sonic Team Junior.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
|
|
|
@ -663,6 +663,7 @@ static void R_DrawSkyPlane(visplane_t *pl)
|
|||
// Returns the height of the sloped plane at (x, y) as a double
|
||||
static double R_GetSlopeZAt(const pslope_t *slope, fixed_t x, fixed_t y)
|
||||
{
|
||||
// If you want to reimplement this using just the equation constants, use this instead:
|
||||
// (d + a*x + b*y) * -(1.0 / c)
|
||||
|
||||
double px = FixedToDouble(x) - slope->dorigin.x;
|
||||
|
@ -712,11 +713,11 @@ void R_SetSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t zpos,
|
|||
return;
|
||||
}
|
||||
|
||||
// slope_v is the v direction vector in view space
|
||||
// the v direction vector in view space
|
||||
slope_v.x = cos(ang);
|
||||
slope_v.z = sin(ang);
|
||||
|
||||
// slope_u is the u direction vector in view space
|
||||
// the u direction vector in view space
|
||||
slope_u.x = sin(ang);
|
||||
slope_u.z = -cos(ang);
|
||||
|
||||
|
@ -754,11 +755,11 @@ void R_SetScaledSlopePlane(pslope_t *slope, fixed_t xpos, fixed_t ypos, fixed_t
|
|||
float xscale = FixedToFloat(xs);
|
||||
float yscale = FixedToFloat(ys);
|
||||
|
||||
// m is the v direction vector in view space
|
||||
// the v direction vector in view space
|
||||
slope_v.x = yscale * cos(ang);
|
||||
slope_v.z = yscale * sin(ang);
|
||||
|
||||
// n is the u direction vector in view space
|
||||
// the u direction vector in view space
|
||||
slope_u.x = xscale * sin(ang);
|
||||
slope_u.z = -xscale * cos(ang);
|
||||
|
||||
|
|
Loading…
Reference in a new issue