EPOK RUNTIME
namespace epok::world2d
23 types, 41 functions and 42 data symbols.
Declarations are extracted from the pinned headers. Examples and general guidance are generated sketches, not verified complete programs; consult the linked source and guides for the actual contract.
Types
CanvasThe canvas a drawable belongs to, resolved through its owner's attachment chain.StructDepthTable---- renderer -------------------------------------------------------------------------- The 3D world's ordering table, which Depth2D entries join.Type aliasDrawItemStable LSD radix sort of draw items by phase, then canvas layer, then their 32-bit key.StructDrawKind---- draw list ----------------------------------------------------------------------------EnumDrawPhaseWhere a draw item goes relative to the 3D world: under_3d canvases before it, Depth2D drawables into its ordering table, everything else over it.EnumHooksInstalled by world2d_service.hpp when the build has 2D content; null otherwise, and every query that needs them reports nothing.StructLinkIntrusive list link.Class templateListClass template declared by the world2d-components module for the world2d components module.Class templateNavGrid2DStruct declared by the world2d-navigation module for the world2d navigation module.StructNavMesh2DStruct declared by the world2d-navigation module for the world2d navigation module.StructNavScratchGrid search scratch, owned by the service.StructPagedRectangleA rectangle and the drawing page it samples, as one packet.Class templateProjectorCamera projection with the rotation resolved once per frame (world2d.hpp's world_to_screen recomputes the sine and cosine at every call).StructRendererClass declared by the world2d-render module for the world2d render module.ClassRenderPassWhat the view being collected draws.StructServiceClass declared by the world2d-service module for the world2d service module.ClassShapeQuadOne quad of a Line2D (corners as in SpriteDraw) with a colour per corner.StructShapeTriangleOne triangle of a Polygon2D, with texels when the polygon is textured.StructSpriteDrawOne entry of the frame's draw list: a sprite resolved to screen corners (A top-left, B top-right, C bottom-left, D bottom-right in the sprite's own frame), its texel rectangle, colour and blend; or a whole tile layer, line, polygon or particle emitter, expanded by the renderer (`each_tile`, `each_line_quad`, `each_polygon_triangle`, `each_particle`).StructStatsStruct declared by the world2d-service module for the world2d service module.StructTileDrawOne tile resolved for drawing (corners as in SpriteDraw).StructTileHooksInstalled by the service: runtime cell edits live there, so a build without 2D content carries no edit table.StructTintsThe CanvasModulate2D tint of each canvas, resolved once per frame.StructFunctions
active_splitThe active split screen, when both its cameras exist.Functionactor_rootThe root transform of an actor, or null.Functionangle_degreesAngle of a vector in Q12 degrees, from +X towards +Y (clockwise on screen), in (-180, 180].Functioncamera_onPerforms `camera on` as part of the world2d viewports module.Functioncanvas_ofWalks from `component`'s owner up its attachments.Functioncollect_spritesPerforms `collect sprites` as part of the world2d service module.Function templatedepth_bucketThe bucket of camera-space depth `z` (Q12), moved by `bias` buckets and clamped to the table: the bucket a 3D triangle averaging that depth falls in.Functiondepth_bucket_ofThe ordering-table bucket of a Depth2D: the bucket of its distance, or of its anchor's view depth when `anchor_depth(entity, z)` resolves one (Q12; false: no 3D position), moved by its bias.Function templatedepth_ofThe nearest enabled, active Depth2D on `component`'s owner or up its attachments.Functioneach_line_quadThe quads of a Line2D entry, one per segment, extended by half the width at inner joints so corners close.Function templateeach_particleThe particles of an emitter entry as sprites (texel rectangle, colour, corners).Function templateeach_polygon_triangleThe triangles of a Polygon2D entry.Function templateeach_tileEvery visible tile of a tile-layer entry, in row order.Function templateentry_spaceThe projection an expanded entry draws through, and its owner's world matrix.FunctionfindThe first component of type T on `actor`, or null.Function templatefloor_cellsFloor division of a Q12 distance by a whole number of pixels.Functionfloor_div64Performs `floor div64` as part of the world2d service module.Functiongrid_line_of_sightWhether the straight line between two cell centres crosses only walkable cells and squeezes past no blocked corner.Functiongrid_pathWaypoints from `from` to `to` on a grid (the start excluded), at most `capacity`.FunctioninstallPerforms `install` as part of the world2d service module.Functionisqrt64Integer square root of a non-negative 64-bit value.Functionlength_2dLength of a Q12 vector, in Q12.Functionmesh_pathWaypoints from `from` to `to` on a navmesh (the start excluded), at most `capacity`.FunctionmixPerforms `mix` as part of the world2d service module.Functionphase_rangeThe sorted entries of one phase: items [first, last).Functionrepeat_copiesScreen copies of a drawable under a repeating Parallax2D: calls `visit(dx, dy)` for every shift (in screen pixels) whose copy of `bounds` (min x, min y, max x, max y) is on screen.Function templateresolve_scene2dPerforms `resolve scene2d` as part of the world2d components module.Functionroot_ofThe root SceneComponent2D of a component's owner, or null.Functionroot_worldPerforms `root world` as part of the world2d skeleton module.Functionscreen_pixelPerforms `screen pixel` as part of the world2d service module.Functionset_world_positionMoves the owner's root so its world position becomes `world`, through the inverse of the parent chain's linear part when the root is attached.Functionsolid_collider_ofPerforms `solid collider of` as part of the world2d components module.Functionsort_draw_itemsPerforms `sort draw items` as part of the world2d service module.Functionstep_secondsPerforms `step seconds` as part of the world2d components module.Functionsubviewport_onPerforms `subviewport on` as part of the world2d viewports module.Functiontile_boxWorld box of one tile's collision shape, honouring the cell's flip and transpose flags.FunctiontintPerforms `tint` as part of the world2d service module.Functionview_cameraResolves every visible sprite and tile layer through the active camera (or the screen, for a screen canvas) into `draws`, and writes the back-to-front order into `items` (`scratch` is sort workspace).Functionworld_ofWorld matrix of the owner's root, following SceneComponent2D attachments.Functionwrap_degrees_rawAn angle in raw Q12 degrees brought into (-180, 180].Functionz_keyPerforms `z key` as part of the world2d service module.FunctionVariables and constants
audio_playersExposes `audio_players` on the `epok::world2d` namespace for the world2d content module.VariablebodiesExposes `bodies` on the `epok::world2d` namespace for the world2d components module.VariablecamerasExposes `cameras` on the `epok::world2d` namespace for the world2d components module.Variablecanvas_layersExposes `canvas_layers` on the `epok::world2d` namespace for the world2d tiles module.Variablecanvas_modulatesExposes `canvas_modulates` on the `epok::world2d` namespace for the world2d tiles module.VariablecollidersExposes `colliders` on the `epok::world2d` namespace for the world2d components module.Variabledegrees_turn_rawExposes `degrees_turn_raw` on the `epok::world2d` namespace for the world2d skeleton module.Variabledepth_bucketsThe 3D world's ordering table: buckets of a quarter world unit of camera depth, from the camera to 128 units (runtime/main.cpp asserts that its table matches).VariabledepthsExposes `depths` on the `epok::world2d` namespace for the world2d tiles module.VariableemittersExposes `emitters` on the `epok::world2d` namespace for the world2d content module.Variableevery_layerExposes `every_layer` on the `epok::world2d` namespace for the world2d viewports module.VariablefollowersExposes `followers` on the `epok::world2d` namespace for the world2d content module.VariablehooksExposes `hooks` on the `epok::world2d` namespace for the world2d module.VariablejointsExposes `joints` on the `epok::world2d` namespace for the world2d physics module.VariablelinesExposes `lines` on the `epok::world2d` namespace for the world2d content module.Variablenav_agentsExposes `nav_agents` on the `epok::world2d` namespace for the world2d navigation module.Variablenav_path_limitExposes `nav_path_limit` on the `epok::world2d` namespace for the world2d navigation module.Variablenav_regionsExposes `nav_regions` on the `epok::world2d` namespace for the world2d navigation module.Variablenav_scratchExposes `nav_scratch` on the `epok::world2d` namespace for the world2d navigation module.Variablenav_triangle_limitExposes `nav_triangle_limit` on the `epok::world2d` namespace for the world2d navigation module.VariablenotifiersExposes `notifiers` on the `epok::world2d` namespace for the world2d content module.VariableparallaxesExposes `parallaxes` on the `epok::world2d` namespace for the world2d tiles module.VariablepathsExposes `paths` on the `epok::world2d` namespace for the world2d content module.VariablepolygonsExposes `polygons` on the `epok::world2d` namespace for the world2d content module.Variablerelease_particlesParticles live in the service's pool; an emitter releases its own when it goes away.VariableremotesExposes `remotes` on the `epok::world2d` namespace for the world2d content module.Variablerender_passExposes `render_pass` on the `epok::world2d` namespace for the world2d viewports module.VariablerendererExposes `renderer` on the `epok::world2d` namespace for the world2d render module.Variablerigid_bodiesExposes `rigid_bodies` on the `epok::world2d` namespace for the world2d physics module.VariableserviceExposes `service` on the `epok::world2d` namespace for the world2d service module.Variableskeleton2d_bone_limitExposes `skeleton2d_bone_limit` on the `epok::world2d` namespace for the world2d skeleton module.Variableskeleton2d_ik_limitExposes `skeleton2d_ik_limit` on the `epok::world2d` namespace for the world2d skeleton module.VariableskeletonsExposes `skeletons` on the `epok::world2d` namespace for the world2d skeleton module.Variablesplit_screensExposes `split_screens` on the `epok::world2d` namespace for the world2d viewports module.VariablespritesExposes `sprites` on the `epok::world2d` namespace for the world2d components module.VariablestatsExposes `stats` on the `epok::world2d` namespace for the world2d service module.VariablesubviewportsExposes `subviewports` on the `epok::world2d` namespace for the world2d viewports module.Variabletile_cell_atThe tile map cell behind a collision index, installed by the service when tile maps collide: false when `index` is an ordinary collider.Variabletile_clockSeconds of animation time shared by every animated tile, advanced by the service.Variabletile_hooksExposes `tile_hooks` on the `epok::world2d` namespace for the world2d tiles module.Variabletile_layer_serialExposes `tile_layer_serial` on the `epok::world2d` namespace for the world2d tiles module.Variabletile_layersExposes `tile_layers` on the `epok::world2d` namespace for the world2d tiles module.Variable