Skip to main content

Crate physics_toy_sandbox

Crate physics_toy_sandbox 

Source
Expand description

§Physics Toy Sandbox

A remixable physics playground - Rube Goldberg machine builder for Jugar.

This crate implements the Physics Toy Sandbox specification with Toyota Way principles:

  • Kaizen: Every remix is continuous improvement
  • Poka-Yoke: Type-safe material properties (NonZeroU32 for density)
  • Jidoka: Engine versioning ensures replay compatibility
  • Mieruka: Complexity Thermometer provides visual feedback
  • Muda Elimination: No scalar fallback (SIMD support >99%)

§Architecture

┌─────────────────────────────────────────────────────────────────┐
│                    PHYSICS TOY SANDBOX                           │
├─────────────────────────────────────────────────────────────────┤
│  Contraption ──► RemixGraph ──► Storage                         │
│       │                                                          │
│       ├── MaterialProperties (Poka-Yoke: NonZeroU32 density)    │
│       ├── PhysicsConfig (versioned)                             │
│       └── SerializedEntity[]                                    │
│                                                                  │
│  ComplexityThermometer (Mieruka) ──► UI Feedback                │
└─────────────────────────────────────────────────────────────────┘

Re-exports§

pub use contraption::*;
pub use material::*;
pub use remix::*;
pub use thermometer::*;

Modules§

contraption
Contraption: A complete physics scene that can be forked and remixed
material
Material properties for physics objects
remix
Remix Graph - Lineage tracking for contraptions
thermometer
Complexity Thermometer - Mieruka (Visual Control)

Structs§

ContraptionId
Content-addressed ID for contraptions (SHA-256 based)
Transform2D
2D Transform for sandbox objects

Enums§

Difficulty
Difficulty rating for contraptions
ObjectType
Object types available in the sandbox
PhysicsBackend
Physics backend selection (Muda: no scalar fallback)
SandboxError
Errors that can occur in physics-toy-sandbox

Constants§

ENGINE_VERSION
Current engine version for compatibility tracking (Jidoka)
MAX_OBJECTS_PER_CONTRAPTION
Maximum objects per contraption (performance budget)

Type Aliases§

Result
Result type for sandbox operations