Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
3a09c475
Commit
3a09c475
authored
11 months ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Add comments
parent
e67e225f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#3876
passed
11 months ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/p_slopes.c
+21
-13
21 additions, 13 deletions
src/p_slopes.c
with
21 additions
and
13 deletions
src/p_slopes.c
+
21
−
13
View file @
3a09c475
...
@@ -852,7 +852,6 @@ fixed_t P_GetLightZAt(const lightlist_t *light, fixed_t x, fixed_t y)
...
@@ -852,7 +852,6 @@ fixed_t P_GetLightZAt(const lightlist_t *light, fixed_t x, fixed_t y)
return
light
->
slope
?
P_GetSlopeZAt
(
light
->
slope
,
x
,
y
)
:
light
->
height
;
return
light
->
slope
?
P_GetSlopeZAt
(
light
->
slope
,
x
,
y
)
:
light
->
height
;
}
}
//
//
// P_QuantizeMomentumToSlope
// P_QuantizeMomentumToSlope
//
//
...
@@ -887,6 +886,8 @@ void P_ReverseQuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope)
...
@@ -887,6 +886,8 @@ void P_ReverseQuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope)
FV3_Rotate
(
momentum
,
&
axis
,
InvAngle
(
slope
->
zangle
)
>>
ANGLETOFINESHIFT
);
FV3_Rotate
(
momentum
,
&
axis
,
InvAngle
(
slope
->
zangle
)
>>
ANGLETOFINESHIFT
);
}
}
// Returns the angle of the slope plane.
// If line is provided, a new calculation is performed as if the slope were on the top or bottom of a solid midtexture.
angle_t
P_GetStandingSlopeZAngle
(
pslope_t
*
slope
,
line_t
*
line
)
angle_t
P_GetStandingSlopeZAngle
(
pslope_t
*
slope
,
line_t
*
line
)
{
{
angle_t
zangle
=
slope
->
zangle
;
angle_t
zangle
=
slope
->
zangle
;
...
@@ -900,28 +901,23 @@ angle_t P_GetStandingSlopeZAngle(pslope_t *slope, line_t *line)
...
@@ -900,28 +901,23 @@ angle_t P_GetStandingSlopeZAngle(pslope_t *slope, line_t *line)
return
zangle
;
return
zangle
;
}
}
// Returns the angle of the projected normal of slope plane.
// If line is provided, this simply returns the line's angle.
angle_t
P_GetStandingSlopeDirection
(
pslope_t
*
slope
,
line_t
*
line
)
angle_t
P_GetStandingSlopeDirection
(
pslope_t
*
slope
,
line_t
*
line
)
{
{
angle_t
xydirection
=
slope
->
xydirection
;
angle_t
xydirection
=
slope
->
xydirection
;
if
(
line
)
if
(
line
)
{
{
xydirection
=
R_PointToAngle2
(
line
->
v1
->
x
,
line
->
v1
->
y
,
line
->
v2
->
x
,
line
->
v2
->
y
)
;
xydirection
=
line
->
angle
;
}
}
return
xydirection
;
return
xydirection
;
}
}
angle_t
P_GetObjectStandingSlopeZAngle
(
mobj_t
*
mo
)
// When given a vector, rotates it and aligns it to either a slope, or a flat surface relative to the slope.
{
// If line is provided, this calculation is performed as if the slope were on the top or bottom of a solid midtexture.
return
P_GetStandingSlopeZAngle
(
mo
->
standingslope
,
mo
->
standingline
);
// See also: P_QuantizeMomentumToSlope
}
angle_t
P_GetObjectStandingSlopeDirection
(
mobj_t
*
mo
)
{
return
P_GetStandingSlopeDirection
(
mo
->
standingslope
,
mo
->
standingline
);
}
static
void
QuantizeMomentumToSlope
(
pslope_t
*
slope
,
line_t
*
line
,
vector3_t
*
momentum
,
boolean
reverse
)
static
void
QuantizeMomentumToSlope
(
pslope_t
*
slope
,
line_t
*
line
,
vector3_t
*
momentum
,
boolean
reverse
)
{
{
if
(
!
slope
||
slope
->
flags
&
SL_NOPHYSICS
)
if
(
!
slope
||
slope
->
flags
&
SL_NOPHYSICS
)
...
@@ -963,6 +959,18 @@ void P_ReverseQuantizeObjectMomentumToSlope(mobj_t *mo, vector3_t *momentum)
...
@@ -963,6 +959,18 @@ void P_ReverseQuantizeObjectMomentumToSlope(mobj_t *mo, vector3_t *momentum)
QuantizeMomentumToSlope
(
mo
->
standingslope
,
mo
->
standingline
,
momentum
,
true
);
QuantizeMomentumToSlope
(
mo
->
standingslope
,
mo
->
standingline
,
momentum
,
true
);
}
}
// Wrapper for P_GetStandingSlopeZAngle.
angle_t
P_GetObjectStandingSlopeZAngle
(
mobj_t
*
mo
)
{
return
P_GetStandingSlopeZAngle
(
mo
->
standingslope
,
mo
->
standingline
);
}
// Wrapper for P_GetObjectStandingSlopeDirection.
angle_t
P_GetObjectStandingSlopeDirection
(
mobj_t
*
mo
)
{
return
P_GetStandingSlopeDirection
(
mo
->
standingslope
,
mo
->
standingline
);
}
//
//
// P_SlopeLaunch
// P_SlopeLaunch
//
//
...
@@ -1042,7 +1050,6 @@ fixed_t P_GetWallTransferMomZ(mobj_t *mo, pslope_t *slope, line_t *line)
...
@@ -1042,7 +1050,6 @@ fixed_t P_GetWallTransferMomZ(mobj_t *mo, pslope_t *slope, line_t *line)
// Function to help handle landing on slopes
// Function to help handle landing on slopes
void
P_HandleSlopeLanding
(
mobj_t
*
thing
,
pslope_t
*
slope
,
line_t
*
line
)
void
P_HandleSlopeLanding
(
mobj_t
*
thing
,
pslope_t
*
slope
,
line_t
*
line
)
{
{
vector3_t
mom
;
// Ditto.
if
(
slope
->
flags
&
SL_NOPHYSICS
||
(
slope
->
normal
.
x
==
0
&&
slope
->
normal
.
y
==
0
))
{
// No physics, no need to make anything complicated.
if
(
slope
->
flags
&
SL_NOPHYSICS
||
(
slope
->
normal
.
x
==
0
&&
slope
->
normal
.
y
==
0
))
{
// No physics, no need to make anything complicated.
if
(
P_MobjFlip
(
thing
)
*
(
thing
->
momz
)
<
0
)
// falling, land on slope
if
(
P_MobjFlip
(
thing
)
*
(
thing
->
momz
)
<
0
)
// falling, land on slope
{
{
...
@@ -1055,6 +1062,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope, line_t *line)
...
@@ -1055,6 +1062,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope, line_t *line)
return
;
return
;
}
}
vector3_t
mom
;
mom
.
x
=
thing
->
momx
;
mom
.
x
=
thing
->
momx
;
mom
.
y
=
thing
->
momy
;
mom
.
y
=
thing
->
momy
;
mom
.
z
=
thing
->
momz
*
2
;
mom
.
z
=
thing
->
momz
*
2
;
...
...
This diff is collapsed.
Click to expand it.
Lactozilla
@Lactozilla
mentioned in commit
6bf58ce8
·
11 months ago
mentioned in commit
6bf58ce8
mentioned in commit 6bf58ce8705111b1c7456edcf269e22e8ed6f1ee
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment