Module util

Module util 

Source

Re-exportsΒ§

pub use plane::Plane;
pub use projection::Projection;
pub use dir::*;

ModulesΒ§

cardinal_directions πŸ”’
color πŸ”’
dir
div
find_dist
grid_hasher πŸ”’
lines
macros πŸ”’
option πŸ”’
plane
projection
ron_recover πŸ”’
spatial_grid πŸ”’
Contains SpatialGrid which is useful for accelerating queries of nearby entities

StructsΒ§

DISPLAY_VERSION
Dir2Iter
An iterator over the variants of Dir2
Dir3Iter
An iterator over the variants of Dir3
GIT_HASH
The first 32 bits of the git hash. We don’t need more, the non-collision guarantee isn’t all that important for our purposes.
GIT_TAG
GIT_TIMESTAMP
GridHasher
SpatialGrid
VELOREN_GIT_VERSION πŸ”’

EnumsΒ§

Dir2
A 2d cardinal direction.
Dir3
A 3d direction.

ConstantsΒ§

VELOREN_GIT_VERSION_BUILD πŸ”’
VELOREN_VERSION_STAGE

FunctionsΒ§

append_date πŸ”’
chromify_srgb
Preserves the luma of one color while changing its chromaticity to match the other
either_with
hsv_to_rgb
Convert hsv to rgb. Expects h [0, 360], s [0, 1], v [0, 1]
linear_to_srgb
linear_to_srgba
make_display_version
rgb_to_hsv
Convert rgb to hsv. Expects rgb to be [0, 1].
rgb_to_xyy
Convert linear rgb to CIExyY
rgb_to_xyz
Convert linear rgb to CIEXYZ
ron_from_path_recoverable
Load settings from ron in a recoverable manner. Requires #[serde(default)].
saturate_srgb
srgb_to_linear
directly converted from β€˜vec3 srgb_to_linear(vec3 srgb)’ function in β€˜srgb.glsl’
srgb_to_linear_fast
This function is optimized for speed over perfect accuracy
srgba_to_linear
xyy_to_rgb
Convert to CIExyY to linear rgb