MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Kinesis Namespace Reference

Namespaces

namespace  detail
 
namespace  Discrete
 
namespace  ForceFields
 
namespace  Stochastic
 
namespace  TimeMaps
 
namespace  Vision
 

Classes

struct  AABB1D
 Closed interval on a scalar axis. More...
 
struct  AABB2D
 Axis-aligned bounding rectangle in a 2D coordinate space. More...
 
struct  AABB3D
 Axis-aligned bounding box in 3D world space. More...
 
struct  BasisMatrices
 
struct  BoundingSphere
 Spherical fast-reject hint in world space. More...
 
struct  BoxExtent
 An axis-aligned interval per axis, with a soft outer margin. More...
 
struct  CurveChunk
 A contiguous run of samples evaluated in one pass. More...
 
class  CurveEvaluator
 Reusable interpolation state for callers evaluating many curves. More...
 
struct  DualField
 One authored expression carried as both a host callable and shader text. More...
 
struct  EllipsoidExtent
 A centre, a radius per axis, and a soft outer shell. More...
 
struct  estimate_component_count
 Number of scalar components Estimate must independently track for T. More...
 
struct  estimate_component_count< glm::vec< L, U, Q > >
 
struct  FeatureMetric
 Per-axis weighting and wrapping for a space whose axes carry different units. More...
 
struct  FieldSource
 Parsed representation of a stringified field lambda. More...
 
struct  FlyKeyMap
 Key assignments for the Fly navigation preset. More...
 
class  HampelFilter
 Holds the last accepted value when a new sample looks like an isolated outlier relative to its recent neighbors. More...
 
struct  HitResult
 Entity id and perpendicular distance from the ray axis. More...
 
struct  InterpolatedEdge
 
struct  LagRelation
 A candidate offset between two streams and how strongly the windows support it. More...
 
struct  Lattice1D
 A regular subdivision of an AABB1D into a number of cells. More...
 
struct  Lattice2D
 A regular subdivision of an AABB2D into a cell count per axis. More...
 
struct  Lattice3D
 A regular subdivision of an AABB3D into a cell count per axis. More...
 
struct  LatticeSemantics
 Interpretation attached to one named quantity sampled over a lattice. More...
 
class  MotionChannel
 Wires Estimate, Differential, and HampelFilter for one stream without hiding any of them. More...
 
struct  NavigationConfig
 Tuning parameters for a first-person fly-navigation controller. More...
 
struct  NavigationState
 Mutable first-person navigation state. More...
 
struct  OrbitConfig
 Construction parameters for an orbit navigation controller. More...
 
struct  OrbitKeyMap
 Key assignments for the Orbit navigation preset. More...
 
struct  OrbitState
 Mutable orbit navigation state. More...
 
struct  PanZoom2DConfig
 Construction parameters for a 2D pan/zoom orthographic controller. More...
 
struct  PanZoom2DKeyMap
 Input assignments for the PanZoom2D navigation preset. More...
 
struct  PanZoom2DState
 Mutable 2D pan/zoom navigation state. More...
 
struct  ParametricField
 An authored expression of position, time and a parameter block, shader-only. More...
 
struct  PeriodEstimate
 A candidate repetition period and how strongly the window actually supports it. More...
 
struct  ProximityConfig
 
struct  QuadGeometry
 Textured quad vertex data together with its semantic layout descriptor. More...
 
struct  QueryResult
 Result entry from a spatial query, carrying entity id and squared distance. More...
 
struct  Ray
 Origin and normalized direction in world space. More...
 
struct  RenderTransform
 Packed view, projection, and geometry matrices for rendering. More...
 
struct  SamplerBounds
 Spatial domain for vertex generation. More...
 
struct  Scissor
 NDC clip region for a draw, resolved to a pixel rect against a live framebuffer size wherever it is applied. More...
 
struct  ScreenspaceKeyMap
 Input assignments for the Screenspace navigation preset. More...
 
struct  ScrollState
 CPU-side scroll offset for a bounded content region. More...
 
class  SpatialIndex
 Lock-free spatial acceleration structure with atomic snapshot publication. More...
 
struct  SpatialSnapshot
 Immutable spatial snapshot published atomically for lock-free reads. More...
 
class  SymbolicTrajectory
 Tracks a moving point's sequence of cells through a lattice partition over time. More...
 
struct  TemporalField
 An authored expression of position and time, shader-only. More...
 
struct  Tendency
 Typed, composable, stateless callable from domain D to range R. More...
 
class  ThresholdLatch
 Two-level hysteresis turning a continuous value into a held boolean. More...
 
struct  TurningProfile
 A path's heading as a function of arc length, at a fixed sample count. More...
 
struct  ViewTransform
 View and projection matrices as a named push constant slot. More...
 

Concepts

concept  PositionCarrying
 Satisfied by any type exposing a position field convertible to glm::vec3.
 
concept  HasBounds
 Any type carrying a spatial footprint usable as a placement anchor.
 

Typedefs

using DualScalarField = DualField< float, float >
 
using DualSpatialField = DualField< glm::vec3, float >
 
using DualUVField = DualField< glm::vec3, glm::vec2 >
 
using DualVectorField = DualField< glm::vec3, glm::vec3 >
 
using EdgeList = std::vector< std::pair< size_t, size_t > >
 
using ParametricSpatialField = ParametricField< glm::vec3, float >
 
using ParametricUVField = ParametricField< glm::vec3, glm::vec2 >
 
using ParametricVectorField = ParametricField< glm::vec3, glm::vec3 >
 
using ScalarField = Tendency< float, float >
 
using SpatialField = Tendency< glm::vec3, float >
 
using SpatialIndex3D = SpatialIndex< glm::vec3 >
 
using SpatialIndexND = SpatialIndex< Eigen::VectorXd >
 
using TemporalSpatialField = TemporalField< glm::vec3, float >
 
using TemporalUVField = TemporalField< glm::vec3, glm::vec2 >
 
using TemporalVectorField = TemporalField< glm::vec3, glm::vec3 >
 
using TimedField = Tendency< float, float >
 
using TimeMap = Tendency< double, double >
 
using UVField = Tendency< glm::vec3, glm::vec2 >
 
using VectorField = Tendency< glm::vec3, glm::vec3 >
 
using Vertex = Kakshya::Vertex
 

Enumerations

enum class  Align : uint8_t { Center , Start , End , Span }
 Cross-axis alignment of a placed region against its anchor. More...
 
enum class  DistanceMetric : uint8_t { EUCLIDEAN , EUCLIDEAN_SQUARED , MANHATTAN , CHEBYSHEV }
 Distance computation strategy for spatial queries. More...
 
enum class  FieldMode : uint8_t { ABSOLUTE , ACCUMULATE }
 How a field result combines with the value already present. More...
 
enum class  FieldTarget : uint16_t {
  NONE = 0U , POSITION = 1U << 0U , COLOR = 1U << 1U , NORMAL = 1U << 2U ,
  TANGENT = 1U << 3U , SCALAR = 1U << 4U , UV = 1U << 5U
}
 What a Tendency drives when applied to a vertex record. More...
 
enum class  InterpolationMode : uint8_t {
  LINEAR , CATMULL_ROM , CUBIC_HERMITE , CUBIC_BEZIER ,
  QUADRATIC_BEZIER , BSPLINE , COSINE , RADIAL_FAN_CUBIC ,
  CUSTOM
}
 Mathematical interpolation methods. More...
 
enum class  LatticeValueClass : uint8_t { Unknown , LevelSet , FogVolume , Staggered }
 What the values sampled over a lattice mean geometrically. More...
 
enum class  ProximityMode : uint8_t {
  K_NEAREST , RADIUS_THRESHOLD , MINIMUM_SPANNING_TREE , GABRIEL_GRAPH ,
  RELATIVE_NEIGHBORHOOD_GRAPH , SEQUENTIAL , NEAREST_NEIGHBOR , CUSTOM
}
 
enum class  Side : uint8_t {
  Right , Left , Above , Below ,
  Over
}
 Direction of a placed region relative to its anchor. More...
 
enum class  SpatialDistribution : uint8_t {
  RANDOM_VOLUME , RANDOM_SURFACE , GRID , SPHERE_VOLUME ,
  SPHERE_SURFACE , UNIFORM_GRID , RANDOM_SPHERE , RANDOM_CUBE ,
  PERLIN_FIELD , BROWNIAN_PATH , STRATIFIED_CUBE , SPLINE_PATH ,
  LISSAJOUS , FIBONACCI_SPHERE , FIBONACCI_SPIRAL , TORUS ,
  EMPTY
}
 Spatial distribution mode for point cloud and particle generation. More...
 
enum class  VectorVariance : uint8_t {
  Invariant , Covariant , CovariantNormalize , ContravariantRelative ,
  ContravariantAbsolute
}
 How a vector quantity's components behave under a change of frame. More...
 

Functions

AABB3D aabb (std::span< const glm::vec3 > pts) noexcept
 Axis-aligned bounding box of a plain position span.
 
template<PositionCarrying T>
AABB3D aabb (std::span< T > pts) noexcept
 Axis-aligned bounding box of a PositionCarrying span.
 
template<typename T >
T acceleration (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 Second difference: rate of change of velocity.
 
template<typename T >
T acceleration (std::span< const T > samples, double dt) noexcept
 Convenience overload of acceleration over a raw span, samples[0] newest.
 
void advance_navigation (NavigationState &state)
 Advance eye position by held movement flags against elapsed time.
 
std::function< float(glm::vec2)> angle_fraction (AABB2D region, float angle_start, float angle_end, const std::function< glm::vec2()> &live_offset={}) noexcept
 angle_fraction centred on a region.
 
std::function< float(glm::vec2)> angle_fraction (glm::vec2 center, float angle_start, float angle_end, const std::function< glm::vec2()> &live_offset={}) noexcept
 Fraction along an angular sweep about center.
 
float angular_delta (float to, float from) noexcept
 Shortest signed angular difference between two headings.
 
float angular_velocity (const Memory::HistoryBuffer< float > &headings, double dt) noexcept
 Angular velocity from consecutive headings in a HistoryBuffer.
 
float angular_velocity (std::span< const float > headings, double dt) noexcept
 Convenience overload of angular_velocity over a raw span of headings, samples[0] newest.
 
std::vector< Kakshya::Vertex > apply_color_gradient (const std::vector< glm::vec3 > &positions, const std::vector< glm::vec3 > &colors, const std::vector< float > &color_positions={}, float scalar=1.0F)
 Apply color interpolation to position vertices.
 
void apply_mouse_delta (NavigationState &state, float dx, float dy)
 Apply a mouse delta to yaw and pitch.
 
void apply_orbit_pan (OrbitState &state, float dx, float dy)
 Pan the focal point in the camera's local right/up plane.
 
void apply_orbit_rotate (OrbitState &state, float dx, float dy)
 Apply a mouse delta to azimuth and elevation.
 
void apply_orbit_scroll (OrbitState &state, float ticks)
 Dolly the camera toward or away from the focal point.
 
void apply_pan_zoom_pan (PanZoom2DState &state, float dx, float dy, float viewport_width, float viewport_height)
 Pan by a pixel delta, scaled to world units by the current zoom level.
 
void apply_pan_zoom_scroll (PanZoom2DState &state, float ticks)
 Zoom by multiplying the half-height, clamped to [min_zoom, max_zoom].
 
void apply_rotation (std::vector< glm::vec3 > &vertices, const glm::vec3 &axis, float angle, const glm::vec3 &origin=glm::vec3(0))
 Apply rotation to vertex set around arbitrary axis.
 
void apply_scale (std::vector< glm::vec3 > &vertices, const glm::vec3 &scale, const glm::vec3 &origin=glm::vec3(0))
 Apply non-uniform scaling to vertex set.
 
void apply_scroll (NavigationState &state, float ticks)
 Dolly eye along the current forward vector.
 
void apply_scroll (ScrollState &state, glm::vec2 delta) noexcept
 Add a content-space delta to the offset and clamp to content_bounds.
 
void apply_transform (std::vector< glm::vec3 > &vertices, const glm::mat4 &transform)
 Apply rigid transformation to vertex set.
 
void apply_translation (std::vector< glm::vec3 > &vertices, const glm::vec3 &displacement)
 Apply translation to vertex set.
 
std::vector< Kakshya::Vertex > apply_uniform_color (const std::vector< glm::vec3 > &positions, const glm::vec3 &color, float scalar=1.0F)
 Apply uniform color to position vertices.
 
void apply_uniform_scale (std::vector< glm::vec3 > &vertices, float scale, const glm::vec3 &origin=glm::vec3(0))
 Apply uniform scaling to vertex set.
 
std::vector< Kakshya::Vertex > apply_vertex_colors (const std::vector< glm::vec3 > &positions, const std::vector< glm::vec3 > &colors, float scalar=1.0F)
 Convert positions to LineVertex with per-vertex colors.
 
void apply_wheel_scroll (ScrollState &state, double dx, double dy, float speed=0.08F) noexcept
 Apply a wheel-tick delta, scaled by speed, and clamp.
 
double approach_rate (std::span< const double > a, std::span< const double > b, double dt) noexcept
 Rate at which two streams approach or separate.
 
std::vector< Kakshya::LineVertex > arc_outline (glm::vec2 center, float radius, float angle_start, float angle_end, uint32_t segments, glm::vec3 color=glm::vec3(1.F), float thickness=1.F)
 Arc outline as a LINE_LIST (open curve, 2 * segments vertices).
 
std::vector< glm::vec2 > arc_path (glm::vec2 center, float radius_x, float radius_y, float angle_start, float angle_end, uint32_t segments)
 Sample a circular arc as ordered NDC positions.
 
float aspect_ratio (uint32_t width, uint32_t height)
 Aspect ratio from pixel dimensions.
 
template<typename T >
T assemble_from_components (const std::array< double, estimate_component_count_v< T > > &components) noexcept
 Assemble a scalar or vector T from N doubles.
 
UVField axial_blend (const glm::vec3 &origin=glm::vec3(0.0F), float scale=1.0F, float blend=4.0F)
 axial_blend projection: blend of three axis-aligned planar projections
 
std::function< float(glm::vec2)> axis_fraction (AABB2D bounds, float handle_extent=0.F, bool horizontal=true, const std::function< glm::vec2()> &live_offset={}) noexcept
 Fraction along one axis of bounds, inverse to fader placement.
 
template<size_t N, typename T >
T backward_difference (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 N-th order backward finite difference of a HistoryBuffer, scaled by dt^N.
 
template<size_t N, typename T >
T backward_difference (std::span< const T > samples, double dt) noexcept
 Convenience overload of backward_difference<N> over a raw span.
 
template<HasBounds T>
AABB2D bounds_of (const T &obj)
 Extract the anchor region from any HasBounds object.
 
glm::mat4 box_transform (const AABB3D &source, const AABB3D &target)
 Transform that scales and translates one box onto another.
 
Eigen::VectorXd bspline_cubic (const Eigen::MatrixXd &control_points, double t)
 Uniform B-spline interpolation using Eigen matrices.
 
ViewTransform build_view_transform (const NavigationState &state, float aspect)
 Build a ViewTransform from the current NavigationState without mutating it.
 
UVField cartesian (const glm::vec3 &axis=glm::vec3(0.0F, 0.0F, 1.0F), const glm::vec3 &origin=glm::vec3(0.0F), float scale=1.0F)
 cartesian projection along a chosen axis
 
Eigen::VectorXd catmull_rom_spline (const Eigen::MatrixXd &control_points, double t, double tension=0.5)
 Catmull-Rom spline interpolation using Eigen matrices.
 
void central_difference_tangents (std::span< const double > points, size_t dim, size_t count, std::vector< double > &tangents)
 Tangents of a sampled curve by finite difference, coordinate-major.
 
template<typename T >
T central_first_derivative (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 Central difference approximation of the first derivative.
 
template<typename T >
T central_first_derivative (std::span< const T > samples, double dt) noexcept
 Convenience overload of central_first_derivative over a raw span.
 
template<typename T >
T central_second_derivative (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 Central difference approximation of the second derivative.
 
template<typename T >
T central_second_derivative (std::span< const T > samples, double dt) noexcept
 Convenience overload of central_second_derivative over a raw span.
 
glm::vec2 centroid (const Memory::HistoryBuffer< glm::vec2 > &history, size_t window) noexcept
 Mean position across a window.
 
glm::vec2 centroid (std::span< const glm::vec2 > samples, size_t window) noexcept
 Convenience overload of centroid over a raw span of positions, samples[0] newest.
 
glm::vec3 centroid (std::span< const glm::vec3 > pts) noexcept
 Arithmetic centroid of a plain position span.
 
glm::vec3 centroid (std::span< const std::byte > bytes, size_t stride, size_t offset=0) noexcept
 Arithmetic centroid of the positions in interleaved vertex bytes.
 
template<PositionCarrying T>
glm::vec3 centroid (std::span< T > pts) noexcept
 Arithmetic centroid (uniform weight) of a PositionCarrying span.
 
template<typename T , std::invocable< const T & > PosFn, std::invocable< const T & > WeightFn>
requires std::convertible_to<std::invoke_result_t<PosFn, const T&>, glm::vec3> && std::convertible_to<std::invoke_result_t<WeightFn, const T&>, float>
glm::vec3 centroid (std::span< T > pts, PosFn pos, WeightFn weight) noexcept
 Fully explicit weighted centroid for arbitrary point types.
 
template<PositionCarrying T, std::invocable< const T & > WeightFn>
requires std::convertible_to<std::invoke_result_t<WeightFn, const T&>, float>
glm::vec3 centroid (std::span< T > pts, WeightFn weight) noexcept
 Scalar-weighted centroid of a PositionCarrying span.
 
template<typename A , typename B , typename C >
Tendency< A, C > chain (const Tendency< A, B > &first, const Tendency< B, C > &second)
 Sequential composition: evaluate first, feed result into second.
 
float channel_curvature (MotionChannel< glm::vec2 > &channel)
 Curvature helper for MotionChannel<glm::vec2>, self-calibrating its min_speed guard from the channel's own learned noise floor.
 
template<typename T >
std::vector< T > chronological_window (const Memory::HistoryBuffer< T > &history, size_t window) noexcept
 Copy the newest window samples out of a history buffer in chronological order.
 
std::vector< Kakshya::LineVertex > circle_outline (glm::vec2 center, float radius, uint32_t segments, glm::vec3 color=glm::vec3(1.F), float thickness=1.F)
 Circle outline as a LINE_LIST (closed loop, 2 * segments vertices).
 
std::function< bool(glm::vec2)> circular_bounds (glm::vec2 center, float radius) noexcept
 Containment test for a circle.
 
std::function< bool(glm::vec3)> circular_bounds (glm::vec3 center, float radius) noexcept
 Containment test for a sphere.
 
template<typename D >
Tendency< D, float > clamp (const Tendency< D, float > &t, float lo, float hi)
 Clamp scalar output to [lo, hi].
 
glm::vec2 clamp_offset_to_content (glm::vec2 offset, glm::vec2 viewport_extent, AABB2D content_bounds) noexcept
 Clamp a content-space offset so a viewport of the given extent never scrolls past the edges of a content region, per axis.
 
double coherence (std::span< const std::span< const double > > streams) noexcept
 How tightly a set of streams move together.
 
template<typename D , typename R , typename BinaryOp >
Tendency< D, R > combine (const Tendency< D, R > &a, const Tendency< D, R > &b, BinaryOp op)
 Combine two tendencies with a binary operation on their outputs.
 
double compute_arc_length (const Eigen::MatrixXd &points)
 Compute arc length of curve using trapezoidal rule.
 
Eigen::VectorXd compute_arc_length_table (const Eigen::MatrixXd &points)
 Compute arc length parameterization table.
 
std::vector< glm::vec3 > compute_convex_hull_2d (const std::vector< glm::vec3 > &vertices, const glm::vec3 &projection_normal=glm::vec3(0, 0, 1))
 Compute convex hull of vertex set (2D projection)
 
uint32_t compute_cube_index (const float *v, float iso) noexcept
 
ViewTransform compute_orbit_view_transform (const OrbitState &state, float aspect)
 Build a ViewTransform from the current OrbitState.
 
ViewTransform compute_pan_zoom_view_transform (const PanZoom2DState &state, float aspect)
 Build a ViewTransform from the current PanZoom2DState.
 
std::vector< Kakshya::LineVertex > compute_path_curvature (const std::vector< Kakshya::LineVertex > &path_vertices, float curvature_scale, size_t stride=1)
 Compute curvature vectors along a path (2nd derivative approximation)
 
std::vector< Kakshya::LineVertex > compute_path_normals (const std::vector< Kakshya::LineVertex > &path_vertices, float normal_length, size_t stride=1)
 Compute normal vectors along a piecewise-linear path.
 
std::vector< Kakshya::LineVertex > compute_path_tangents (const std::vector< Kakshya::LineVertex > &path_vertices, float tangent_length, size_t stride=1)
 Compute tangent vectors along a piecewise-linear path.
 
ViewTransform compute_view_transform (NavigationState &state, float aspect)
 Compute a ViewTransform from the current NavigationState.
 
template<typename D , typename R >
Tendency< D, R > constant (R value)
 Tendency returning a fixed value regardless of input.
 
std::function< bool(glm::vec3)> convex_region (std::span< const std::pair< glm::vec3, float > > planes)
 Containment test for a convex volume defined by inward-facing half-planes.
 
double correlation (std::span< const double > a, std::span< const double > b) noexcept
 Pearson correlation between two equal-length windows.
 
template<typename T >
T crackle (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 Fifth difference: rate of change of jounce.
 
template<typename T >
T crackle (std::span< const T > samples, double dt) noexcept
 Convenience overload of crackle over a raw span, samples[0] newest.
 
Eigen::MatrixXd create_rotation_matrix (double angle, uint32_t axis=2, uint32_t dimensions=2)
 Create N-dimensional rotation matrix.
 
Eigen::MatrixXd create_rotation_scaling_matrix (double angle, const std::vector< double > &scale_factors, uint32_t axis=2, uint32_t dimensions=2)
 Compose rotation then scaling: S * R.
 
Eigen::MatrixXd create_scaling_matrix (const std::vector< double > &scale_factors)
 Create diagonal scaling matrix from per-axis factors.
 
Eigen::VectorXd create_translation_vector (const std::vector< double > &offsets)
 Create translation vector (not a matrix; affine embedding is caller's concern)
 
Eigen::MatrixXd create_uniform_scaling_matrix (double scale, uint32_t dimensions)
 Create uniform scaling matrix.
 
float cross_2d (const glm::vec2 &a, const glm::vec2 &b) noexcept
 2D scalar cross product, sign of turn direction
 
Eigen::VectorXd cubic_bezier (const Eigen::MatrixXd &control_points, double t)
 Cubic Bezier interpolation using Eigen matrices.
 
Eigen::VectorXd cubic_hermite (const Eigen::MatrixXd &endpoints, const Eigen::MatrixXd &tangents, double t)
 Cubic Hermite interpolation using Eigen matrices.
 
std::vector< Kakshya::Vertex > cuboid_wireframe (const glm::vec3 &center, const glm::vec3 &half, const glm::vec3 &color=glm::vec3(1.F))
 Generate a cuboid wireframe as LINE_LIST pairs.
 
float curvature (const glm::vec2 &vel, const glm::vec2 &accel, float min_speed=1e-3F) noexcept
 Signed curvature from velocity and acceleration.
 
float curvature_from_history (const Memory::HistoryBuffer< glm::vec2 > &history, double dt, float min_speed=1e-3F) noexcept
 Signed curvature computed directly from a position HistoryBuffer.
 
float curvature_from_history (std::span< const glm::vec2 > samples, double dt, float min_speed=1e-3F) noexcept
 Convenience overload of curvature_from_history over a raw span of positions, samples[0] newest.
 
EdgeList custom_proximity_graph (const Eigen::MatrixXd &points, const std::function< EdgeList(const Eigen::MatrixXd &)> &connection_function)
 Custom proximity graph via user function.
 
UVField cylindrical (const glm::vec3 &axis=glm::vec3(0.0F, 1.0F, 0.0F), const glm::vec3 &origin=glm::vec3(0.0F), float radius=1.0F, float height=1.0F)
 Cylindrical projection around a world axis.
 
template<typename T >
T damp (T current, T target, T smoothing, T dt) noexcept
 Exponential smoothing: move current toward target at rate smoothing over time step dt.
 
void damp_asymmetric (std::span< double > current, std::span< const double > target, std::span< const double > rise, std::span< const double > fall, double dt) noexcept
 damp_asymmetric over arrays, in place.
 
template<typename T >
T damp_asymmetric (T current, T target, T rise, T fall, T dt) noexcept
 damp with separate time constants for rising and falling.
 
template<typename T >
constexpr T deadzone (T x, T threshold) noexcept
 Zero values within [-threshold, threshold] and rescale the remainder to fill [0, 1] (or [-1, 1] for negative inputs).
 
template<typename T >
constexpr T denormalize (T t, T lo, T hi) noexcept
 Denormalize t from [0, 1] to [lo, hi].
 
double direction_sign (const Memory::HistoryBuffer< double > &history, double dt) noexcept
 Sign of a scalar first difference.
 
double direction_sign (std::span< const double > samples, double dt) noexcept
 Convenience overload of direction_sign over a raw span, samples[0] newest.
 
SpatialField distance (const glm::vec3 &anchor, float radius, DistanceMetric metric=DistanceMetric::EUCLIDEAN)
 Normalized distance from an anchor point using the specified metric.
 
glm::vec2 drag_to_offset_delta (glm::vec2 pixel_delta, glm::vec2 visible_extent, glm::vec2 viewport_size_pixels) noexcept
 Convert a pixel-space drag delta into a content-space delta.
 
template<typename T >
float dtw_cost (std::span< const T > a, std::span< const T > b, const std::function< float(const T &, const T &)> &distance, size_t band=0)
 Dynamic time warping cost between two sequences.
 
template<typename Lambda >
auto dual_field (std::string name, Lambda &&fn, std::string_view text)
 Build a DualField from a lambda and its stringified text.
 
template<typename T >
constexpr T ease_in (T t) noexcept
 Cubic ease-in: slow start, fast end.
 
template<typename T >
constexpr T ease_in_out (T t) noexcept
 Cubic ease-in-out: slow start, fast middle, slow end.
 
template<typename T >
constexpr T ease_out (T t) noexcept
 Cubic ease-out: fast start, slow end.
 
PeriodEstimate estimate_period (std::span< const double > values, double dt, double min_period, double max_period) noexcept
 Estimate a repetition period by direct autocorrelation over a bounded lag range.
 
double excursion (std::span< const double > values) noexcept
 Difference between the largest and smallest value in a window.
 
std::function< bool(glm::vec3)> extruded_polygon_region (std::span< const glm::vec2 > footprint, float y_min, float y_max)
 Containment test for a vertically extruded 2D polygon.
 
std::vector< Kakshya::Vertex > filled_arc (glm::vec2 center, float radius, float angle_start, float angle_end, uint32_t segments, glm::vec3 color=glm::vec3(1.F))
 Filled circular arc sector (pie slice) as a TRIANGLE_LIST fan.
 
std::vector< Kakshya::Vertex > filled_circle (glm::vec2 center, float radius, uint32_t segments, glm::vec3 color=glm::vec3(1.F))
 Filled circle as a TRIANGLE_LIST triangle fan.
 
std::vector< Kakshya::Vertex > filled_polygon (glm::vec2 center, float radius, uint32_t sides, float rotation_rad=0.F, glm::vec3 color=glm::vec3(1.F))
 Filled regular n-gon as a TRIANGLE_LIST triangle fan.
 
std::array< Kakshya::Vertex, 4 > filled_rect (Kinesis::AABB2D region, glm::vec3 color=glm::vec3(1.F))
 Generate a filled TRIANGLE_STRIP quad from an AABB2D.
 
std::array< Kakshya::Vertex, 4 > filled_rect_gradient (AABB2D region, glm::vec3 color_bl, glm::vec3 color_br, glm::vec3 color_tl, glm::vec3 color_tr)
 Filled rect with per-corner colors, TRIANGLE_STRIP (4 vertices).
 
std::vector< Kakshya::Vertex > filled_ring (glm::vec2 center, float inner_r, float outer_r, uint32_t segments, glm::vec3 color=glm::vec3(1.F))
 Filled annulus (ring) as a TRIANGLE_LIST quad strip.
 
std::vector< Kakshya::Vertex > filled_rounded_rect (AABB2D region, float corner_radius, uint32_t corner_segments, glm::vec3 color=glm::vec3(1.F))
 Filled rounded rectangle as a TRIANGLE_LIST mesh.
 
BoxExtent fit_box (std::span< const Eigen::VectorXd > samples, double coverage=0.9, double softness_fraction=0.15)
 Fit a box extent covering a central fraction of a sample set.
 
EllipsoidExtent fit_ellipsoid (std::span< const Eigen::VectorXd > samples, double radius_sigma=2.0, double softness=0.5)
 Fit an ellipsoid extent from the mean and spread of a sample set.
 
FeatureMetric fit_metric (std::span< const Eigen::VectorXd > samples, const Eigen::VectorXd &periods={})
 Derive per-axis metric weights from the spread of a sample set.
 
template<size_t N, typename T >
T forward_difference (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 N-th order forward finite difference, expressed on a HistoryBuffer.
 
template<size_t N, typename T >
T forward_difference (std::span< const T > samples, double dt) noexcept
 Convenience overload of forward_difference<N> over a raw span.
 
EdgeList gabriel_graph (const Eigen::MatrixXd &points)
 Compute Gabriel graph.
 
Kakshya::MeshData generate_box (const glm::vec3 &center, const glm::vec3 &half_extents, uint32_t subdivisions=1)
 Generate a solid box as an indexed TRIANGLE_LIST mesh.
 
std::vector< glm::vec3 > generate_circle (const glm::vec3 &center, float radius, size_t segments, const glm::vec3 &normal=glm::vec3(0, 0, 1))
 Generate vertices along a circular path.
 
std::vector< glm::vec3 > generate_ellipse (const glm::vec3 &center, float semi_major, float semi_minor, size_t segments, const glm::vec3 &normal=glm::vec3(0, 0, 1))
 Generate vertices along an elliptical path.
 
Kakshya::MeshData generate_explicit_surface (std::span< const float > heights, uint32_t columns, uint32_t rows, const glm::vec2 &extent, float height_scale=1.0F, const glm::vec3 &center=glm::vec3(0.0F))
 Generate a mesh from the graph of a function sampled on a grid, y = f(x, z).
 
Kakshya::MeshData generate_grid (const glm::vec3 &center, float extent_x, float extent_z, uint32_t cols, uint32_t rows, const glm::vec3 &normal=glm::vec3(0.0F, 1.0F, 0.0F))
 Generate a subdivided flat grid in the XZ plane.
 
Eigen::MatrixXd generate_interpolated_points (const Eigen::MatrixXd &control_points, Eigen::Index num_samples, InterpolationMode mode, double tension=0.5)
 Generate interpolated points from control points.
 
MAYAFLUX_API Kakshya::MeshData generate_parametric_surface (const std::function< glm::vec3(float u, float v)> &fn, uint32_t u_segs, uint32_t v_segs)
 Generate a mesh from an arbitrary parametric surface function.
 
Kakshya::MeshData generate_parametric_surface (const std::function< glm::vec3(float, float)> &fn, uint32_t u_segs, uint32_t v_segs)
 
EdgeList generate_proximity_graph (const Eigen::MatrixXd &points, const ProximityConfig &config)
 Generate proximity graph using specified mode.
 
QuadGeometry generate_quad (glm::vec2 position=glm::vec2(0.0F), glm::vec2 scale=glm::vec2(1.0F), float rotation=0.0F)
 Generate a textured quad centred on the origin.
 
std::vector< glm::vec3 > generate_rectangle (const glm::vec3 &center, float width, float height, const glm::vec3 &normal=glm::vec3(0, 0, 1))
 Generate vertices of an axis-aligned rectangular path.
 
std::vector< glm::vec3 > generate_regular_polygon (const glm::vec3 &center, float radius, size_t sides, const glm::vec3 &normal=glm::vec3(0, 0, 1), float phase_offset=0.0F)
 Generate vertices of a regular n-gon.
 
MAYAFLUX_API Kakshya::MeshData generate_revolution (const std::function< glm::vec2(float t)> &profile_fn, uint32_t profile_segs, uint32_t radial_segs, float sweep_radians=glm::two_pi< float >())
 Revolve a 2D profile curve around the Y axis.
 
Kakshya::MeshData generate_revolution (const std::function< glm::vec2(float)> &profile_fn, uint32_t profile_segs, uint32_t radial_segs, float sweep_radians)
 
Vertex generate_sample_at (SpatialDistribution distribution, size_t index, size_t total, const SamplerBounds &bounds, Kinesis::Stochastic::Stochastic &rng)
 Generate a single sample at a specific index (for indexed/sequential modes).
 
std::vector< Vertex > generate_samples (SpatialDistribution distribution, size_t count, const SamplerBounds &bounds, Kinesis::Stochastic::Stochastic &rng)
 Generate a batch of spatially distributed samples.
 
MAYAFLUX_API Kakshya::MeshData generate_sdf_mesh (const Kinesis::SpatialField &field, const glm::vec3 &bounds_min, const glm::vec3 &bounds_max, uint32_t res_x, uint32_t res_y, uint32_t res_z, float iso_level=0.0F)
 Extract an isosurface from a scalar field using marching cubes.
 
MAYAFLUX_API Kakshya::MeshData generate_sdf_mesh (const Kinesis::SpatialField &field, const Lattice3D &lattice, float iso_level=0.0F)
 Extract an isosurface mesh from a scalar field over a lattice.
 
MAYAFLUX_API Kakshya::MeshData generate_tube (std::span< const glm::vec3 > path, const std::function< float(float t)> &radius_fn, uint32_t radial_segments=8, bool capped=false)
 Extrude a circle along an arbitrary 3D path.
 
Kakshya::MeshData generate_tube (std::span< const glm::vec3 > path, const std::function< float(float)> &radius_fn, uint32_t radial_segments, bool capped)
 
float heading (const glm::vec2 &v) noexcept
 Heading angle of a 2D vector.
 
glm::vec2 heading_vector (const Memory::HistoryBuffer< glm::vec2 > &history, double dt) noexcept
 Unit direction of a vec2 first difference.
 
glm::vec3 heading_vector (const Memory::HistoryBuffer< glm::vec3 > &history, double dt) noexcept
 Unit direction of a vec3 first difference.
 
glm::vec2 heading_vector (std::span< const glm::vec2 > samples, double dt) noexcept
 Convenience overload of heading_vector(vec2) over a raw span, samples[0] newest.
 
glm::vec3 heading_vector (std::span< const glm::vec3 > samples, double dt) noexcept
 Convenience overload of heading_vector(vec3) over a raw span, samples[0] newest.
 
glm::vec3 hsv_to_rgb (glm::vec3 hsv) noexcept
 Convert hue, saturation and value to red, green and blue.
 
bool in_bounds (double window_x, double window_y, uint32_t width, uint32_t height)
 Check if a window-space point is within bounds.
 
Eigen::VectorXd interpolate (const Eigen::MatrixXd &control_points, double t, InterpolationMode mode, double tension=0.5)
 Generic interpolation dispatcher.
 
Kakshya::DataVariant interpolate_nddata (const Kakshya::DataVariant &control_points, Eigen::Index num_samples, InterpolationMode mode, double tension=0.5)
 Process DataVariant through interpolation.
 
std::function< bool(glm::vec2)> intersect_bounds (std::function< bool(glm::vec2)> a, std::function< bool(glm::vec2)> b)
 Intersection of two containment tests.
 
std::function< bool(glm::vec3)> intersect_bounds (std::function< bool(glm::vec3)> a, std::function< bool(glm::vec3)> b)
 Intersection of two 3D containment tests.
 
template<typename D >
Tendency< D, float > invert (const Tendency< D, float > &t)
 Negate a scalar-output tendency.
 
VectorField invert (const VectorField &t)
 Negate all components of a vector field.
 
template<typename T >
T jerk (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 Third difference: rate of change of acceleration.
 
template<typename T >
T jerk (std::span< const T > samples, double dt) noexcept
 Convenience overload of jerk over a raw span, samples[0] newest.
 
template<typename T >
T jounce (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 Fourth difference: rate of change of jerk.
 
template<typename T >
T jounce (std::span< const T > samples, double dt) noexcept
 Convenience overload of jounce over a raw span, samples[0] newest.
 
EdgeList k_nearest_neighbors (const Eigen::MatrixXd &points, size_t k)
 Compute K-nearest neighbors graph.
 
template<typename D >
Tendency< D, float > lerp (const Tendency< D, float > &a, const Tendency< D, float > &b, const Tendency< D, float > &weight)
 Interpolate between two tendencies controlled by a weight tendency.
 
ViewTransform look_at (const glm::vec3 &eye, const glm::vec3 &target, const glm::vec3 &up=glm::vec3(0.0F, 1.0F, 0.0F))
 Construct view matrix from eye position, target, and up vector.
 
ViewTransform look_at_perspective (const glm::vec3 &eye, const glm::vec3 &target, float fov_radians, float aspect, float near, float far, const glm::vec3 &up=glm::vec3(0.0F, 1.0F, 0.0F))
 Construct complete ViewTransform from look-at and perspective parameters.
 
NavigationState make_navigation_state (const NavigationConfig &config)
 Construct a NavigationState from a NavigationConfig.
 
OrbitState make_orbit_state (const OrbitConfig &config)
 Construct an OrbitState from an OrbitConfig.
 
PanZoom2DState make_pan_zoom_state (const PanZoom2DConfig &config)
 Construct a PanZoom2DState from a PanZoom2DConfig.
 
std::unique_ptr< SpatialIndex3D > make_spatial_index_3d (float cell_size)
 Create a 3D spatial index with Euclidean squared distance.
 
std::unique_ptr< SpatialIndexND > make_spatial_index_nd (float cell_size, uint32_t dimensions)
 Create an N-dimensional spatial index with Euclidean squared distance.
 
template<typename T >
constexpr T map (T x, T in_lo, T in_hi, T out_lo, T out_hi) noexcept
 Map x from [in_lo, in_hi] to [out_lo, out_hi], unclamped.
 
template<typename T >
constexpr T map_clamped (T x, T in_lo, T in_hi, T out_lo, T out_hi) noexcept
 Map x from [in_lo, in_hi] to [out_lo, out_hi], clamped to [out_lo, out_hi].
 
double membership (const BoxExtent &extent, const Eigen::VectorXd &point, const FeatureMetric &metric)
 Graded membership of a point in a box extent.
 
double membership (const EllipsoidExtent &extent, const Eigen::VectorXd &point, const FeatureMetric &metric)
 Graded membership of a point in an ellipsoid extent.
 
EdgeList minimum_spanning_tree (const Eigen::MatrixXd &points)
 Compute minimum spanning tree (Prim's algorithm)
 
template<typename T >
T moving_average (const Memory::HistoryBuffer< T > &history, size_t window) noexcept
 Simple moving average over the newest window samples.
 
template<typename T >
T moving_average (std::span< const T > samples, size_t window) noexcept
 Convenience overload of moving_average over a raw span, samples[0] newest.
 
glm::uvec2 ndc_size_to_pixels (const AABB2D &region, uint32_t width, uint32_t height)
 Convert an NDC AABB's extent to integer pixel dimensions.
 
glm::uvec2 ndc_size_to_pixels (const glm::vec2 &ndc_size, uint32_t width, uint32_t height)
 Convert an NDC-space size (extent) to integer pixel dimensions.
 
EdgeList nearest_neighbor_graph (const Eigen::MatrixXd &points)
 Compute nearest neighbor graph.
 
float net_displacement (const Memory::HistoryBuffer< glm::vec2 > &history, size_t window) noexcept
 Net displacement across the newest window positions.
 
double net_displacement (std::span< const double > samples, size_t window) noexcept
 Net change across the newest window, direction discarded.
 
float net_displacement (std::span< const glm::vec2 > samples, size_t window) noexcept
 Convenience overload of net_displacement over a raw span of positions, samples[0] newest.
 
template<typename T >
constexpr T normalize (T x, T lo, T hi) noexcept
 Normalize x in [lo, hi] to [0, 1], unclamped.
 
std::vector< glm::vec2 > normalize_shape (std::span< const glm::vec2 > path)
 Centre a path at the origin and scale it to unit spread.
 
glm::vec3 orbit_eye (const OrbitState &state)
 Derive eye position from the current orbit state.
 
ViewTransform ortho (float left, float right, float bottom, float top, float near=-1.0F, float far=1.0F)
 Construct orthographic projection matrix.
 
template<typename Lambda >
auto parametric_field (std::string name, Lambda &&, std::string_view text)
 Build a ParametricField from a lambda and its stringified text.
 
std::function< float(glm::vec2)> path_fraction (std::span< const glm::vec2 > points, const std::function< glm::vec2()> &live_offset={})
 Normalized arc-length position of the closest point on a polyline.
 
float path_length (const Memory::HistoryBuffer< glm::vec2 > &history, size_t window) noexcept
 Path length accumulated across the newest window positions.
 
double path_length (std::span< const double > samples, size_t window) noexcept
 Total variation: the summed absolute step across the newest window.
 
float path_length (std::span< const glm::vec2 > samples, size_t window) noexcept
 Convenience overload of path_length over a raw span of positions, samples[0] newest.
 
ViewTransform perspective (float fov_radians, float aspect, float near, float far)
 Construct perspective projection matrix.
 
template<typename T >
T ping_pong (T x, T lo, T hi) noexcept
 Ping-pong (triangle wave): fold x back and forth in [lo, hi].
 
glm::mat4 pivot_transform (const glm::vec3 &pivot, const glm::vec3 &target, const glm::quat &rotation)
 Rigid transform that rotates about a local pivot and lands the pivot on a world point.
 
AABB2D place (AABB2D anchor, Side side, float w, float h, float gap=0.F, Align align=Align::Center) noexcept
 Compute a region of size (w, h) positioned relative to anchor.
 
template<HasBounds A>
AABB2D place (const A &anchor, Side side, float w, float h, float gap=0.F, Align align=Align::Center)
 place() accepting any HasBounds anchor.
 
float point_ray_distance_sq (const Ray &ray, const glm::vec3 &point, float *out_t=nullptr)
 Squared perpendicular distance from a point to an infinite ray.
 
std::function< bool(glm::vec2)> polygon_bounds (std::span< const glm::vec2 > vertices)
 Containment test for a convex or concave polygon.
 
std::vector< Kakshya::LineVertex > polygon_outline (glm::vec2 center, float radius, uint32_t sides, float rotation_rad=0.F, glm::vec3 color=glm::vec3(1.F), float thickness=1.F)
 Regular n-gon outline as a LINE_LIST (closed loop, 2 * sides vertices).
 
std::vector< Kakshya::LineVertex > polyline (std::span< const glm::vec2 > pts, glm::vec3 color=glm::vec3(1.F), float thickness=1.F)
 Polyline as a LINE_LIST (open path, 2 * (pts.size() - 1) vertices).
 
std::vector< Kakshya::LineVertex > polyline_colored (std::span< const glm::vec2 > pts, std::span< const glm::vec3 > colors, float thickness=1.F)
 Polyline with per-vertex colors as a LINE_LIST.
 
template<typename T >
T pop (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 Sixth difference: rate of change of crackle.
 
template<typename T >
T pop (std::span< const T > samples, double dt) noexcept
 Convenience overload of pop over a raw span, samples[0] newest.
 
std::optional< glm::vec3 > position_at (std::span< const std::byte > bytes, size_t stride, size_t offset, size_t index) noexcept
 Position of one record in interleaved vertex bytes.
 
float profile_distance (const TurningProfile &a, const TurningProfile &b) noexcept
 Root mean square difference between two turning profiles.
 
void project_onto_plane (std::vector< glm::vec3 > &vertices, const glm::vec3 &plane_point, const glm::vec3 &plane_normal)
 Project vertices onto plane defined by normal.
 
Eigen::VectorXd quadratic_bezier (const Eigen::MatrixXd &control_points, double t)
 Quadratic Bezier interpolation using Eigen matrices.
 
Eigen::VectorXd radial_fan_cubic (const Eigen::MatrixXd &control_points, double t, double tension=0.5)
 Origin-oriented cubic sweep from tension * (p0 - p1) to p3.
 
EdgeList radius_threshold_graph (const Eigen::MatrixXd &points, double radius)
 Compute radius threshold graph.
 
glm::vec3 ray_at_depth (double window_x, double window_y, uint32_t width, uint32_t height, float ndc_depth, const ViewTransform &vt)
 Recover the world-space position at a known depth for a given pixel.
 
std::optional< HitResult > ray_cast (const SpatialIndex3D &index, const Ray &ray, float tolerance)
 Find the closest entity to a ray within a tolerance radius.
 
std::vector< HitResult > ray_cast_all (const SpatialIndex3D &index, const Ray &ray, float tolerance)
 Find all entities within tolerance of a ray, sorted by distance.
 
template<typename T >
std::array< double, estimate_component_count_v< T > > read_components (const T &value) noexcept
 Read T's components into an array of doubles.
 
std::array< Kakshya::LineVertex, 8 > rect_outline (AABB2D region, glm::vec3 color=glm::vec3(1.F), float thickness=1.F)
 Rectangle outline as a LINE_LIST (4 edges, 8 vertices).
 
double relation_at_lag (std::span< const double > a, std::span< const double > b, long lag) noexcept
 Correlation between two spans at a single fixed lag.
 
LagRelation relation_lag (std::span< const double > a, std::span< const double > b, long max_lag) noexcept
 Search a bounded lag range for the offset at which two streams correlate most strongly.
 
EdgeList relative_neighborhood_graph (const Eigen::MatrixXd &points)
 Compute relative neighborhood graph.
 
Eigen::MatrixXd reparameterize_by_arc_length (const Eigen::MatrixXd &points, Eigen::Index num_samples)
 Reparameterize curve by arc length.
 
std::vector< Kakshya::LineVertex > reparameterize_by_arc_length (const std::vector< Kakshya::LineVertex > &path_vertices, size_t num_samples)
 Resample path vertices for arc-length parameterization.
 
std::vector< glm::vec2 > resample_uniform (std::span< const glm::vec2 > path, size_t count)
 Resample a path to a fixed point count at uniform arc length.
 
size_t reversal_count (std::span< const double > samples, size_t window) noexcept
 Number of direction reversals across a window.
 
glm::vec3 rgb_to_hsv (glm::vec3 rgb) noexcept
 Convert red, green and blue to hue, saturation and value.
 
double roughness (std::span< const double > values, double dt) noexcept
 Mean absolute difference between consecutive samples, per second.
 
std::vector< glm::vec3 > sample_parametric_curve (const std::function< glm::vec3(float)> &curve, size_t samples)
 Sample parametric curve uniformly in parameter space.
 
double sample_table (std::span< const double > table, double t) noexcept
 Read an evenly spaced table at a position in [0, 1], interpolating linearly.
 
template<typename D >
Tendency< D, float > scale (const Tendency< D, float > &t, float factor)
 Uniform scaling of a scalar-output tendency.
 
VectorField scale (const VectorField &t, float factor)
 Uniform scaling of a vector field.
 
std::function< float(glm::vec2)> scaled (std::function< float(glm::vec2)> norm, float lo, float hi)
 Rescale a normalized projection onto an arbitrary range.
 
Ray screen_to_ray (double window_x, double window_y, uint32_t width, uint32_t height, const ViewTransform &vt)
 Construct a world-space ray from window pixel coordinates.
 
ViewTransform scroll_view_transform (const ScrollState &state) noexcept
 Build an orthographic ViewTransform that translates by +offset.
 
template<typename D , typename R >
Tendency< D, R > select (const Tendency< D, float > &predicate, const Tendency< D, R > &then_t, const Tendency< D, R > &else_t)
 Select between two tendencies based on a predicate tendency.
 
EdgeList sequential_chain (const Eigen::MatrixXd &points)
 Compute sequential chain graph.
 
float shape_distance (std::span< const glm::vec2 > a, std::span< const glm::vec2 > b, size_t samples=32)
 Root mean square point distance between two paths after resampling and normalization.
 
ScalarField sigmoid (float k, float midpoint=0.0F)
 Sigmoid: 1 / (1 + e^(-k * (x - midpoint)))
 
template<typename T >
constexpr T sign_nonzero (T x) noexcept
 Sign of x, returning -1 or +1, never 0.
 
float signed_area (std::span< const glm::vec2 > path) noexcept
 Signed area enclosed by treating the path as a closed polygon.
 
float signed_turning (std::span< const glm::vec2 > path) noexcept
 Turning accumulated along a path, with sign retained.
 
template<typename T >
T smoothed_velocity (const Memory::HistoryBuffer< T > &history, double dt, size_t window) noexcept
 Velocity averaged over a short window rather than a single interval.
 
template<typename T >
T smoothed_velocity (std::span< const T > samples, double dt, size_t window) noexcept
 Convenience overload of smoothed_velocity over a raw span, samples[0] newest.
 
template<typename T >
constexpr T smootherstep (T lo, T hi, T x) noexcept
 Ken Perlin's quintic smootherstep: C2-continuous in [lo, hi].
 
ScalarField smoothstep (float edge0, float edge1)
 Smoothstep: cubic Hermite interpolation between two edges.
 
template<typename T >
constexpr T smoothstep (T lo, T hi, T x) noexcept
 GLSL smoothstep: Hermite interpolation in [lo, hi].
 
template<typename T >
T snap (T x, T lo, T hi, T step) noexcept
 Snap x to the nearest multiple of step within [lo, hi].
 
template<typename T >
T snap (T x, T step) noexcept
 Round x to the nearest multiple of step.
 
void snap_orbit_ortho (OrbitState &state, int view)
 Snap to a named ortho view, preserving distance and focal point.
 
void snap_ortho (NavigationState &state, int view)
 Snap to a named ortho view.
 
template<typename T >
T soft_clip (T x, T limit=T { 1 }) noexcept
 Smooth bound to (-limit, limit): limit * tanh(x / limit).
 
double speed (const Memory::HistoryBuffer< double > &history, double dt) noexcept
 Absolute value of a scalar first difference.
 
float speed (const Memory::HistoryBuffer< glm::vec2 > &history, double dt) noexcept
 Magnitude of a vec2 first difference.
 
float speed (const Memory::HistoryBuffer< glm::vec3 > &history, double dt) noexcept
 Magnitude of a vec3 first difference.
 
double speed (std::span< const double > samples, double dt) noexcept
 Convenience overload of speed(double) over a raw span, samples[0] newest.
 
float speed (std::span< const glm::vec2 > samples, double dt) noexcept
 Convenience overload of speed(vec2) over a raw span, samples[0] newest.
 
float speed (std::span< const glm::vec3 > samples, double dt) noexcept
 Convenience overload of speed(vec3) over a raw span, samples[0] newest.
 
UVField spherical (const glm::vec3 &centre=glm::vec3(0.0F))
 Spherical projection from a centre point.
 
float spread_radius (const Memory::HistoryBuffer< glm::vec2 > &history, size_t window) noexcept
 Bounding radius of a window around its centroid.
 
double spread_radius (std::span< const double > samples, size_t window) noexcept
 Largest distance of any sample in a window from the window mean.
 
float spread_radius (std::span< const glm::vec2 > samples, size_t window) noexcept
 Convenience overload of spread_radius over a raw span of positions, samples[0] newest.
 
float straightness (const Memory::HistoryBuffer< glm::vec2 > &history, size_t window) noexcept
 Straightness of a path over a window, 1.0 is a straight line.
 
double straightness (std::span< const double > samples, size_t window) noexcept
 Monotonicity of a window, 1.0 for a straight run in one direction.
 
float straightness (std::span< const glm::vec2 > samples, size_t window) noexcept
 Convenience overload of straightness over a raw span of positions, samples[0] newest.
 
std::function< bool(glm::vec2)> stroke_bounds (std::span< const glm::vec2 > points, float half_thickness)
 Containment test for a polyline with a uniform half-thickness.
 
void stroke_samples (std::span< float > samples, std::optional< size_t > &previous, float position, float level) noexcept
 Write a level into an evenly spaced sample array at a fractional position, filling linearly from the previously written index.
 
std::function< bool(glm::vec2)> subtract_bounds (std::function< bool(glm::vec2)> a, std::function< bool(glm::vec2)> b)
 Difference of two containment tests.
 
std::function< bool(glm::vec3)> subtract_bounds (std::function< bool(glm::vec3)> a, std::function< bool(glm::vec3)> b)
 Difference of two 3D containment tests.
 
glm::vec3 surface_centroid (std::span< const std::byte > bytes, size_t stride, size_t offset, std::span< const uint32_t > indices) noexcept
 Area-weighted centroid of the triangles of an indexed mesh.
 
std::vector< double > tabulate (const Tendency< double, double > &f, size_t count, double from=-1.0, double to=1.0)
 Sample a tendency at evenly spaced points into an array.
 
template<typename Lambda >
auto temporal_field (std::string name, Lambda &&, std::string_view text)
 Build a TemporalField from a lambda and its stringified text.
 
std::array< Kakshya::MeshVertex, 6 > textured_mesh_rect (Kinesis::AABB2D region, float weight=0.F, glm::vec3 color=glm::vec3(1.F))
 Generate a UV-mapped TRIANGLE_LIST quad (6 vertices, 2 triangles) from an AABB2D, as Kakshya::MeshVertex.
 
std::array< Kakshya::TextureQuadVertex, 4 > textured_rect (Kinesis::AABB2D region)
 Generate a UV-mapped TRIANGLE_STRIP quad from an AABB2D.
 
template<typename D >
Tendency< D, float > threshold (const Tendency< D, float > &t, float thresh)
 Zero output below threshold, pass through above.
 
double threshold_crossing_rate (std::span< const double > values, double threshold, double dt) noexcept
 Threshold crossings per second within a window.
 
double time_above (std::span< const double > values, double threshold, double dt) noexcept
 Seconds within a window spent at or above a threshold.
 
template<typename T >
Memory::HistoryBuffer< T > to_history (std::span< const T > samples) noexcept
 Build a HistoryBuffer<T> from a newest-first span.
 
glm::vec3 to_ndc (double window_x, double window_y, uint32_t width, uint32_t height)
 Convert window pixel coordinates to NDC.
 
glm::vec3 to_ndc_aspect (double window_x, double window_y, uint32_t width, uint32_t height)
 Convert window pixel coordinates to NDC, corrected for aspect ratio.
 
glm::vec2 to_window (const glm::vec3 &ndc, uint32_t width, uint32_t height)
 Convert NDC to window pixel coordinates.
 
float total_turning (const Memory::HistoryBuffer< glm::vec2 > &history, size_t window) noexcept
 Total absolute turning accumulated across a window.
 
float total_turning (std::span< const glm::vec2 > samples, size_t window) noexcept
 Convenience overload of total_turning over a raw span of positions, samples[0] newest.
 
ScalarField transfer_curve (const std::vector< float > &coefficients)
 Transfer curve from polynomial coefficients (highest power first)
 
TurningProfile turning_profile (std::span< const glm::vec2 > path, size_t samples, bool rotation_invariant=true)
 Build a turning profile from a path.
 
std::function< bool(glm::vec2)> union_bounds (std::function< bool(glm::vec2)> a, std::function< bool(glm::vec2)> b)
 Union of two containment tests.
 
std::function< bool(glm::vec3)> union_bounds (std::function< bool(glm::vec3)> a, std::function< bool(glm::vec3)> b)
 Union of two 3D containment tests.
 
std::function< glm::vec2(glm::vec2)> unit_square (AABB2D bounds, const std::function< glm::vec2()> &live_offset={}) noexcept
 Unit-square coordinates of a point within bounds.
 
template<typename T >
T velocity (const Memory::HistoryBuffer< T > &history, double dt) noexcept
 First difference: rate of change of position.
 
template<typename T >
T velocity (std::span< const T > samples, double dt) noexcept
 Convenience overload of velocity over a raw span, samples[0] newest.
 
float winding_number (std::span< const glm::vec2 > path) noexcept
 Net revolutions a path turned through.
 
template<typename T >
T wrap (T x, T lo, T hi) noexcept
 Wrap x into [lo, hi) with modulo semantics.
 

Variables

template<typename T >
constexpr size_t estimate_component_count_v = estimate_component_count<T>::value
 
constexpr std::array< uint16_t, 256 > k_edge_table
 
constexpr std::array< FieldTarget, 6 > k_field_targets
 Single-bit targets known to this version, in vertex layout order.
 
constexpr std::array< std::array< int8_t, 16 >, 256 > k_tri_table
 
constexpr FieldTarget k_vector_targets
 Targets that accept a three-component field.