[][src]Crate amethyst_tiles

2D/3D Tile data structures and functionality.

Re-exports

pub use error::TileOutOfBoundsError;
pub use iters::MortonRegion;
pub use iters::Region;

Modules

error

Renderer error types.

iters

Various helper iterators for efficiently iterating in coordinate encoded spaces in a locality-friendly fashion.

pod

GPU POD data types.

prefab

2D Sprite specific prefabs.

Structs

DrawTiles2D

RenderGroup providing culling, drawing and transparency functionality for 3D TileMap components.

DrawTiles2DBoundsDefault

Default bounds that returns the entire tilemap

DrawTiles2DDesc

Draw opaque tilemap without lighting.

FlatEncoder

The most basic encoder, which strictly flattens the 3d space into 1d coordinates in a linear fashion. This encoder is optimal for storage space, but not for traversal or iteration.

MortonEncoder

3D Morton (Z-Order) encoding implementation. This implementation uses the bmi2 CPU intrinsic if it is available via the bitintr crate. If this instruction set is not available, it falls back on simpler computation methods. Using these CPU instruction optimizations requires RUSTFLAGS=-C target-feature=+bmi2. If this target feature is not provided, a LUT (Look Up Table) implementation of Morton encoding is used, considered extremely fast but still slightly slower than BMI2 intrinsics.

MortonEncoder2D

2D Morton (Z-Order) Layered to 3D encoding implementation. This implementation uses the bmi2 CPU intrinsic if it is available via the bitintr crate. If this instruction set is not available, it falls back on simpler computation methods. Using these CPU instruction optimizations requires RUSTFLAGS=-C target-feature=+bmi2. If this target feature is not provided, a LUT (Look Up Table) implementation of Morton encoding is used, considered extremely fast but still slightly slower than BMI2 intrinsics.

RenderTiles2D

A RenderPlugin for rendering a 2D Tiles entity.

TileMap

Concrete implementation of a generic 3D TileMap component. Accepts a Tile type and CoordinateEncoder type, creating a flat 1D array storage which is spatially partitioned utilizing the provided encoding scheme.

Traits

CoordinateEncoder

Trait to provide generic access to various encoding schemas. All tile storages use this to encode their coordinates and provide different spatial encoding algorithms for efficiency.

DrawTiles2DBounds

Trait to describe how rendering tiles may be culled for the tilemap to render

Map

Trait for providing access to an underlying storage type of a 3-dimensional Tile data. This is abstracted to provide for allowing more underlying storage types in the future beyond a flat array, such as networking, chunking, etc.

MapStorage

Generic trait over the underlying storage of a given Map type.

Tile

Trait providing generic rendering functionality to all tiles. Using a tilemap requires you to provide a Tile type, which must implement this trait to provide the RenderPass with the appropriate sprite and tint values.