bevy::math

Module prelude

source
Expand description

The math prelude.

This includes the most common types in this crate, re-exported for your convenience.

Structs§

  • A primitive shape formed by the region between two circles, also known as a ring.
  • A primitive representing an arc between two points on a circle.
  • A 2-dimensional bool vector mask.
  • A 3-dimensional bool vector mask.
  • A 4-dimensional bool vector mask.
  • A polygon with a variable number of vertices, allocated on the heap in a Box<[Vec2]>.
  • A series of connected line segments in 2D space, allocated on the heap in a Box<[Vec2]>.
  • A series of connected line segments in 3D space, allocated on the heap in a Box<[Vec3]>.
  • A 2D capsule primitive, also known as a stadium or pill shape.
  • A 3D capsule primitive centered on the origin A three-dimensional capsule is defined as a surface at a distance (radius) from a line
  • The curve that results from chaining one curve with another. The second curve is effectively reparametrized so that its start is at the end of the first.
  • A circle primitive, representing the set of points some distance from the origin
  • A primitive representing a circular sector: a pie slice of a circle.
  • A primitive representing a circular segment: the area enclosed by the arc of a circle and its chord (the line between its endpoints).
  • A cone primitive centered on the midpoint between the tip of the cone and the center of its base.
  • A conical frustum primitive. A conical frustum can be created by slicing off a section of a cone.
  • A curve with a constant value over its domain.
  • The curve that results from chaining two curves.
  • A convex polygon with N vertices.
  • A spline interpolated continuously across the nearest four control points. The curve does not necessarily pass through any of the control points.
  • A spline composed of a single cubic Bezier curve.
  • A spline interpolated continuously across the nearest four control points, with the position of the curve specified at every control point and the tangents computed automatically. The associated CubicCurve has one segment between each pair of adjacent control points.
  • A collection of CubicSegments chained into a single parametric curve. It is a Curve with domain [0, N], where N is its number of segments.
  • A spline interpolated continuously between the nearest two control points, with the position and velocity of the curve specified at both control points. This curve passes through all control points, with the specified velocity which includes direction and parametric speed.
  • Non-uniform Rational B-Splines (NURBS) are a powerful generalization of the CubicBSpline which can represent a much more diverse class of curves (like perfect circles and ellipses).
  • A segment of a cubic curve, used to hold precomputed coefficients for fast interpolation. It is a Curve with domain [0, 1].
  • A cuboid primitive, which is like a cube, except that the x, y, and z dimensions are not required to be the same.
  • A curve that has been reparametrized by another curve, using that curve to transform the sample times before sampling. Curves of this type are produced by Curve::reparametrize_by_curve.
  • A cylinder primitive centered on the origin
  • A normalized vector pointing in a direction in 2D space
  • A normalized vector pointing in a direction in 3D space
  • A normalized SIMD vector pointing in a direction in 3D space.
  • A Curve that is defined by
  • An ellipse primitive, which is like a circle, but the width and height can be different
  • A 3D shape representing an extruded 2D base_shape.
  • The curve that results from repeating a curve forever.
  • A curve defined by a function together with a fixed domain.
  • A curve that is the graph of another curve over its parameter space. Curves of this type are produced by Curve::graph.
  • A rectangle defined by two opposite corners.
  • A 2-dimensional vector.
  • A 3-dimensional vector.
  • A 4-dimensional vector.
  • An unbounded plane in 3D space. It forms a separating surface through the origin, stretching infinitely far
  • A nonempty closed interval, possibly unbounded in either direction.
  • An isometry in two dimensions, representing a rotation followed by a translation. This can often be useful for expressing relative positions and transformations from one position to another.
  • An isometry in three dimensions, representing a rotation followed by a translation. This can often be useful for expressing relative positions and transformations from one position to another.
  • An infinite line going through the origin along a direction in 2D space.
  • An infinite line going through the origin along a direction in 3D space.
  • A curve that has had its domain changed by a linear reparametrization (stretching and scaling). Curves of this type are produced by Curve::reparametrize_linear.
  • A curve whose samples are defined by mapping samples from another curve through a given function. Curves of this type are produced by Curve::map.
  • A 2x2 column major matrix.
  • A 3x3 column major matrix.
  • A 4x4 column major matrix.
  • The curve that results from chaining a curve with its reversed version. The transition point is guaranteed to make no jump.
  • An unbounded plane in 2D space. It forms a separating surface through the origin, stretching infinitely far
  • A bounded plane in 3D space. It forms a surface starting from the origin with a defined height and width.
  • A polygon with N vertices.
  • A series of connected line segments in 2D space.
  • A series of connected line segments in 3D space.
  • A quaternion representing an orientation.
  • A collection of RationalSegments chained into a single parametric curve. It is a Curve with domain [0, N], where N is the number of segments.
  • A segment of a rational cubic curve, used to hold precomputed coefficients for fast interpolation. It is a Curve with domain [0, 1].
  • An infinite half-line starting at origin and going in direction in 2D space.
  • An infinite half-line starting at origin and going in direction in 3D space.
  • A rectangle defined by two opposite corners.
  • A rectangle primitive, which is like a square, except that the width and height can be different
  • A polygon centered on the origin where all vertices lie on a circle, equally far apart.
  • A curve whose sample space is mapped onto that of some base curve’s before sampling. Curves of this type are produced by Curve::reparametrize.
  • The curve that results from repeating a curve N times.
  • The curve that results from reversing another.
  • A rhombus primitive, also known as a diamond shape. A four sided polygon, centered on the origin, where opposite sides are parallel but without requiring right angles.
  • A counterclockwise 2D rotation.
  • A curve that is defined by neighbor interpolation over a set of evenly-spaced samples, interpolated automatically using a particularly well-behaved interpolation.
  • A curve that is defined by explicit neighbor interpolation over a set of evenly-spaced samples.
  • A segment of a line going through the origin along a direction in 2D space.
  • A segment of a line going through the origin along a direction in 3D space.
  • A sphere primitive, representing the set of all points some distance from the origin
  • A tetrahedron primitive.
  • A torus primitive, often representing a ring or donut shape The set of points some distance from a circle centered at the origin
  • A triangle in 2D space
  • A 3D triangle primitive.
  • A rectangle defined by two opposite corners.
  • A 2-dimensional vector.
  • A 3-dimensional vector.
  • A 4-dimensional vector.
  • A curve that is defined by interpolation over unevenly spaced samples, interpolated automatically using a particularly well-behaved interpolation.
  • A curve that is defined by interpolation over unevenly spaced samples with explicit interpolation.
  • A 2-dimensional vector.
  • A 3-dimensional vector.
  • A 4-dimensional vector.
  • A curve that combines the output data from two constituent curves into a tuple output. Curves of this type are produced by Curve::zip.

Enums§

  • An error indicating that an end-to-end composition couldn’t be performed because of malformed inputs.
  • An error that happens when creating a ConvexPolygon.
  • Error during construction of CubicNurbs
  • Curve functions over the unit interval, commonly used for easing transitions.
  • Euler rotation sequences.
  • An error indicating that a linear reparametrization couldn’t be performed because of malformed inputs.
  • An error indicating that a ping ponging of a curve couldn’t be performed because of malformed inputs.
  • An error indicating that a repetition of a curve couldn’t be performed because of malformed inputs.
  • An error indicating that a resampling operation could not be performed because of malformed inputs.
  • An error indicating that a reversion of a curve couldn’t be performed because of malformed inputs.
  • The type of torus determined by the minor and major radii
  • The winding order for a set of points

Traits§

  • Implement this on cubic splines that can generate a cubic curve from their spline parameters.
  • A trait for a type that can represent values of type T parametrized over a fixed interval.
  • Implement this on cubic splines that can generate a cyclic cubic curve from their spline parameters.
  • A type whose values can be eased between.
  • A trait for extending f32 and f64 with extra methods.
  • Ergonomics trait for a type with a Standard distribution, allowing values to be generated uniformly from an Rng by a method in its own namespace.
  • A trait for getting measurements of 2D shapes
  • A trait for getting measurements of 3D shapes
  • A marker trait for 2D primitives
  • A marker trait for 3D primitives
  • Implement this on cubic splines that can generate a rational cubic curve from their spline parameters.
  • Exposes methods to uniformly sample a variety of primitive shapes.
  • A type with a natural interpolation that provides strong subdivision guarantees.

Functions§