Skip to main content

Crate cvmath

Crate cvmath 

Source
Expand description

Graphics-oriented math types for vectors, transforms, and ray tracing queries.

If you are looking for a specific part of the API:

Most implementations are generic over scalar types (integers and floats) and floating-point types.

Macros§

Bounds2
Bounds2 constructor.
Bounds3
Bounds3 constructor.
Point2
Point2 constructor.
Point3
Point3 constructor.
Rect
Rect constructor.
Vec2
Vector constructor.
Vec3
Vector constructor.
Vec4
Vector constructor.
deg
Angle constructor from degrees.

Structs§

Angle
Angle in radians.
Bounds2
Bounds2 shape.
Bounds3
Bounds3 shape.
Bvh2
2D bounding volume hierarchy.
Bvh3
3D bounding volume hierarchy.
Capsule2
Capsule2 shape.
Capsule3
Capsule3 shape.
Circle
Circle shape.
Complex
Complex number.
Hit2
Hit2 structure.
Hit3
Hit3 structure.
Interval
Interval type.
Line2
Line2 shape.
Line3
Line3 shape.
Mat2
2D transformation matrix.
Mat3
3D transformation matrix.
Mat4
4D transformation matrix.
Plane2
Plane2 shape.
Plane3
Plane3 shape.
Polar
Polar coordinates.
Quat
Quaternion number.
Ray2
Ray2 structure.
Ray3
Ray3 structure.
Rect
Rect shape.
RotationVector
Rotation vector.
Sphere
Sphere shape.
Transform2
2D affine transformation matrix.
Transform3
3D affine transformation matrix.
Triangle2
Triangle2 shape.
Triangle3
Triangle3 shape.
Vec2
Vec2 vector.
Vec3
Vec3 vector.
Vec4
Vec4 vector.
W
W component.
X
X component.
Y
Y component.
Z
Z component.

Enums§

Clip
Clip range.
Hand
Handedness of the coordinate system.
HitSide
Ray hit side.
ParseMatrixError
An error which can be returned when parsing a matrix type.
ParseVecError
An error which can be returned when parsing a VecN<T>.
Shape2
Heterogeneous Shape2.
Shape3
Heterogeneous Shape3.

Traits§

Cross
Types which can be cross producted.
Distance
Types which can measure distance to another value.
Dot
Types which can be dot producted.
Lerp
Types which can be linearly interpolated.
Trace2
Shapes that support Ray2 intersection tests.
Trace3
Shapes that support Ray3 intersection tests.

Functions§

Angle
Angle constructor.
Bool2
Bool2 constructor.
Bool3
Bool3 constructor.
Bool4
Bool4 constructor.
Bounds2
Bounds2 constructor.
Bounds3
Bounds3 constructor.
Bounds2d
Bounds2d constructor.
Bounds2f
Bounds2f constructor.
Bounds2i
Bounds2i constructor.
Bounds3d
Bounds3d constructor.
Bounds3f
Bounds3f constructor.
Bounds3i
Bounds3i constructor.
Capsule2
Capsule2 constructor.
Capsule3
Capsule3 constructor.
Circle
Circle constructor.
Complex
Complex constructor.
Interval
Interval constructor.
Line2
Line2 constructor.
Line3
Line3 constructor.
Line2d
Line2d constructor.
Line2f
Line2f constructor.
Line2i
Line2i constructor.
Mat2
Mat2 constructor.
Mat3
Mat3 constructor.
Mat4
Mat4 constructor.
Plane2
Plane2 constructor.
Plane3
Plane3 constructor.
Point2
Point2 constructor.
Point3
Point3 constructor.
Point2d
Point2d constructor.
Point2f
Point2f constructor.
Point2i
Point2i constructor.
Point3d
Point3d constructor.
Point3f
Point3f constructor.
Point3i
Point3i constructor.
Polar
Polar constructor.
Quat
Quaternion constructor.
Ray2
Ray2 constructor.
Ray3
Ray constructor.
Rect
Rect constructor.
Rectd
Rectd constructor.
Rectf
Rectf constructor.
Recti
Recti constructor.
RotationVector
Rotation vector constructor.
Sphere
Sphere constructor.
Transform2
Transform2 constructor.
Transform3
Transform3 constructor.
Triangle2
Triangle2 constructor.
Triangle3
Triangle3 constructor.
Vec2
Vec2 constructor.
Vec3
Vec3 constructor.
Vec4
Vec4 constructor.
cross
Computes the cross product of a and b.
deg
Angle constructor from degrees.
distance
Computes the distance between a and b.
dot
Computes the dot product of a and b.
lerp
Linear interpolation between a and b by t.
smootherstep
Quintic smoother step between edges.
smoothstep
Cubic smooth step between edges.
step
Step function (Heaviside-like).

Type Aliases§

Bool2
Bool2 mask.
Bool3
Bool3 mask.
Bool4
Bool4 mask.
Bounds2d
Bounds2 with f64 components.
Bounds2f
Bounds2 with f32 components.
Bounds2i
Bounds2 with i32 components.
Bounds3d
Bounds3 with f64 components.
Bounds3f
Bounds3 with f32 components.
Bounds3i
Bounds3 with i32 components.
Line2d
Line2 with f64 components.
Line2f
Line2 with f32 components.
Line2i
Line2 with i32 components.
Point2
Point2 shape.
Point3
Point3 shape.
Point2d
Point2 with f64 components.
Point2f
Point2 with f32 components.
Point2i
Point2 with i32 components.
Point3d
Point3 with f64 components.
Point3f
Point3 with f32 components.
Point3i
Point3 with i32 components.
Rectd
Rect with f64 components.
Rectf
Rect with f32 components.
Recti
Rect with i32 components.