One face of a BSP world: a convex polygon on a plane, painted with a texture and lit by a lightmap.
plane— the plane index;back?true when the face looks along the plane's backpoints— the corners, in ordertexture— the texture indexs,t—{axis, offset}: a point's place on the texture isVec.dot(point, axis) + offsetacross and downmins,extents—{s, t}: where the lightmap starts on the texture and how far it reaches, multiples ofluxellightmap— the byte offset of the face's samples in the world's lightmaps, ornilfor an unlit facestyles— up to four light style numbers, one lightmap of(div(s_extent, luxel) + 1) * (div(t_extent, luxel) + 1)samples each, in orderluxel— how many texture pixels one lightmap sample covers, 16 by default
Summary
Functions
The middle of the face's corners.
The lightmap's size in samples, {across, down}.
The face with mins and extents worked out from its points: the smallest and largest
texture place, out to whole luxels.
Where a point lies on the face's texture, {s, t}.
Types
@type t() :: %Cauldron3D.Bsp.Face{ back?: boolean(), extents: {non_neg_integer(), non_neg_integer()}, lightmap: non_neg_integer() | nil, luxel: pos_integer(), mins: {integer(), integer()}, plane: non_neg_integer(), points: [Cauldron3D.Vec.t()], s: {Cauldron3D.Vec.t(), float()}, styles: [non_neg_integer()], t: {Cauldron3D.Vec.t(), float()}, texture: non_neg_integer() }
Functions
@spec centre(t()) :: Cauldron3D.Vec.t()
The middle of the face's corners.
@spec lightmap_size(t()) :: {pos_integer(), pos_integer()}
The lightmap's size in samples, {across, down}.
The face with mins and extents worked out from its points: the smallest and largest
texture place, out to whole luxels.
@spec st(t(), Cauldron3D.Vec.t()) :: {float(), float()}
Where a point lies on the face's texture, {s, t}.