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 useAffine3Storage
as a intermediary. - Affine3A
- A 3D affine transform, which can represent translation, rotation, scaling and shear.
- Affine3
Storage - A type which has the same representation on the CPU and GPU for the underlying
storage of an
Affine3
. - Bounding
Box - A 3-dimensional axis-aligned bounding box
- Color
Rgba8 - 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.
- Dual
Quat - 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.
- Dual
Scalar - 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§
- Euler
Rot - Euler rotation sequences.
- UNorm
Error
Traits§
- Coordinate
System - Coordinate system extension to
Vec3
- Float
Ext - Extensions to floating-point primitives.
- Mat3Ext
- QuatExt
- Extensions to
Quat
- Vec2Ext
- Extensions to
Vec2
- Vec2
Swizzles - Vec3Ext
- Extensions to
Vec3
- Vec3
Swizzles - Vec4Ext
- Extensions to
Vec4
- Vec4
Swizzles
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
andw
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
andtarget
.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
andw
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.