MiniDoom

src/p_sight.ml

Tests monster line of sight through reject tables, BSP crossings, and vertical portal slopes.

Package
(global)
Reachable
Yes

Imports

Declarations

_PSI_GetRejectByte

function _PSI_GetRejectByte(idx)

Reads one REJECT lump byte safely, supporting both direct byte storage and wrapped lump data.

ParameterTypeDefaultDescription
idxdynamic—Zero-based element or table index.

View source

_PSI_SectorIndex

function _PSI_SectorIndex(sec)

Resolves a sector object to its map index for REJECT-table visibility lookup.

ParameterTypeDefaultDescription
secdynamic—Sec value supplied to `_PSI_SectorIndex`.

View source

bottomslope

bottomslope

Tracks the mutable bottomslope value used by the p sight subsystem.

View source

P_CheckSight

function P_CheckSight(t1, t2)

Rejects impossible sector pairs early, then traces BSP portals and vertical slopes to decide whether two mobjs see each other.

ParameterTypeDefaultDescription
t1dynamic—T1 value supplied to `P_CheckSight`.
t2dynamic—T2 value supplied to `P_CheckSight`.

View source

P_CrossBSPNode

function P_CrossBSPNode(bspnum)

Traverses the BSP front-to-back along the sight trace, stopping as soon as either child proves occlusion.

ParameterTypeDefaultDescription
bspnumdynamic—Index identifying bsp.

View source

P_CrossSubsector

function P_CrossSubsector(num)

Clips the sight slope window against every blocking seg in a subsector and rejects fully occluded traces.

ParameterTypeDefaultDescription
numdynamic—Index identifying the requested item.

View source

P_DivlineSide

inline function P_DivlineSide(x, y, node)

Classifies a point against a divline, returning two for an exact collinear hit and using scaled products to avoid overflow.

ParameterTypeDefaultDescription
xdynamic—Horizontal map- or screen-space coordinate.
ydynamic—Vertical map- or screen-space coordinate.
nodedynamic—Node value supplied to `P_DivlineSide`.

View source

P_InterceptVector2

inline function P_InterceptVector2(v2, v1)

Computes where the current sight trace intersects a partition line as a fixed-point fraction.

ParameterTypeDefaultDescription
v2dynamic—V2 value supplied to `P_InterceptVector2`.
v1dynamic—V1 value supplied to `P_InterceptVector2`.

View source

sightcounts

sightcounts

Stores the sightcounts collection used by the p sight subsystem.

View source

sightzstart

sightzstart

Tracks the mutable sightzstart value used by the p sight subsystem.

View source

strace

strace

Tracks the mutable strace value used by the p sight subsystem.

View source

t2x

t2x

Tracks the mutable t2x value used by the p sight subsystem.

View source

t2y

t2y

Tracks the mutable t2y value used by the p sight subsystem.

View source

topslope

topslope

Tracks the mutable topslope value used by the p sight subsystem.

View source