WallsBsp

A 2D BSP over wall segments in plan, built once, that lists them front to back from any eye point (BGE.WallsView walks them in that order). A segment crossing another's line is split into parts there; part k covers partStart[k]..partEnd[k] (0..1) of segment partSegment[k], from (partAx, partAz) to (partBx, partBz).

Properties

  • partSegment (Array.<integer>)
  • partStart (Array.<float>)
  • partEnd (Array.<float>)
  • partAx (Array.<float>)
  • partAz (Array.<float>)
  • partBx (Array.<float>)
  • partBz (Array.<float>)
  • root (integer) — Root node, or -1 with no segments
  • nodeX (Array.<float>) — Per node: a point on its line and the line's normal, its front (the normal's side) and
  • nodeZ (Array.<float>)
  • nodeNx (Array.<float>)
  • nodeNz (Array.<float>)
  • nodeFront (Array.<integer>)
  • nodeBack (Array.<integer>)
  • nodeFirst (Array.<integer>)
  • nodeCount (Array.<integer>)
  • nodeParts (Array.<integer>)
  • nodeMinX (Array.<float>) — Per node: the plan bounds of its parts and everything under it
  • nodeMinZ (Array.<float>)
  • nodeMaxX (Array.<float>)
  • nodeMaxZ (Array.<float>)
  • segmentCount (integer) — How many segments it was built from

Constructor

new WallsBsp(segments: Array.<BGE.WallSegment>): WallsBsp

Parameters


Instance Methods

collect(ox: float, oz: float, order: Array.<integer>): void

Appends every part index to order, nearest the eye first. Parts on lines through the eye come out edge on, in any order.

Parameters

  • ox (float)
  • oz (float)
  • order (Array.<integer>)

Returns

  • void

collectInView( ox: float, oz: float, lfx: float, lfz: float, rx: float, rz: float, near: float, far: float, minTan: float, maxTan: float, order: Array.<integer>, ): void

As collect(), but skips subtrees whose bounds lie wholly nearer than near or at or past far (forward depth along the level forward lfx, lfz), or wholly outside the tangents minTan..maxTan (sideways along rx, rz over forward depth).

Parameters

  • ox (float)
  • oz (float)
  • lfx (float)
  • lfz (float)
  • rx (float)
  • rz (float)
  • near (float)
  • far (float)
  • minTan (float)
  • maxTan (float)
  • order (Array.<integer>)

Returns

  • void