Crate macaw

Source
Expand description

A friendly opinionated game math library built on top the excellent lower-level glam.

Modules§

prelude
Prelude module with extension traits

Structs§

Affine3
The same as Affine3A except using the non-aligned versions of the underlying types. Useful when doing interop with the GPU. Note that this unfortunately has a different repr calculated on the CPU and GPU, so you still need to use Affine3Storage as a intermediary.
Affine3A
A 3D affine transform, which can represent translation, rotation, scaling and shear.
Affine3Storage
A type which has the same representation on the CPU and GPU for the underlying storage of an Affine3.
BoundingBox
A 3-dimensional axis-aligned bounding box
ColorRgba8
A compressed sRGBA color, 8-bit per component, 32-bit total.
Conformal3
Represents a transform with translation + rotation + uniform scale. Preserves local angles. Scale and rotation will be applied first, then translation.
DAffine2
A 2D affine transform, which can represent translation, rotation, scaling and shear.
DAffine3
A 3D affine transform, which can represent translation, rotation, scaling and shear.
DMat2
A 2x2 column major matrix.
DMat3
A 3x3 column major matrix.
DMat4
A 4x4 column major matrix.
DQuat
A quaternion representing an orientation.
DVec2
A 2-dimensional vector.
DVec3
A 3-dimensional vector.
DVec4
A 4-dimensional vector.
DualQuat
Represents a rigid body transformation which can be thought of as a “screw” motion which is the combination of a translation along a vector and a rotation around that vector.
DualScalar
A dual scalar, with a real and dual part
IVec2
A 2-dimensional vector.
IVec3
A 3-dimensional vector.
IVec4
A 4-dimensional vector.
IsoTransform
An isometric transform represented by translation * rotation.
Mat2
A 2x2 column major matrix.
Mat3
A 3x3 column major matrix.
Mat4
A 4x4 column major matrix.
Mat3A
A 3x3 column major matrix.
MeshGen
Raw mesh generator. Only generates positions, normals and an index buffer.
Plane3
A 3-dimensional plane primitive.
Quat
A quaternion representing an orientation.
Ray3
A ray in 3-dimensional space: a line through space with a starting point and a direction.
UNorm8
An 8-bit fixed point value in the range [0.0..=1.0] (inclusive).
UNorm16
A 16-bit fixed point value in the range [0.0..=1.0] (inclusive).
UVec2
A 2-dimensional vector.
UVec3
A 3-dimensional vector.
UVec4
A 4-dimensional vector.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.
Vec4
A 4-dimensional vector.
Vec3A
A 3-dimensional vector.

Enums§

EulerRot
Euler rotation sequences.
UNormError

Traits§

CoordinateSystem
Coordinate system extension to Vec3
FloatExt
Extensions to floating-point primitives.
Mat3Ext
QuatExt
Extensions to Quat
Vec2Ext
Extensions to Vec2
Vec2Swizzles
Vec3Ext
Extensions to Vec3
Vec3Swizzles
Vec4Ext
Extensions to Vec4
Vec4Swizzles

Functions§

dmat2
Creates a 2x2 matrix from two column vectors.
dmat3
Creates a 3x3 matrix from three column vectors.
dmat4
Creates a 4x4 matrix from four column vectors.
dquat
Creates a quaternion from x, y, z and w values.
dvec2
Creates a 2-dimensional vector.
dvec3
Creates a 3-dimensional vector.
dvec4
Creates a 4-dimensional vector.
exp2_fast
Fast approximation of exponentiating 2 to a floating point power.
exp_decay
Aka “lerp smoothing”. Meant to be called per-frame, to interpolate between curr and target. decay_rate controls the speed of interpolation, with a usable range of around 1.0 and 25.0, from slow to fast. dt is the current frame time.
exp_fast
Fast approximation of e^x
ivec2
Creates a 2-dimensional vector.
ivec3
Creates a 3-dimensional vector.
lerp
Linear interpolation between a range
ln_fast
Fast approximation of natural logarithm.
log2_fast
Fast approximation of base 2 logarithm.
mat2
Creates a 2x2 matrix from two column vectors.
mat3
Creates a 3x3 matrix from three column vectors.
mat4
Creates a 4x4 matrix from four column vectors.
mat3a
Creates a 3x3 matrix from three column vectors.
powf_fast
Raises a number to a floating point power.
quat
Creates a quaternion from x, y, z and w values.
remap
Remap a value from one range to another, e.g. do a linear transform.
remap_clamp
Remap a value from one range to another, clamps the input value to be in the from range first.
uvec2
Creates a 2-dimensional vector.
uvec3
Creates a 3-dimensional vector.
uvec4
Creates a 4-dimensional vector.
vec2
Creates a 2-dimensional vector.
vec3
Creates a 3-dimensional vector.
vec4
Creates a 4-dimensional vector.
vec3a
Creates a 3-dimensional vector.