Sign in
EN
games/doom-jumphp / src / Engine / Map / Seg.php · commit 8e1cb9f
<?phpnamespace App\Engine\Map;/** A piece of a line side made by the BSP builder (seg_t). */final class Seg{    public float $angle;    public ?Sector $backSector;    public Sector $frontSector;    public Side $sidedef;    public function __construct(        public float $x1, public float $y1, public float $x2, public float $y2,        public Line $line, public int $side, public float $offset,    ) {        $this->angle = atan2($y2 - $y1, $x2 - $x1);        $this->sidedef = $side === 0 ? $line->front : $line->back;        $this->frontSector = $this->sidedef->sector;        $this->backSector = $side === 0 ? $line->backSector : $line->frontSector;    }}