ElixirDoom.Gpu.Weapon (elixir_doom v0.2.0)

Copy Markdown View Source

The weapon of a partly invisible player for the graphics card: its shimmering pictures (ElixirDoom.Render.Weapon.sprites/4) as flat pictures held just in front of the camera, filling the same rectangles of the view as Doom draws them, drawn with ElixirDoom.Gpu.Shimmer. The weapon's other pictures are in the overlay.

{changes, live, mesh} = ElixirDoom.Gpu.Weapon.changes(view, live, target, mesh, camera, look)

look is %{id:, window: {width, height}, fixed:}: the instance id, the view's size in pixels and the fixed light table or nil. The camera's fov_y must show the view's width across a quarter turn.

Summary

Functions

The changes that draw the shimmering weapon, with the live map and the mesh handle to keep.

Types

look()

@type look() :: %{
  id: pos_integer(),
  window: {pos_integer(), pos_integer()},
  fixed: non_neg_integer() | nil
}

Functions

changes(view, live, target, mesh, camera, look)

The changes that draw the shimmering weapon, with the live map and the mesh handle to keep.