Crate pixel_map

Source
Expand description

§PixelMap

A PixelMap is a 2D grid of pixels, implemented by an MX variant of a quadtree. Tree nodes subdivide down to a supplied pixel size. Quadtree depth is not artificially limited as with other quadtree implementations, but is defined by the division “distance” between the root node region and the pixel size. A type-generic value is stored for each pixel, but storage is optimized for regions of pixels having the same value (as per the function of a quadtree).

Re-exports§

pub use bevy_math;

Modules§

pathfinding

Structs§

AngleLineIterator
AxisLineIterator
ICircle
A circle represented by a center point, in integer coordinates, and a radius.
ICirclePixelIterator
ILine
A line segment represented by two points, in integer coordinates.
IsoLine
A contiguous series of points forming a line segment. The line segment is closed when the first and last point are equal.
LineInterval
LineStripPixelIterator
An iterator that yields all pixel coordinates in a line strip. A given coordinate in the line strip will only be yielded once, assuming line segments are unique, regardless of the line strip being open or closed, or whether the line segments are contiguous or not.
NodePath
A path to a node in the pixel map.
PNode
A node of a crate::PixelMap quadtree.
PixelMap
A two-dimensional map of pixels implemented by an MX quadtree. The coordinate origin is at the bottom left.
RayCastQuery
RayCastResult
Region
A square region defined by a bottom-left point and a size, in integer units.
RotatedIRect
A rectangle that is rotated around the center pivot point.
Stats
Stores statistics about a PixelMap. See PixelMap::stats.
URectPixelIterator
Iterate all pixel coordinates in a URect.
UnsignedPixelIterator
Decorate an IVec2 iterator to only yield positive points, and to covert them to UVec2.

Enums§

CellFill
A [PixelMap] quadtree node fill pattern, regarding child node storage.
Direction
A direction in the 2D plane.
LinePixelIterator
LineRelation
NeighborOrientation
Describes the orientation of a pair of neighboring nodes.
Quadrant
A quadrant in a box.
RayCast

Constants§

EAST
NORTH
NORTH_EAST
NORTH_WEST
SOUTH
SOUTH_EAST
SOUTH_WEST
WEST

Functions§

distance_squared_to_line
distance_squared_to_upoint
Find the distance squared between two points.
distance_to_line
distance_to_upoint
Find the distance between two points.
exclusive_irect
Subtract one from the maximum point of the given rect, allowing for exclusive handling with contains, for example.
exclusive_urect
Subtract one from the maximum point of the given rect, allowing for exclusive handling with contains, for example.
iline
An alias for ILine::new.
irect_edges
Get the four lines that make up the edges of this rectangle.
irect_points
Get the four points that make up the corners of the given rect.
plot_line
rect_points
Get the four points that make up the corners of the given rect.
to_cropped_urect
Convert the given IRect into a URect, without wrapping negative values, effectively cropping the rectangle to the positive quadrant.
urect_points
Get the four points that make up the corners of the given rect.

Type Aliases§

Children