use-rigidbody
Rigid-body mass properties and scalar mechanics helpers for RustUse.
Install
[]
= "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 ;
let props = solid_sphere.unwrap;
let body = new.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
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.