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§
Structs§
- Angle
Line Iterator - Axis
Line Iterator - ICircle
- A circle represented by a center point, in integer coordinates, and a radius.
- ICircle
Pixel Iterator - 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.
- Line
Interval - Line
Strip Pixel Iterator - 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.
- Node
Path - A path to a node in the pixel map.
- PNode
- A node of a crate::PixelMap quadtree.
- Pixel
Map - A two-dimensional map of pixels implemented by an MX quadtree. The coordinate origin is at the bottom left.
- RayCast
Query - RayCast
Result - Region
- A square region defined by a bottom-left point and a size, in integer units.
- RotatedI
Rect - A rectangle that is rotated around the center pivot point.
- Stats
- Stores statistics about a PixelMap. See PixelMap::stats.
- URect
Pixel Iterator - Iterate all pixel coordinates in a URect.
- Unsigned
Pixel Iterator - Decorate an
IVec2
iterator to only yield positive points, and to covert them toUVec2
.
Enums§
- Cell
Fill - A [PixelMap] quadtree node fill pattern, regarding child node storage.
- Direction
- A direction in the 2D plane.
- Line
Pixel Iterator - Line
Relation - Neighbor
Orientation - Describes the orientation of a pair of neighboring nodes.
- Quadrant
- A quadrant in a box.
- RayCast
Constants§
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 withcontains
, for example. - exclusive_
urect - Subtract one from the maximum point of the given
rect
, allowing for exclusive handling withcontains
, 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 aURect
, 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
.