use-rigidbody 0.0.1

Rigid-body mass properties and scalar mechanics helpers for RustUse
Documentation
  • Coverage
  • 86.54%
    45 out of 52 items documented10 out of 44 items with examples
  • Size
  • Source code size: 29.51 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 610.56 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-physics
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-rigidbody

Rigid-body mass properties and scalar mechanics helpers for RustUse.

Install

[dependencies]
use-rigidbody = "0.0.1"

Foundation

use-rigidbody provides small f64-first helpers for scalar rigid-body mechanics primitives: mass properties, center of mass, moments of inertia, kinetic energy, angular momentum, simple impulse response, and small rigid-body state helpers.

Inputs are expected to be SI-style numeric values:

  • kilograms for mass
  • meters for position, radius, length, and distance
  • meters per second for velocity
  • radians for angle
  • radians per second for angular velocity
  • kilogram square meters for moment of inertia
  • kilogram meters per second for linear momentum
  • kilogram square meters per second for angular momentum
  • joules for kinetic energy
  • newton-seconds for impulse

Vector mechanics should compose with use-vector.

Simulation loops belong in top-level use-simulation.

Collision-specific helpers belong in use-collision.

Rotation-specific helpers belong in use-rotation.

Torque-specific helpers belong in use-torque.

Example

use use_rigidbody::{MassProperties, RigidBody1D, total_kinetic_energy};

let props = MassProperties::solid_sphere(5.0, 2.0).unwrap();
let body = RigidBody1D::new(props, 10.0, 3.0, 1.0, 5.0).unwrap();

assert_eq!(body.linear_momentum(), Some(15.0));
assert_eq!(body.rotational_kinetic_energy(), Some(100.0));
assert_eq!(total_kinetic_energy(5.0, 3.0, 8.0, 5.0), Some(122.5));

When to use directly

Choose use-rigidbody when you need small, reusable scalar helpers for rigid-body mass properties, inertia, momentum, kinetic energy, and simple kinematic state updates.

Scope

  • APIs stay f64-first and focus on scalar rigid-body mechanics primitives.
  • This crate is not a physics engine, collision detector, contact solver, constraint solver, game physics package, or simulation framework.
  • Vector rigid-body dynamics, joints, broad phase, narrow phase, and simulation loops are out of scope.

Status

use-rigidbody is a pre-1.0 crate with a deliberately small API.